diff --git a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts index c8c5fb57de0e6dc6ccf127163efd9e7384d4fa0f..5a361b5f4adb8ab87f8e3fdcc29fb3748017203d 100644 --- a/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts +++ b/src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts @@ -45,6 +45,7 @@ import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IDownloadService } from 'vs/platform/download/common/download'; import { DownloadServiceChannelClient } from 'vs/platform/download/node/downloadIpc'; +import { DefaultURITransformer } from 'vs/base/common/uriIpc'; export interface ISharedProcessConfiguration { readonly machineId: string; @@ -91,7 +92,7 @@ function main(server: Server, initData: ISharedProcessInitData, configuration: I services.set(IDialogService, new DialogChannelClient(dialogChannel)); const downloadChannel = server.getChannel('download', { routeCall: route, routeEvent: route }); - services.set(IDownloadService, new DownloadServiceChannelClient(downloadChannel)); + services.set(IDownloadService, new DownloadServiceChannelClient(downloadChannel, DefaultURITransformer)); const instantiationService = new InstantiationService(services); diff --git a/src/vs/platform/download/node/downloadIpc.ts b/src/vs/platform/download/node/downloadIpc.ts index 89b77323fc8d91d72631fa98423002cf38b15bf7..8dca2440d291c6765730a163772cada588b133d5 100644 --- a/src/vs/platform/download/node/downloadIpc.ts +++ b/src/vs/platform/download/node/downloadIpc.ts @@ -14,6 +14,7 @@ import { Event, Emitter, buffer } from 'vs/base/common/event'; import { IDownloadService } from 'vs/platform/download/common/download'; import { mkdirp } from 'vs/base/node/pfs'; import { onUnexpectedError } from 'vs/base/common/errors'; +import { IURITransformer } from 'vs/base/common/uriIpc'; export type UploadResponse = Buffer | Error | undefined; @@ -75,7 +76,7 @@ export class DownloadServiceChannel implements IDownloadServiceChannel { listen(event: string, arg?: any): Event { switch (event) { - case 'upload': return buffer(upload(arg)); + case 'upload': return buffer(upload(URI.revive(arg))); } return undefined; } @@ -89,9 +90,10 @@ export class DownloadServiceChannelClient implements IDownloadService { _serviceBrand: any; - constructor(private channel: IDownloadServiceChannel) { } + constructor(private channel: IDownloadServiceChannel, private uriTransformer: IURITransformer) { } download(from: URI, to: string): TPromise { + from = this.uriTransformer.transformOutgoing(from); const dirName = path.dirname(to); let out: fs.WriteStream; return new TPromise((c, e) => { diff --git a/src/vs/platform/extensionManagement/common/extensionManagementIpc.ts b/src/vs/platform/extensionManagement/common/extensionManagementIpc.ts index 40048fe5efa92a19a2035c0edd28a1cd5fe4a999..236e45979b3475ec3728fe49348ac12e41875778 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagementIpc.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagementIpc.ts @@ -87,15 +87,15 @@ export class ExtensionManagementChannelClient implements IExtensionManagementSer get onDidUninstallExtension(): Event { return this.channel.listen('onDidUninstallExtension'); } zip(extension: ILocalExtension): TPromise { - return this.channel.call('zip', [extension]).then(result => URI.revive(this.uriTransformer.transformIncoming(result))); + return this.channel.call('zip', [this._transformOutgoing(extension)]).then(result => URI.revive(this.uriTransformer.transformIncoming(result))); } unzip(zipLocation: URI): TPromise { - return this.channel.call('unzip', [zipLocation]); + return this.channel.call('unzip', [this.uriTransformer.transformOutgoing(zipLocation)]); } install(vsix: URI): TPromise { - return this.channel.call('install', [vsix]); + return this.channel.call('install', [this.uriTransformer.transformOutgoing(vsix)]); } installFromGallery(extension: IGalleryExtension): TPromise { diff --git a/src/vs/workbench/electron-browser/shell.ts b/src/vs/workbench/electron-browser/shell.ts index 00236f97a7bb418b984f6f9ae94e0a47cbf1fc6f..d440340a68b445fbf84f369d799a05a2f1bb4200 100644 --- a/src/vs/workbench/electron-browser/shell.ts +++ b/src/vs/workbench/electron-browser/shell.ts @@ -339,7 +339,7 @@ export class WorkbenchShell extends Disposable { sharedProcess .done(client => { - client.registerChannel('download', instantiationService.createInstance(DownloadServiceChannel)); + client.registerChannel('download', new DownloadServiceChannel()); client.registerChannel('dialog', instantiationService.createInstance(DialogChannel)); });