提交 63efefc7 编写于 作者: B Benjamin Pasero

💄 around machine ID

上级 e8a40842
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as assert from 'assert';
import { getMachineId } from 'vs/base/node/id';
suite('ID', () => {
test('getMachineId', function () {
return getMachineId().then(id => {
assert.ok(id);
});
});
});
\ No newline at end of file
......@@ -37,7 +37,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { createSharedProcessContributions } from 'vs/code/electron-browser/contrib/contributions';
export interface ISharedProcessConfiguration {
machineId: string;
readonly machineId: string;
}
export function startup(configuration: ISharedProcessConfiguration) {
......
......@@ -257,7 +257,9 @@ export class CodeApplication {
this.electronIpcServer = new ElectronIPCServer();
// Resolve unique machine ID
this.logService.log('Resolving machine identifier...');
return this.resolveMachineId().then(machineId => {
this.logService.log(`Resolved machine identifier: ${machineId}`);
// Spawn shared process
this.sharedProcess = new SharedProcess(this.environmentService, machineId, this.userEnv);
......
......@@ -20,6 +20,12 @@ export class SharedProcess implements ISharedProcess {
private window: Electron.BrowserWindow;
private disposables: IDisposable[] = [];
constructor(
private environmentService: IEnvironmentService,
private readonly machineId: string,
private readonly userEnv: IProcessEnvironment
) { }
@memoize
private get _whenReady(): TPromise<void> {
this.window = new BrowserWindow({
......@@ -77,12 +83,6 @@ export class SharedProcess implements ISharedProcess {
});
}
constructor(
private environmentService: IEnvironmentService,
private machineId: string,
private userEnv: IProcessEnvironment
) { }
spawn(): void {
this.barrier.open();
}
......
......@@ -138,7 +138,7 @@ export class WindowsManager implements IWindowsMainService {
onWindowsCountChanged: CommonEvent<IWindowsCountChangedEvent> = this._onWindowsCountChanged.event;
constructor(
private machineId: string,
private readonly machineId: string,
@ILogService private logService: ILogService,
@IStorageMainService private storageMainService: IStorageMainService,
@IEnvironmentService private environmentService: IEnvironmentService,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册