bail on standard start when workspace isn't trusted

上级 0bf73ff1
......@@ -22,6 +22,7 @@ import { ITimerService } from 'vs/workbench/services/timer/browser/timerService'
import { IFileService } from 'vs/platform/files/common/files';
import { URI } from 'vs/base/common/uri';
import { VSBuffer } from 'vs/base/common/buffer';
import { IWorkspaceTrustManagementService } from 'vs/platform/workspace/common/workspaceTrust';
export class StartupTimings implements IWorkbenchContribution {
......@@ -36,7 +37,8 @@ export class StartupTimings implements IWorkbenchContribution {
@ILifecycleService private readonly _lifecycleService: ILifecycleService,
@IUpdateService private readonly _updateService: IUpdateService,
@INativeWorkbenchEnvironmentService private readonly _environmentService: INativeWorkbenchEnvironmentService,
@IProductService private readonly _productService: IProductService
@IProductService private readonly _productService: IProductService,
@IWorkspaceTrustManagementService private readonly _workspaceTrustService: IWorkspaceTrustManagementService,
) {
//
this._report().catch(onUnexpectedError);
......@@ -78,6 +80,7 @@ export class StartupTimings implements IWorkbenchContribution {
private async _isStandardStartup(): Promise<string | undefined> {
// check for standard startup:
// * new window (no reload)
// * workspace is trusted
// * just one window
// * explorer viewlet visible
// * one text editor (not multiple, not webview, welcome etc...)
......@@ -85,6 +88,9 @@ export class StartupTimings implements IWorkbenchContribution {
if (this._lifecycleService.startupKind !== StartupKind.NewWindow) {
return StartupKindToString(this._lifecycleService.startupKind);
}
if (!this._workspaceTrustService.isWorkpaceTrusted()) {
return 'Workspace not trusted';
}
const windowCount = await this._nativeHostService.getWindowCount();
if (windowCount !== 1) {
return 'Expected window count : 1, Actual : ' + windowCount;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册