Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/api/browser/mainThreadDownloadService.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { Disposable } from '../../../base/common/lifecycle.js';
7
import { MainContext, MainThreadDownloadServiceShape } from '../common/extHost.protocol.js';
8
import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js';
9
import { IDownloadService } from '../../../platform/download/common/download.js';
10
import { UriComponents, URI } from '../../../base/common/uri.js';
11
12
@extHostNamedCustomer(MainContext.MainThreadDownloadService)
13
export class MainThreadDownloadService extends Disposable implements MainThreadDownloadServiceShape {
14
15
constructor(
16
extHostContext: IExtHostContext,
17
@IDownloadService private readonly downloadService: IDownloadService
18
) {
19
super();
20
}
21
22
$download(uri: UriComponents, to: UriComponents): Promise<void> {
23
return this.downloadService.download(URI.revive(uri), URI.revive(to));
24
}
25
26
}
27
28