Path: blob/main/src/vs/workbench/api/browser/mainThreadDownloadService.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { Disposable } from '../../../base/common/lifecycle.js';6import { MainContext, MainThreadDownloadServiceShape } from '../common/extHost.protocol.js';7import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js';8import { IDownloadService } from '../../../platform/download/common/download.js';9import { UriComponents, URI } from '../../../base/common/uri.js';1011@extHostNamedCustomer(MainContext.MainThreadDownloadService)12export class MainThreadDownloadService extends Disposable implements MainThreadDownloadServiceShape {1314constructor(15extHostContext: IExtHostContext,16@IDownloadService private readonly downloadService: IDownloadService17) {18super();19}2021$download(uri: UriComponents, to: UriComponents): Promise<void> {22return this.downloadService.download(URI.revive(uri), URI.revive(to));23}2425}262728