Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
e371faeb
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
e371faeb
编写于
2月 10, 2021
作者:
J
João Moreno
提交者:
GitHub
2月 10, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename createChannelReceiver into ProxyChannel namespace (#116308)
上级
ddb659ae
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
157 addition
and
162 deletion
+157
-162
src/vs/base/parts/ipc/common/ipc.ts
src/vs/base/parts/ipc/common/ipc.ts
+97
-102
src/vs/base/parts/ipc/test/common/ipc.test.ts
src/vs/base/parts/ipc/test/common/ipc.test.ts
+5
-5
src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
.../code/electron-browser/sharedProcess/sharedProcessMain.ts
+4
-4
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+13
-13
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+2
-2
src/vs/platform/files/node/watcher/nsfw/watcherApp.ts
src/vs/platform/files/node/watcher/nsfw/watcherApp.ts
+2
-2
src/vs/platform/files/node/watcher/nsfw/watcherService.ts
src/vs/platform/files/node/watcher/nsfw/watcherService.ts
+2
-2
src/vs/platform/files/node/watcher/unix/watcherApp.ts
src/vs/platform/files/node/watcher/unix/watcherApp.ts
+2
-2
src/vs/platform/files/node/watcher/unix/watcherService.ts
src/vs/platform/files/node/watcher/unix/watcherService.ts
+2
-2
src/vs/platform/native/electron-sandbox/nativeHostService.ts
src/vs/platform/native/electron-sandbox/nativeHostService.ts
+2
-2
src/vs/workbench/contrib/codeEditor/electron-sandbox/displayChangeRemeasureFonts.ts
...odeEditor/electron-sandbox/displayChangeRemeasureFonts.ts
+2
-2
src/vs/workbench/contrib/webview/electron-browser/webviewIgnoreMenuShortcutsManager.ts
...iew/electron-browser/webviewIgnoreMenuShortcutsManager.ts
+2
-2
src/vs/workbench/contrib/webview/electron-sandbox/resourceLoading.ts
...bench/contrib/webview/electron-sandbox/resourceLoading.ts
+2
-2
src/vs/workbench/contrib/webview/electron-sandbox/windowIgnoreMenuShortcutsManager.ts
...view/electron-sandbox/windowIgnoreMenuShortcutsManager.ts
+2
-2
src/vs/workbench/services/diagnostics/electron-sandbox/diagnosticsService.ts
...rvices/diagnostics/electron-sandbox/diagnosticsService.ts
+2
-2
src/vs/workbench/services/encryption/electron-sandbox/encryptionService.ts
...services/encryption/electron-sandbox/encryptionService.ts
+2
-2
src/vs/workbench/services/extensionManagement/electron-sandbox/extensionUrlTrustService.ts
...onManagement/electron-sandbox/extensionUrlTrustService.ts
+2
-2
src/vs/workbench/services/issue/electron-sandbox/issueService.ts
...workbench/services/issue/electron-sandbox/issueService.ts
+2
-2
src/vs/workbench/services/keybinding/electron-sandbox/nativeKeyboardLayout.ts
...vices/keybinding/electron-sandbox/nativeKeyboardLayout.ts
+2
-2
src/vs/workbench/services/localizations/electron-sandbox/localizationsService.ts
...es/localizations/electron-sandbox/localizationsService.ts
+2
-2
src/vs/workbench/services/menubar/electron-sandbox/menubarService.ts
...bench/services/menubar/electron-sandbox/menubarService.ts
+2
-2
src/vs/workbench/services/url/electron-sandbox/urlService.ts
src/vs/workbench/services/url/electron-sandbox/urlService.ts
+2
-2
src/vs/workbench/services/workspaces/electron-sandbox/workspacesService.ts
...services/workspaces/electron-sandbox/workspacesService.ts
+2
-2
未找到文件。
src/vs/base/parts/ipc/common/ipc.ts
浏览文件 @
e371faeb
...
...
@@ -1023,146 +1023,141 @@ export class StaticRouter<TContext = string> implements IClientRouter<TContext>
}
}
//#region createChannelReceiver / createChannelSender
/**
* Use both `createChannelReceiver` and `createChannelSender`
* for automated process <=> process communication over methods
* and events. You do not need to spell out each method on both
* sides, a proxy will take care of this.
* Use ProxyChannels to automatically wrapping and unwrapping
* services to/from IPC channels, instead of manually wrapping
* each service method and event.
*
* R
ule
s:
* -
i
f marshalling is enabled, only `URI` and `RegExp` is converted
* R
estriction
s:
* -
I
f marshalling is enabled, only `URI` and `RegExp` is converted
* automatically for you
* -
events must follow the naming convention `onUpperc
ase`
* -
Events must follow the naming convention `onUpperC
ase`
* - `CancellationToken` is currently not supported
* -
i
f a context is provided, you can use `AddFirstParameterToFunctions`
* -
I
f a context is provided, you can use `AddFirstParameterToFunctions`
* utility to signal this in the receiving side type
*/
export
namespace
ProxyChannel
{
export
interface
IBaseChannel
Options
{
export
interface
IProxy
Options
{
/**
* Disables automatic marshalling of `URI`.
* If marshalling is disabled, `UriComponents`
* must be used instead.
*/
disableMarshalling
?:
boolean
;
}
/**
* Disables automatic marshalling of `URI`.
* If marshalling is disabled, `UriComponents`
* must be used instead.
*/
disableMarshalling
?:
boolean
;
}
export
interface
IChannelReceiverOptions
extends
IBaseChannel
Options
{
}
export
interface
ICreateServiceChannelOptions
extends
IProxy
Options
{
}
export
function
createChannelReceiver
(
service
:
unknown
,
options
?:
IChannelReceiver
Options
):
IServerChannel
{
const
handler
=
service
as
{
[
key
:
string
]:
unknown
};
const
disableMarshalling
=
options
&&
options
.
disableMarshalling
;
export
function
fromService
(
service
:
unknown
,
options
?:
ICreateServiceChannel
Options
):
IServerChannel
{
const
handler
=
service
as
{
[
key
:
string
]:
unknown
};
const
disableMarshalling
=
options
&&
options
.
disableMarshalling
;
// Buffer any event that should be supported by
// iterating over all property keys and finding them
const
mapEventNameToEvent
=
new
Map
<
string
,
Event
<
unknown
>>
();
for
(
const
key
in
handler
)
{
if
(
propertyIsEvent
(
key
))
{
mapEventNameToEvent
.
set
(
key
,
Event
.
buffer
(
handler
[
key
]
as
Event
<
unknown
>
,
true
));
// Buffer any event that should be supported by
// iterating over all property keys and finding them
const
mapEventNameToEvent
=
new
Map
<
string
,
Event
<
unknown
>>
();
for
(
const
key
in
handler
)
{
if
(
propertyIsEvent
(
key
))
{
mapEventNameToEvent
.
set
(
key
,
Event
.
buffer
(
handler
[
key
]
as
Event
<
unknown
>
,
true
));
}
}
}
return
new
class
implements
IServerChannel
{
return
new
class
implements
IServerChannel
{
listen
<
T
>
(
_
:
unknown
,
event
:
string
):
Event
<
T
>
{
const
eventImpl
=
mapEventNameToEvent
.
get
(
event
);
if
(
eventImpl
)
{
return
eventImpl
as
Event
<
T
>
;
}
listen
<
T
>
(
_
:
unknown
,
event
:
string
):
Event
<
T
>
{
const
eventImpl
=
mapEventNameToEvent
.
get
(
event
);
if
(
eventImpl
)
{
return
eventImpl
as
Event
<
T
>
;
}
throw
new
Error
(
`Event not found:
${
event
}
`
);
}
throw
new
Error
(
`Event not found:
${
event
}
`
);
}
call
(
_
:
unknown
,
command
:
string
,
args
?:
any
[]):
Promise
<
any
>
{
const
target
=
handler
[
command
];
if
(
typeof
target
===
'
function
'
)
{
call
(
_
:
unknown
,
command
:
string
,
args
?:
any
[]):
Promise
<
any
>
{
const
target
=
handler
[
command
];
if
(
typeof
target
===
'
function
'
)
{
// Revive unless marshalling disabled
if
(
!
disableMarshalling
&&
Array
.
isArray
(
args
))
{
for
(
let
i
=
0
;
i
<
args
.
length
;
i
++
)
{
args
[
i
]
=
revive
(
args
[
i
]);
// Revive unless marshalling disabled
if
(
!
disableMarshalling
&&
Array
.
isArray
(
args
))
{
for
(
let
i
=
0
;
i
<
args
.
length
;
i
++
)
{
args
[
i
]
=
revive
(
args
[
i
]);
}
}
return
target
.
apply
(
handler
,
args
);
}
return
target
.
apply
(
handler
,
args
);
throw
new
Error
(
`Method not found:
${
command
}
`
);
}
};
}
throw
new
Error
(
`Method not found:
${
command
}
`
);
}
};
}
export
interface
ICreateProxyServiceOptions
extends
IProxyOptions
{
export
interface
IChannelSenderOptions
extends
IBaseChannelOptions
{
/**
* If provided, will add the value of `context`
* to each method call to the target.
*/
context
?:
unknown
;
/**
* If provided, will add the value of `context`
* to each method call to the target.
*/
context
?:
unknown
;
/**
* If provided, will not proxy any of the properties
* that are part of the Map but rather return that value.
*/
properties
?:
Map
<
string
,
unknown
>
;
}
/**
* If provided, will not proxy any of the properties
* that are part of the Map but rather return that value.
*/
properties
?:
Map
<
string
,
unknown
>
;
}
export
function
toService
<
T
>
(
channel
:
IChannel
,
options
?:
ICreateProxyServiceOptions
):
T
{
const
disableMarshalling
=
options
&&
options
.
disableMarshalling
;
export
function
createChannelSender
<
T
>
(
channel
:
IChannel
,
options
?:
IChannelSenderOptions
):
T
{
const
disableMarshalling
=
options
&&
options
.
disableMarshalling
;
return
new
Proxy
({},
{
get
(
_target
:
T
,
propKey
:
PropertyKey
)
{
if
(
typeof
propKey
===
'
string
'
)
{
return
new
Proxy
({},
{
get
(
_target
:
T
,
propKey
:
PropertyKey
)
{
if
(
typeof
propKey
===
'
string
'
)
{
// Check for predefined values
if
(
options
?.
properties
?.
has
(
propKey
))
{
return
options
.
properties
.
get
(
propKey
);
}
// Check for predefined values
if
(
options
?.
properties
?.
has
(
propKey
))
{
return
options
.
properties
.
get
(
propKey
);
}
// Event
if
(
propertyIsEvent
(
propKey
))
{
return
channel
.
listen
(
propKey
);
}
// Event
if
(
propertyIsEvent
(
propKey
))
{
return
channel
.
listen
(
propKey
);
}
// Function
return
async
function
(...
args
:
any
[])
{
// Function
return
async
function
(...
args
:
any
[])
{
// Add context if any
let
methodArgs
:
any
[];
if
(
options
&&
!
isUndefinedOrNull
(
options
.
context
))
{
methodArgs
=
[
options
.
context
,
...
args
];
}
else
{
methodArgs
=
args
;
}
// Add context if any
let
methodArgs
:
any
[];
if
(
options
&&
!
isUndefinedOrNull
(
options
.
context
))
{
methodArgs
=
[
options
.
context
,
...
args
];
}
else
{
methodArgs
=
args
;
}
const
result
=
await
channel
.
call
(
propKey
,
methodArgs
);
const
result
=
await
channel
.
call
(
propKey
,
methodArgs
);
// Revive unless marshalling disabled
if
(
!
disableMarshalling
)
{
return
revive
(
result
);
}
// Revive unless marshalling disabled
if
(
!
disableMarshalling
)
{
return
revive
(
result
);
}
return
result
;
};
}
return
result
;
};
throw
new
Error
(
`Property not found:
${
String
(
propKey
)}
`
);
}
})
as
T
;
}
throw
new
Error
(
`Property not found:
${
String
(
propKey
)}
`
);
}
})
as
T
;
}
function
propertyIsEvent
(
name
:
string
):
boolean
{
// Assume a property is an event if it has a form of "onSomething"
return
name
[
0
]
===
'
o
'
&&
name
[
1
]
===
'
n
'
&&
strings
.
isUpperAsciiLetter
(
name
.
charCodeAt
(
2
));
function
propertyIsEvent
(
name
:
string
):
boolean
{
// Assume a property is an event if it has a form of "onSomething"
return
name
[
0
]
===
'
o
'
&&
name
[
1
]
===
'
n
'
&&
strings
.
isUpperAsciiLetter
(
name
.
charCodeAt
(
2
));
}
}
//#endregion
const
colorTables
=
[
[
'
#2977B1
'
,
'
#FC802D
'
,
'
#34A13A
'
,
'
#D3282F
'
,
'
#9366BA
'
],
[
'
#8B564C
'
,
'
#E177C0
'
,
'
#7F7F7F
'
,
'
#BBBE3D
'
,
'
#2EBECD
'
]
...
...
src/vs/base/parts/ipc/test/common/ipc.test.ts
浏览文件 @
e371faeb
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
assert
from
'
assert
'
;
import
{
IChannel
,
IServerChannel
,
IMessagePassingProtocol
,
IPCServer
,
ClientConnectionEvent
,
IPCClient
,
createChannelReceiver
,
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
IChannel
,
IServerChannel
,
IMessagePassingProtocol
,
IPCServer
,
ClientConnectionEvent
,
IPCClient
,
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
CancellationToken
,
CancellationTokenSource
}
from
'
vs/base/common/cancellation
'
;
import
{
canceled
}
from
'
vs/base/common/errors
'
;
...
...
@@ -332,10 +332,10 @@ suite('Base IPC', function () {
const
testServer
=
new
TestIPCServer
();
server
=
testServer
;
server
.
registerChannel
(
TestChannelId
,
createChannelReceiver
(
service
));
server
.
registerChannel
(
TestChannelId
,
ProxyChannel
.
fromService
(
service
));
client
=
testServer
.
createConnection
(
'
client1
'
);
ipcService
=
createChannelSender
(
client
.
getChannel
(
TestChannelId
));
ipcService
=
ProxyChannel
.
toService
(
client
.
getChannel
(
TestChannelId
));
});
teardown
(
function
()
{
...
...
@@ -398,10 +398,10 @@ suite('Base IPC', function () {
const
testServer
=
new
TestIPCServer
();
server
=
testServer
;
server
.
registerChannel
(
TestChannelId
,
createChannelReceiver
(
service
));
server
.
registerChannel
(
TestChannelId
,
ProxyChannel
.
fromService
(
service
));
client
=
testServer
.
createConnection
(
'
client1
'
);
ipcService
=
createChannelSender
(
client
.
getChannel
(
TestChannelId
),
{
context
:
'
Super Context
'
});
ipcService
=
ProxyChannel
.
toService
(
client
.
getChannel
(
TestChannelId
),
{
context
:
'
Super Context
'
});
});
teardown
(
function
()
{
...
...
src/vs/code/electron-browser/sharedProcess/sharedProcessMain.ts
浏览文件 @
e371faeb
...
...
@@ -8,7 +8,7 @@ import * as fs from 'fs';
import
{
release
}
from
'
os
'
;
import
{
gracefulify
}
from
'
graceful-fs
'
;
import
{
Server
as
MessagePortServer
}
from
'
vs/base/parts/ipc/electron-sandbox/ipc.mp
'
;
import
{
StaticRouter
,
createChannelSender
,
createChannelReceiver
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
StaticRouter
,
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ServiceCollection
}
from
'
vs/platform/instantiation/common/serviceCollection
'
;
import
{
SyncDescriptor
}
from
'
vs/platform/instantiation/common/descriptors
'
;
import
{
InstantiationService
}
from
'
vs/platform/instantiation/common/instantiationService
'
;
...
...
@@ -184,7 +184,7 @@ class SharedProcessMain extends Disposable {
services
.
set
(
IRequestService
,
new
SyncDescriptor
(
RequestService
));
// Native Host
const
nativeHostService
=
createChannelSender
<
INativeHostService
>
(
mainProcessService
.
getChannel
(
'
nativeHost
'
),
{
context
:
this
.
configuration
.
windowId
});
const
nativeHostService
=
ProxyChannel
.
toService
<
INativeHostService
>
(
mainProcessService
.
getChannel
(
'
nativeHost
'
),
{
context
:
this
.
configuration
.
windowId
});
services
.
set
(
INativeHostService
,
nativeHostService
);
// Download
...
...
@@ -270,12 +270,12 @@ class SharedProcessMain extends Disposable {
// Localizations
const
localizationsService
=
accessor
.
get
(
ILocalizationsService
);
const
localizationsChannel
=
createChannelReceiver
(
localizationsService
);
const
localizationsChannel
=
ProxyChannel
.
fromService
(
localizationsService
);
this
.
server
.
registerChannel
(
'
localizations
'
,
localizationsChannel
);
// Diagnostics
const
diagnosticsService
=
accessor
.
get
(
IDiagnosticsService
);
const
diagnosticsChannel
=
createChannelReceiver
(
diagnosticsService
);
const
diagnosticsChannel
=
ProxyChannel
.
fromService
(
diagnosticsService
);
this
.
server
.
registerChannel
(
'
diagnostics
'
,
diagnosticsChannel
);
// Extension Tips
...
...
src/vs/code/electron-main/app.ts
浏览文件 @
e371faeb
...
...
@@ -13,7 +13,7 @@ import { ILifecycleMainService, LifecycleMainPhase } from 'vs/platform/lifecycle
import
{
resolveShellEnv
}
from
'
vs/platform/environment/node/shellEnv
'
;
import
{
IUpdateService
}
from
'
vs/platform/update/common/update
'
;
import
{
UpdateChannel
}
from
'
vs/platform/update/electron-main/updateIpc
'
;
import
{
getDelayedChannel
,
StaticRouter
,
createChannelReceiver
,
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
getDelayedChannel
,
StaticRouter
,
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
Server
as
ElectronIPCServer
}
from
'
vs/base/parts/ipc/electron-main/ipc.electron
'
;
import
{
Server
as
NodeIPCServer
}
from
'
vs/base/parts/ipc/node/ipc.net
'
;
import
{
Client
as
MessagePortClient
}
from
'
vs/base/parts/ipc/electron-main/ipc.mp
'
;
...
...
@@ -525,7 +525,7 @@ export class CodeApplication extends Disposable {
services
.
set
(
IWindowsMainService
,
new
SyncDescriptor
(
WindowsMainService
,
[
machineId
,
this
.
userEnv
]));
services
.
set
(
IDialogMainService
,
new
SyncDescriptor
(
DialogMainService
));
services
.
set
(
ILaunchMainService
,
new
SyncDescriptor
(
LaunchMainService
));
services
.
set
(
IDiagnosticsService
,
createChannelSender
(
getDelayedChannel
(
sharedProcessReady
.
then
(
client
=>
client
.
getChannel
(
'
diagnostics
'
)))));
services
.
set
(
IDiagnosticsService
,
ProxyChannel
.
toService
(
getDelayedChannel
(
sharedProcessReady
.
then
(
client
=>
client
.
getChannel
(
'
diagnostics
'
)))));
services
.
set
(
IIssueMainService
,
new
SyncDescriptor
(
IssueMainService
,
[
machineId
,
this
.
userEnv
]));
services
.
set
(
IEncryptionMainService
,
new
SyncDescriptor
(
EncryptionMainService
,
[
machineId
]));
...
...
@@ -606,7 +606,7 @@ export class CodeApplication extends Disposable {
// Register more Main IPC services
const
launchMainService
=
accessor
.
get
(
ILaunchMainService
);
const
launchChannel
=
createChannelReceiver
(
launchMainService
,
{
disableMarshalling
:
true
});
const
launchChannel
=
ProxyChannel
.
fromService
(
launchMainService
,
{
disableMarshalling
:
true
});
this
.
mainIpcServer
.
registerChannel
(
'
launch
'
,
launchChannel
);
// Register more Electron IPC services
...
...
@@ -615,44 +615,44 @@ export class CodeApplication extends Disposable {
electronIpcServer
.
registerChannel
(
'
update
'
,
updateChannel
);
const
issueMainService
=
accessor
.
get
(
IIssueMainService
);
const
issueChannel
=
createChannelReceiver
(
issueMainService
);
const
issueChannel
=
ProxyChannel
.
fromService
(
issueMainService
);
electronIpcServer
.
registerChannel
(
'
issue
'
,
issueChannel
);
const
encryptionMainService
=
accessor
.
get
(
IEncryptionMainService
);
const
encryptionChannel
=
createChannelReceiver
(
encryptionMainService
);
const
encryptionChannel
=
ProxyChannel
.
fromService
(
encryptionMainService
);
electronIpcServer
.
registerChannel
(
'
encryption
'
,
encryptionChannel
);
const
keyboardLayoutMainService
=
accessor
.
get
(
IKeyboardLayoutMainService
);
const
keyboardLayoutChannel
=
createChannelReceiver
(
keyboardLayoutMainService
);
const
keyboardLayoutChannel
=
ProxyChannel
.
fromService
(
keyboardLayoutMainService
);
electronIpcServer
.
registerChannel
(
'
keyboardLayout
'
,
keyboardLayoutChannel
);
const
displayMainService
=
accessor
.
get
(
IDisplayMainService
);
const
displayChannel
=
createChannelReceiver
(
displayMainService
);
const
displayChannel
=
ProxyChannel
.
fromService
(
displayMainService
);
electronIpcServer
.
registerChannel
(
'
display
'
,
displayChannel
);
const
nativeHostMainService
=
this
.
nativeHostMainService
=
accessor
.
get
(
INativeHostMainService
);
const
nativeHostChannel
=
createChannelReceiver
(
this
.
nativeHostMainService
);
const
nativeHostChannel
=
ProxyChannel
.
fromService
(
this
.
nativeHostMainService
);
electronIpcServer
.
registerChannel
(
'
nativeHost
'
,
nativeHostChannel
);
sharedProcessClient
.
then
(
client
=>
client
.
registerChannel
(
'
nativeHost
'
,
nativeHostChannel
));
const
workspacesService
=
accessor
.
get
(
IWorkspacesService
);
const
workspacesChannel
=
createChannelReceiver
(
workspacesService
);
const
workspacesChannel
=
ProxyChannel
.
fromService
(
workspacesService
);
electronIpcServer
.
registerChannel
(
'
workspaces
'
,
workspacesChannel
);
const
menubarMainService
=
accessor
.
get
(
IMenubarMainService
);
const
menubarChannel
=
createChannelReceiver
(
menubarMainService
);
const
menubarChannel
=
ProxyChannel
.
fromService
(
menubarMainService
);
electronIpcServer
.
registerChannel
(
'
menubar
'
,
menubarChannel
);
const
urlService
=
accessor
.
get
(
IURLService
);
const
urlChannel
=
createChannelReceiver
(
urlService
);
const
urlChannel
=
ProxyChannel
.
fromService
(
urlService
);
electronIpcServer
.
registerChannel
(
'
url
'
,
urlChannel
);
const
extensionUrlTrustService
=
accessor
.
get
(
IExtensionUrlTrustService
);
const
extensionUrlTrustChannel
=
createChannelReceiver
(
extensionUrlTrustService
);
const
extensionUrlTrustChannel
=
ProxyChannel
.
fromService
(
extensionUrlTrustService
);
electronIpcServer
.
registerChannel
(
'
extensionUrlTrust
'
,
extensionUrlTrustChannel
);
const
webviewManagerService
=
accessor
.
get
(
IWebviewManagerService
);
const
webviewChannel
=
createChannelReceiver
(
webviewManagerService
);
const
webviewChannel
=
ProxyChannel
.
fromService
(
webviewManagerService
);
electronIpcServer
.
registerChannel
(
'
webview
'
,
webviewChannel
);
const
storageMainService
=
accessor
.
get
(
IStorageMainService
);
...
...
src/vs/code/electron-main/main.ts
浏览文件 @
e371faeb
...
...
@@ -12,7 +12,7 @@ import product from 'vs/platform/product/common/product';
import
{
parseMainProcessArgv
,
addArg
}
from
'
vs/platform/environment/node/argvHelper
'
;
import
{
createWaitMarkerFile
}
from
'
vs/platform/environment/node/waitMarkerFile
'
;
import
{
LifecycleMainService
,
ILifecycleMainService
}
from
'
vs/platform/lifecycle/electron-main/lifecycleMainService
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
Server
as
NodeIPCServer
,
serve
as
nodeIPCServe
,
connect
as
nodeIPCConnect
,
XDG_RUNTIME_DIR
}
from
'
vs/base/parts/ipc/node/ipc.net
'
;
import
{
Client
as
NodeIPCClient
}
from
'
vs/base/parts/ipc/common/ipc.net
'
;
import
{
ILaunchMainService
}
from
'
vs/platform/launch/electron-main/launchMainService
'
;
...
...
@@ -292,7 +292,7 @@ class CodeMain {
},
10000
);
}
const
launchService
=
createChannelSender
<
ILaunchMainService
>
(
client
.
getChannel
(
'
launch
'
),
{
disableMarshalling
:
true
});
const
launchService
=
ProxyChannel
.
toService
<
ILaunchMainService
>
(
client
.
getChannel
(
'
launch
'
),
{
disableMarshalling
:
true
});
// Process Info
if
(
args
.
status
)
{
...
...
src/vs/platform/files/node/watcher/nsfw/watcherApp.ts
浏览文件 @
e371faeb
...
...
@@ -5,8 +5,8 @@
import
{
Server
}
from
'
vs/base/parts/ipc/node/ipc.cp
'
;
import
{
NsfwWatcherService
}
from
'
vs/platform/files/node/watcher/nsfw/nsfwWatcherService
'
;
import
{
createChannelReceiver
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
const
server
=
new
Server
(
'
watcher
'
);
const
service
=
new
NsfwWatcherService
();
server
.
registerChannel
(
'
watcher
'
,
createChannelReceiver
(
service
));
server
.
registerChannel
(
'
watcher
'
,
ProxyChannel
.
fromService
(
service
));
src/vs/platform/files/node/watcher/nsfw/watcherService.ts
浏览文件 @
e371faeb
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
createChannelSender
,
getNextTickChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
,
getNextTickChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
Client
}
from
'
vs/base/parts/ipc/node/ipc.cp
'
;
import
{
IDiskFileChange
,
ILogMessage
}
from
'
vs/platform/files/node/watcher/watcher
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -61,7 +61,7 @@ export class FileWatcher extends Disposable {
}));
// Initialize watcher
this
.
service
=
createChannelSender
<
IWatcherService
>
(
getNextTickChannel
(
client
.
getChannel
(
'
watcher
'
)));
this
.
service
=
ProxyChannel
.
toService
<
IWatcherService
>
(
getNextTickChannel
(
client
.
getChannel
(
'
watcher
'
)));
this
.
service
.
setVerboseLogging
(
this
.
verboseLogging
);
...
...
src/vs/platform/files/node/watcher/unix/watcherApp.ts
浏览文件 @
e371faeb
...
...
@@ -5,8 +5,8 @@
import
{
Server
}
from
'
vs/base/parts/ipc/node/ipc.cp
'
;
import
{
ChokidarWatcherService
}
from
'
vs/platform/files/node/watcher/unix/chokidarWatcherService
'
;
import
{
createChannelReceiver
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
const
server
=
new
Server
(
'
watcher
'
);
const
service
=
new
ChokidarWatcherService
();
server
.
registerChannel
(
'
watcher
'
,
createChannelReceiver
(
service
));
server
.
registerChannel
(
'
watcher
'
,
ProxyChannel
.
fromService
(
service
));
src/vs/platform/files/node/watcher/unix/watcherService.ts
浏览文件 @
e371faeb
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
createChannelSender
,
getNextTickChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
,
getNextTickChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
Client
}
from
'
vs/base/parts/ipc/node/ipc.cp
'
;
import
{
IDiskFileChange
,
ILogMessage
}
from
'
vs/platform/files/node/watcher/watcher
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -62,7 +62,7 @@ export class FileWatcher extends Disposable {
}));
// Initialize watcher
this
.
service
=
createChannelSender
<
IWatcherService
>
(
getNextTickChannel
(
client
.
getChannel
(
'
watcher
'
)));
this
.
service
=
ProxyChannel
.
toService
<
IWatcherService
>
(
getNextTickChannel
(
client
.
getChannel
(
'
watcher
'
)));
this
.
service
.
init
({
...
this
.
watcherOptions
,
verboseLogging
:
this
.
verboseLogging
});
this
.
_register
(
this
.
service
.
onDidChangeFile
(
e
=>
!
this
.
isDisposed
&&
this
.
onDidFilesChange
(
e
)));
...
...
src/vs/platform/native/electron-sandbox/nativeHostService.ts
浏览文件 @
e371faeb
...
...
@@ -5,7 +5,7 @@
import
{
INativeHostService
}
from
'
vs/platform/native/electron-sandbox/native
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-sandbox/mainProcessService
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
// @ts-ignore: interface is implemented via proxy
export
class
NativeHostService
implements
INativeHostService
{
...
...
@@ -16,7 +16,7 @@ export class NativeHostService implements INativeHostService {
readonly
windowId
:
number
,
@
IMainProcessService
mainProcessService
:
IMainProcessService
)
{
return
createChannelSender
<
INativeHostService
>
(
mainProcessService
.
getChannel
(
'
nativeHost
'
),
{
return
ProxyChannel
.
toService
<
INativeHostService
>
(
mainProcessService
.
getChannel
(
'
nativeHost
'
),
{
context
:
windowId
,
properties
:
(()
=>
{
const
properties
=
new
Map
<
string
,
unknown
>
();
...
...
src/vs/workbench/contrib/codeEditor/electron-sandbox/displayChangeRemeasureFonts.ts
浏览文件 @
e371faeb
...
...
@@ -9,7 +9,7 @@ import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchCo
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-sandbox/mainProcessService
'
;
import
{
IDisplayMainService
}
from
'
vs/platform/display/common/displayMainService
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
clearAllFontInfos
}
from
'
vs/editor/browser/config/configuration
'
;
class
DisplayChangeRemeasureFonts
extends
Disposable
implements
IWorkbenchContribution
{
...
...
@@ -18,7 +18,7 @@ class DisplayChangeRemeasureFonts extends Disposable implements IWorkbenchContri
@
IMainProcessService
mainProcessService
:
IMainProcessService
)
{
super
();
const
displayMainService
=
createChannelSender
<
IDisplayMainService
>
(
mainProcessService
.
getChannel
(
'
display
'
));
const
displayMainService
=
ProxyChannel
.
toService
<
IDisplayMainService
>
(
mainProcessService
.
getChannel
(
'
display
'
));
displayMainService
.
onDidDisplayChanged
(()
=>
{
clearAllFontInfos
();
});
...
...
src/vs/workbench/contrib/webview/electron-browser/webviewIgnoreMenuShortcutsManager.ts
浏览文件 @
e371faeb
...
...
@@ -7,7 +7,7 @@ import { WebviewTag } from 'electron';
import
{
addDisposableListener
}
from
'
vs/base/browser/dom
'
;
import
{
DisposableStore
,
IDisposable
,
toDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-sandbox/mainProcessService
'
;
import
{
IWebviewManagerService
}
from
'
vs/platform/webview/common/webviewManagerService
'
;
...
...
@@ -26,7 +26,7 @@ export class WebviewIgnoreMenuShortcutsManager {
)
{
this
.
_isUsingNativeTitleBars
=
configurationService
.
getValue
<
string
>
(
'
window.titleBarStyle
'
)
===
'
native
'
;
this
.
webviewMainService
=
createChannelSender
<
IWebviewManagerService
>
(
mainProcessService
.
getChannel
(
'
webview
'
));
this
.
webviewMainService
=
ProxyChannel
.
toService
<
IWebviewManagerService
>
(
mainProcessService
.
getChannel
(
'
webview
'
));
}
public
add
(
webview
:
WebviewTag
):
IDisposable
{
...
...
src/vs/workbench/contrib/webview/electron-sandbox/resourceLoading.ts
浏览文件 @
e371faeb
...
...
@@ -9,7 +9,7 @@ import { CancellationToken } from 'vs/base/common/cancellation';
import
{
Disposable
,
toDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
URI
,
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ipcRenderer
}
from
'
vs/base/parts/sandbox/electron-sandbox/globals
'
;
import
*
as
modes
from
'
vs/editor/common/modes
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
...
...
@@ -71,7 +71,7 @@ export class WebviewResourceRequestManager extends Disposable {
this
.
_logService
.
debug
(
`WebviewResourceRequestManager(
${
this
.
id
}
): init`
);
this
.
_webviewManagerService
=
createChannelSender
<
IWebviewManagerService
>
(
mainProcessService
.
getChannel
(
'
webview
'
));
this
.
_webviewManagerService
=
ProxyChannel
.
toService
<
IWebviewManagerService
>
(
mainProcessService
.
getChannel
(
'
webview
'
));
this
.
_localResourceRoots
=
initialContentOptions
.
localResourceRoots
||
[];
this
.
_portMappings
=
initialContentOptions
.
portMapping
||
[];
...
...
src/vs/workbench/contrib/webview/electron-sandbox/windowIgnoreMenuShortcutsManager.ts
浏览文件 @
e371faeb
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
isMacintosh
}
from
'
vs/base/common/platform
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-sandbox/mainProcessService
'
;
import
{
INativeHostService
}
from
'
vs/platform/native/electron-sandbox/native
'
;
...
...
@@ -23,7 +23,7 @@ export class WindowIgnoreMenuShortcutsManager {
)
{
this
.
_isUsingNativeTitleBars
=
configurationService
.
getValue
<
string
>
(
'
window.titleBarStyle
'
)
===
'
native
'
;
this
.
webviewMainService
=
createChannelSender
<
IWebviewManagerService
>
(
mainProcessService
.
getChannel
(
'
webview
'
));
this
.
webviewMainService
=
ProxyChannel
.
toService
<
IWebviewManagerService
>
(
mainProcessService
.
getChannel
(
'
webview
'
));
}
public
didFocus
():
void
{
...
...
src/vs/workbench/services/diagnostics/electron-sandbox/diagnosticsService.ts
浏览文件 @
e371faeb
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ISharedProcessService
}
from
'
vs/platform/ipc/electron-sandbox/sharedProcessService
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IDiagnosticsService
}
from
'
vs/platform/diagnostics/common/diagnostics
'
;
...
...
@@ -16,7 +16,7 @@ export class DiagnosticsService implements IDiagnosticsService {
constructor
(
@
ISharedProcessService
sharedProcessService
:
ISharedProcessService
)
{
return
createChannelSender
<
IDiagnosticsService
>
(
sharedProcessService
.
getChannel
(
'
diagnostics
'
));
return
ProxyChannel
.
toService
<
IDiagnosticsService
>
(
sharedProcessService
.
getChannel
(
'
diagnostics
'
));
}
}
...
...
src/vs/workbench/services/encryption/electron-sandbox/encryptionService.ts
浏览文件 @
e371faeb
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-sandbox/mainProcessService
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IEncryptionService
}
from
'
vs/workbench/services/encryption/common/encryptionService
'
;
...
...
@@ -13,7 +13,7 @@ export class EncryptionService {
declare
readonly
_serviceBrand
:
undefined
;
constructor
(@
IMainProcessService
mainProcessService
:
IMainProcessService
)
{
return
createChannelSender
<
IEncryptionService
>
(
mainProcessService
.
getChannel
(
'
encryption
'
));
return
ProxyChannel
.
toService
<
IEncryptionService
>
(
mainProcessService
.
getChannel
(
'
encryption
'
));
}
}
...
...
src/vs/workbench/services/extensionManagement/electron-sandbox/extensionUrlTrustService.ts
浏览文件 @
e371faeb
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
IExtensionUrlTrustService
}
from
'
vs/platform/extensionManagement/common/extensionUrlTrust
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-sandbox/mainProcessService
'
;
...
...
@@ -13,7 +13,7 @@ class ExtensionUrlTrustService {
declare
readonly
_serviceBrand
:
undefined
;
constructor
(@
IMainProcessService
mainProcessService
:
IMainProcessService
)
{
return
createChannelSender
<
IExtensionUrlTrustService
>
(
mainProcessService
.
getChannel
(
'
extensionUrlTrust
'
));
return
ProxyChannel
.
toService
<
IExtensionUrlTrustService
>
(
mainProcessService
.
getChannel
(
'
extensionUrlTrust
'
));
}
}
...
...
src/vs/workbench/services/issue/electron-sandbox/issueService.ts
浏览文件 @
e371faeb
...
...
@@ -5,7 +5,7 @@
import
{
IIssueService
}
from
'
vs/platform/issue/electron-sandbox/issue
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-sandbox/mainProcessService
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
// @ts-ignore: interface is implemented via proxy
...
...
@@ -14,7 +14,7 @@ export class IssueService implements IIssueService {
declare
readonly
_serviceBrand
:
undefined
;
constructor
(@
IMainProcessService
mainProcessService
:
IMainProcessService
)
{
return
createChannelSender
<
IIssueService
>
(
mainProcessService
.
getChannel
(
'
issue
'
));
return
ProxyChannel
.
toService
<
IIssueService
>
(
mainProcessService
.
getChannel
(
'
issue
'
));
}
}
...
...
src/vs/workbench/services/keybinding/electron-sandbox/nativeKeyboardLayout.ts
浏览文件 @
e371faeb
...
...
@@ -15,7 +15,7 @@ import { DispatchConfig } from 'vs/platform/keyboardLayout/common/dispatchConfig
import
{
IKeyboardEvent
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-sandbox/mainProcessService
'
;
import
{
IKeyboardLayoutMainService
}
from
'
vs/platform/keyboardLayout/common/keyboardLayoutMainService
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
export
class
KeyboardLayoutService
extends
Disposable
implements
IKeyboardLayoutService
{
...
...
@@ -34,7 +34,7 @@ export class KeyboardLayoutService extends Disposable implements IKeyboardLayout
@
IMainProcessService
mainProcessService
:
IMainProcessService
)
{
super
();
this
.
_keyboardLayoutMainService
=
createChannelSender
<
IKeyboardLayoutMainService
>
(
mainProcessService
.
getChannel
(
'
keyboardLayout
'
));
this
.
_keyboardLayoutMainService
=
ProxyChannel
.
toService
<
IKeyboardLayoutMainService
>
(
mainProcessService
.
getChannel
(
'
keyboardLayout
'
));
this
.
_initPromise
=
null
;
this
.
_keyboardMapping
=
null
;
this
.
_keyboardLayoutInfo
=
null
;
...
...
src/vs/workbench/services/localizations/electron-sandbox/localizationsService.ts
浏览文件 @
e371faeb
...
...
@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ILocalizationsService
}
from
'
vs/platform/localizations/common/localizations
'
;
import
{
ISharedProcessService
}
from
'
vs/platform/ipc/electron-sandbox/sharedProcessService
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
...
...
@@ -16,7 +16,7 @@ export class LocalizationsService implements ILocalizationsService {
constructor
(
@
ISharedProcessService
sharedProcessService
:
ISharedProcessService
,
)
{
return
createChannelSender
<
ILocalizationsService
>
(
sharedProcessService
.
getChannel
(
'
localizations
'
));
return
ProxyChannel
.
toService
<
ILocalizationsService
>
(
sharedProcessService
.
getChannel
(
'
localizations
'
));
}
}
...
...
src/vs/workbench/services/menubar/electron-sandbox/menubarService.ts
浏览文件 @
e371faeb
...
...
@@ -5,7 +5,7 @@
import
{
IMenubarService
}
from
'
vs/platform/menubar/electron-sandbox/menubar
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-sandbox/mainProcessService
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
// @ts-ignore: interface is implemented via proxy
...
...
@@ -14,7 +14,7 @@ export class MenubarService implements IMenubarService {
declare
readonly
_serviceBrand
:
undefined
;
constructor
(@
IMainProcessService
mainProcessService
:
IMainProcessService
)
{
return
createChannelSender
<
IMenubarService
>
(
mainProcessService
.
getChannel
(
'
menubar
'
));
return
ProxyChannel
.
toService
<
IMenubarService
>
(
mainProcessService
.
getChannel
(
'
menubar
'
));
}
}
...
...
src/vs/workbench/services/url/electron-sandbox/urlService.ts
浏览文件 @
e371faeb
...
...
@@ -10,7 +10,7 @@ import { URLHandlerChannel } from 'vs/platform/url/common/urlIpc';
import
{
IOpenerService
,
IOpener
,
matchesScheme
}
from
'
vs/platform/opener/common/opener
'
;
import
{
IProductService
}
from
'
vs/platform/product/common/productService
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
INativeHostService
}
from
'
vs/platform/native/electron-sandbox/native
'
;
import
{
NativeURLService
}
from
'
vs/platform/url/common/urlService
'
;
...
...
@@ -31,7 +31,7 @@ export class RelayURLService extends NativeURLService implements IURLHandler, IO
)
{
super
();
this
.
urlService
=
createChannelSender
<
IURLService
>
(
mainProcessService
.
getChannel
(
'
url
'
));
this
.
urlService
=
ProxyChannel
.
toService
<
IURLService
>
(
mainProcessService
.
getChannel
(
'
url
'
));
mainProcessService
.
registerChannel
(
'
urlHandler
'
,
new
URLHandlerChannel
(
this
));
openerService
.
registerOpener
(
this
);
...
...
src/vs/workbench/services/workspaces/electron-sandbox/workspacesService.ts
浏览文件 @
e371faeb
...
...
@@ -6,7 +6,7 @@
import
{
IWorkspacesService
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-sandbox/mainProcessService
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
createChannelSender
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
ProxyChannel
}
from
'
vs/base/parts/ipc/common/ipc
'
;
import
{
INativeHostService
}
from
'
vs/platform/native/electron-sandbox/native
'
;
// @ts-ignore: interface is implemented via proxy
...
...
@@ -18,7 +18,7 @@ export class NativeWorkspacesService implements IWorkspacesService {
@
IMainProcessService
mainProcessService
:
IMainProcessService
,
@
INativeHostService
nativeHostService
:
INativeHostService
)
{
return
createChannelSender
<
IWorkspacesService
>
(
mainProcessService
.
getChannel
(
'
workspaces
'
),
{
context
:
nativeHostService
.
windowId
});
return
ProxyChannel
.
toService
<
IWorkspacesService
>
(
mainProcessService
.
getChannel
(
'
workspaces
'
),
{
context
:
nativeHostService
.
windowId
});
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录