Use native JS Proxy for main <-> ext host proxies

This commit is contained in:
Alex Dima
2016-06-26 15:09:42 +02:00
parent 04faa2e4c1
commit 10cae007cd
30 changed files with 514 additions and 279 deletions

View File

@@ -7,13 +7,13 @@
import {notImplemented} from 'vs/base/common/errors';
import {TPromise} from 'vs/base/common/winjs.base';
import {ITelemetryService, ITelemetryInfo} from 'vs/platform/telemetry/common/telemetry';
import {Remotable, IThreadService} from 'vs/platform/thread/common/thread';
import {IThreadService} from 'vs/platform/thread/common/thread';
import {MainContext} from './extHostProtocol';
/**
* Helper always instantiated in the main process to receive telemetry events from remote telemetry services
*/
@Remotable.MainContext('RemoteTelemetryServiceHelper')
export class RemoteTelemetryServiceHelper {
export class MainThreadTelemetry {
private _telemetryService: ITelemetryService;
@@ -35,11 +35,11 @@ export class RemoteTelemetryService implements ITelemetryService {
serviceId: any;
private _name: string;
private _proxy: RemoteTelemetryServiceHelper;
private _proxy: MainThreadTelemetry;
constructor(name: string, threadService: IThreadService) {
this._name = name;
this._proxy = threadService.getRemotable(RemoteTelemetryServiceHelper);
this._proxy = threadService.get(MainContext.MainThreadTelemetry);
}
get isOptedIn(): boolean {