Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
0c8cf08b
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0c8cf08b
编写于
1月 16, 2021
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
shared process - drop management service
上级
1caaf1b2
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
16 addition
and
88 deletion
+16
-88
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+1
-7
src/vs/code/electron-main/sharedProcess.ts
src/vs/code/electron-main/sharedProcess.ts
+6
-1
src/vs/platform/native/common/native.ts
src/vs/platform/native/common/native.ts
+1
-0
src/vs/platform/native/electron-main/nativeHostMainService.ts
...vs/platform/native/electron-main/nativeHostMainService.ts
+6
-0
src/vs/platform/sharedProcess/common/sharedProcessManagement.ts
.../platform/sharedProcess/common/sharedProcessManagement.ts
+0
-17
src/vs/platform/sharedProcess/electron-main/sharedProcessManagementMainService.ts
...ocess/electron-main/sharedProcessManagementMainService.ts
+0
-27
src/vs/platform/sharedProcess/node/sharedProcess.ts
src/vs/platform/sharedProcess/node/sharedProcess.ts
+0
-5
src/vs/workbench/electron-sandbox/actions/developerActions.ts
...vs/workbench/electron-sandbox/actions/developerActions.ts
+1
-2
src/vs/workbench/services/sharedProcess/electron-browser/sharedProcessManagementService.ts
...rocess/electron-browser/sharedProcessManagementService.ts
+0
-23
src/vs/workbench/services/sharedProcess/electron-browser/sharedProcessService.ts
...es/sharedProcess/electron-browser/sharedProcessService.ts
+0
-5
src/vs/workbench/test/electron-browser/workbenchTestServices.ts
.../workbench/test/electron-browser/workbenchTestServices.ts
+1
-0
src/vs/workbench/workbench.desktop.main.ts
src/vs/workbench/workbench.desktop.main.ts
+0
-1
未找到文件。
src/vs/code/electron-main/app.ts
浏览文件 @
0c8cf08b
...
...
@@ -68,7 +68,6 @@ import { IDiagnosticsService } from 'vs/platform/diagnostics/node/diagnosticsSer
import
{
ExtensionHostDebugBroadcastChannel
}
from
'
vs/platform/debug/common/extensionHostDebugIpc
'
;
import
{
ElectronExtensionHostDebugBroadcastChannel
}
from
'
vs/platform/debug/electron-main/extensionHostDebugIpc
'
;
import
{
INativeHostMainService
,
NativeHostMainService
}
from
'
vs/platform/native/electron-main/nativeHostMainService
'
;
import
{
ISharedProcessManagementMainService
,
SharedProcessManagementMainService
}
from
'
vs/platform/sharedProcess/electron-main/sharedProcessManagementMainService
'
;
import
{
IDialogMainService
,
DialogMainService
}
from
'
vs/platform/dialogs/electron-main/dialogMainService
'
;
import
{
withNullAsUndefined
}
from
'
vs/base/common/types
'
;
import
{
mnemonicButtonLabel
,
getPathLabel
}
from
'
vs/base/common/labels
'
;
...
...
@@ -509,7 +508,6 @@ export class CodeApplication extends Disposable {
services
.
set
(
IWindowsMainService
,
new
SyncDescriptor
(
WindowsMainService
,
[
machineId
,
this
.
userEnv
]));
services
.
set
(
IDialogMainService
,
new
SyncDescriptor
(
DialogMainService
));
services
.
set
(
ISharedProcessManagementMainService
,
new
SyncDescriptor
(
SharedProcessManagementMainService
,
[
sharedProcess
]));
services
.
set
(
ILaunchMainService
,
new
SyncDescriptor
(
LaunchMainService
));
services
.
set
(
IDiagnosticsService
,
createChannelSender
(
getDelayedChannel
(
sharedProcessReady
.
then
(
client
=>
client
.
getChannel
(
'
diagnostics
'
)))));
...
...
@@ -517,7 +515,7 @@ export class CodeApplication extends Disposable {
services
.
set
(
IEncryptionMainService
,
new
SyncDescriptor
(
EncryptionMainService
,
[
machineId
]));
services
.
set
(
IKeyboardLayoutMainService
,
new
SyncDescriptor
(
KeyboardLayoutMainService
));
services
.
set
(
IDisplayMainService
,
new
SyncDescriptor
(
DisplayMainService
));
services
.
set
(
INativeHostMainService
,
new
SyncDescriptor
(
NativeHostMainService
));
services
.
set
(
INativeHostMainService
,
new
SyncDescriptor
(
NativeHostMainService
,
[
sharedProcess
]
));
services
.
set
(
IWebviewManagerService
,
new
SyncDescriptor
(
WebviewMainService
));
services
.
set
(
IWorkspacesService
,
new
SyncDescriptor
(
WorkspacesService
));
services
.
set
(
IMenubarMainService
,
new
SyncDescriptor
(
MenubarMainService
));
...
...
@@ -621,10 +619,6 @@ export class CodeApplication extends Disposable {
electronIpcServer
.
registerChannel
(
'
nativeHost
'
,
nativeHostChannel
);
sharedProcessClient
.
then
(
client
=>
client
.
registerChannel
(
'
nativeHost
'
,
nativeHostChannel
));
const
sharedProcessMainManagementService
=
accessor
.
get
(
ISharedProcessManagementMainService
);
const
sharedProcessManagementChannel
=
createChannelReceiver
(
sharedProcessMainManagementService
);
electronIpcServer
.
registerChannel
(
'
sharedProcessManagement
'
,
sharedProcessManagementChannel
);
const
workspacesService
=
accessor
.
get
(
IWorkspacesService
);
const
workspacesChannel
=
createChannelReceiver
(
workspacesService
);
electronIpcServer
.
registerChannel
(
'
workspaces
'
,
workspacesChannel
);
...
...
src/vs/code/electron-main/sharedProcess.ts
浏览文件 @
0c8cf08b
...
...
@@ -41,10 +41,15 @@ export class SharedProcess extends Disposable implements ISharedProcess {
// Lifecycle
this
.
_register
(
this
.
lifecycleMainService
.
onWillShutdown
(()
=>
this
.
onWillShutdown
()));
// Shared process connections
// Shared process connections
from workbench windows
ipcMain
.
on
(
'
vscode:createSharedProcessMessageChannel
'
,
async
(
e
,
nonce
:
string
)
=>
{
this
.
logService
.
trace
(
'
SharedProcess: on vscode:createSharedProcessMessageChannel
'
);
// await the shared process to be overall ready
// we do not just wait for IPC ready because the
// workbench window will communicate directly
await
this
.
whenReady
();
const
port
=
await
this
.
connect
();
e
.
sender
.
postMessage
(
'
vscode:createSharedProcessMessageChannelResult
'
,
nonce
,
[
port
]);
...
...
src/vs/platform/native/common/native.ts
浏览文件 @
0c8cf08b
...
...
@@ -137,6 +137,7 @@ export interface ICommonNativeHostService {
// Development
openDevTools
(
options
?:
OpenDevToolsOptions
):
Promise
<
void
>
;
toggleDevTools
():
Promise
<
void
>
;
toggleSharedProcessWindow
():
Promise
<
void
>
;
sendInputEvent
(
event
:
MouseInputEvent
):
Promise
<
void
>
;
// Connectivity
...
...
src/vs/platform/native/electron-main/nativeHostMainService.ts
浏览文件 @
0c8cf08b
...
...
@@ -27,6 +27,7 @@ import { dirname, join } from 'vs/base/common/path';
import
product
from
'
vs/platform/product/common/product
'
;
import
{
memoize
}
from
'
vs/base/common/decorators
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ISharedProcess
}
from
'
vs/platform/sharedProcess/node/sharedProcess
'
;
export
interface
INativeHostMainService
extends
AddFirstParameterToFunctions
<
ICommonNativeHostService
,
Promise
<
unknown
>
/* only methods, not events */
,
number
|
undefined
/* window ID */
>
{
}
...
...
@@ -42,6 +43,7 @@ export class NativeHostMainService extends Disposable implements INativeHostMain
declare
readonly
_serviceBrand
:
undefined
;
constructor
(
private
sharedProcess
:
ISharedProcess
,
@
IWindowsMainService
private
readonly
windowsMainService
:
IWindowsMainService
,
@
IDialogMainService
private
readonly
dialogMainService
:
IDialogMainService
,
@
ILifecycleMainService
private
readonly
lifecycleMainService
:
ILifecycleMainService
,
...
...
@@ -628,6 +630,10 @@ export class NativeHostMainService extends Disposable implements INativeHostMain
}
}
async
toggleSharedProcessWindow
():
Promise
<
void
>
{
return
this
.
sharedProcess
.
toggle
();
}
//#endregion
//#region Registry (windows)
...
...
src/vs/platform/sharedProcess/common/sharedProcessManagement.ts
已删除
100644 → 0
浏览文件 @
1caaf1b2
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
export
const
ISharedProcessManagementService
=
createDecorator
<
ISharedProcessManagementService
>
(
'
sharedProcessManagement
'
);
export
interface
ISharedProcessManagementService
{
readonly
_serviceBrand
:
undefined
;
whenReady
():
Promise
<
void
>
;
toggleWindow
():
Promise
<
void
>
;
}
src/vs/platform/sharedProcess/electron-main/sharedProcessManagementMainService.ts
已删除
100644 → 0
浏览文件 @
1caaf1b2
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ISharedProcess
}
from
'
vs/platform/sharedProcess/node/sharedProcess
'
;
import
{
ISharedProcessManagementService
}
from
'
vs/platform/sharedProcess/common/sharedProcessManagement
'
;
export
const
ISharedProcessManagementMainService
=
createDecorator
<
ISharedProcessManagementMainService
>
(
'
sharedProcessManagementMainService
'
);
export
interface
ISharedProcessManagementMainService
extends
ISharedProcessManagementService
{
}
export
class
SharedProcessManagementMainService
implements
ISharedProcessManagementMainService
{
declare
readonly
_serviceBrand
:
undefined
;
constructor
(
private
sharedProcess
:
ISharedProcess
)
{
}
whenReady
():
Promise
<
void
>
{
return
this
.
sharedProcess
.
whenReady
();
}
async
toggleWindow
():
Promise
<
void
>
{
return
this
.
sharedProcess
.
toggle
();
}
}
src/vs/platform/sharedProcess/node/sharedProcess.ts
浏览文件 @
0c8cf08b
...
...
@@ -8,11 +8,6 @@ import { LogLevel } from 'vs/platform/log/common/log';
export
interface
ISharedProcess
{
/**
* Signals the shared process has finished initialization.
*/
whenReady
():
Promise
<
void
>
;
/**
* Toggles the visibility of the otherwise hidden
* shared process window.
...
...
src/vs/workbench/electron-sandbox/actions/developerActions.ts
浏览文件 @
0c8cf08b
...
...
@@ -9,7 +9,6 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
import
{
Action2
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
CATEGORIES
}
from
'
vs/workbench/common/actions
'
;
import
{
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ISharedProcessManagementService
}
from
'
vs/platform/sharedProcess/common/sharedProcessManagement
'
;
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
KeybindingWeight
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
IsDevelopmentContext
}
from
'
vs/platform/contextkey/common/contextkeys
'
;
...
...
@@ -79,6 +78,6 @@ export class ToggleSharedProcessAction extends Action2 {
}
async
run
(
accessor
:
ServicesAccessor
):
Promise
<
void
>
{
return
accessor
.
get
(
I
SharedProcessManagementService
).
toggle
Window
();
return
accessor
.
get
(
I
NativeHostService
).
toggleSharedProcess
Window
();
}
}
src/vs/workbench/services/sharedProcess/electron-browser/sharedProcessManagementService.ts
已删除
100644 → 0
浏览文件 @
1caaf1b2
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* 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
{
IMainProcessService
}
from
'
vs/platform/ipc/electron-sandbox/mainProcessService
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
ISharedProcessManagementService
}
from
'
vs/platform/sharedProcess/common/sharedProcessManagement
'
;
// @ts-ignore: interface is implemented via proxy
export
class
SharedProcessManagementService
implements
ISharedProcessManagementService
{
declare
readonly
_serviceBrand
:
undefined
;
constructor
(
@
IMainProcessService
mainProcessService
:
IMainProcessService
)
{
return
createChannelSender
<
ISharedProcessManagementService
>
(
mainProcessService
.
getChannel
(
'
sharedProcessManagement
'
));
}
}
registerSingleton
(
ISharedProcessManagementService
,
SharedProcessManagementService
,
true
);
src/vs/workbench/services/sharedProcess/electron-browser/sharedProcessService.ts
浏览文件 @
0c8cf08b
...
...
@@ -15,7 +15,6 @@ import { generateUuid } from 'vs/base/common/uuid';
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
ILifecycleService
}
from
'
vs/workbench/services/lifecycle/common/lifecycle
'
;
import
{
Disposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ISharedProcessManagementService
}
from
'
vs/platform/sharedProcess/common/sharedProcessManagement
'
;
export
class
SharedProcessService
extends
Disposable
implements
ISharedProcessService
{
...
...
@@ -24,7 +23,6 @@ export class SharedProcessService extends Disposable implements ISharedProcessSe
private
readonly
withSharedProcessConnection
:
Promise
<
MessagePortClient
>
;
constructor
(
@
ISharedProcessManagementService
private
readonly
sharedProcessManagementService
:
ISharedProcessManagementService
,
@
INativeHostService
private
readonly
nativeHostService
:
INativeHostService
,
@
ILogService
private
readonly
logService
:
ILogService
,
@
ILifecycleService
private
readonly
lifecycleService
:
ILifecycleService
...
...
@@ -45,9 +43,6 @@ export class SharedProcessService extends Disposable implements ISharedProcessSe
private
async
connect
():
Promise
<
MessagePortClient
>
{
this
.
logService
.
trace
(
'
Workbench->SharedProcess#connect
'
);
// await the shared process to be ready
await
this
.
sharedProcessManagementService
.
whenReady
();
// Ask to create message channel inside the window
// and send over a UUID to correlate the response
const
nonce
=
generateUuid
();
...
...
src/vs/workbench/test/electron-browser/workbenchTestServices.ts
浏览文件 @
0c8cf08b
...
...
@@ -222,6 +222,7 @@ export class TestNativeHostService implements INativeHostService {
async
exit
(
code
:
number
):
Promise
<
void
>
{
}
async
openDevTools
(
options
?:
Electron
.
OpenDevToolsOptions
|
undefined
):
Promise
<
void
>
{
}
async
toggleDevTools
():
Promise
<
void
>
{
}
async
toggleSharedProcessWindow
():
Promise
<
void
>
{
}
async
resolveProxy
(
url
:
string
):
Promise
<
string
|
undefined
>
{
return
undefined
;
}
async
readClipboardText
(
type
?:
'
selection
'
|
'
clipboard
'
|
undefined
):
Promise
<
string
>
{
return
''
;
}
async
writeClipboardText
(
text
:
string
,
type
?:
'
selection
'
|
'
clipboard
'
|
undefined
):
Promise
<
void
>
{
}
...
...
src/vs/workbench/workbench.desktop.main.ts
浏览文件 @
0c8cf08b
...
...
@@ -71,7 +71,6 @@ import 'vs/workbench/services/userDataSync/electron-browser/userDataSyncService'
import
'
vs/workbench/services/userDataSync/electron-browser/userDataSyncAccountService
'
;
import
'
vs/workbench/services/userDataSync/electron-browser/userDataSyncStoreManagementService
'
;
import
'
vs/workbench/services/userDataSync/electron-browser/userDataAutoSyncService
'
;
import
'
vs/workbench/services/sharedProcess/electron-browser/sharedProcessManagementService
'
;
import
'
vs/workbench/services/sharedProcess/electron-browser/sharedProcessService
'
;
import
'
vs/workbench/services/localizations/electron-browser/localizationsService
'
;
import
'
vs/workbench/services/diagnostics/electron-browser/diagnosticsService
'
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录