Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/api/browser/mainThreadDataChannels.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { Disposable } from '../../../base/common/lifecycle.js';
7
import { IDataChannelService } from '../../../platform/dataChannel/common/dataChannel.js';
8
import { extHostNamedCustomer, IExtHostContext } from '../../services/extensions/common/extHostCustomers.js';
9
import { ExtHostContext, ExtHostDataChannelsShape, MainContext, MainThreadDataChannelsShape } from '../common/extHost.protocol.js';
10
11
@extHostNamedCustomer(MainContext.MainThreadDataChannels)
12
export class MainThreadDataChannels extends Disposable implements MainThreadDataChannelsShape {
13
14
private readonly _proxy: ExtHostDataChannelsShape;
15
16
constructor(
17
extHostContext: IExtHostContext,
18
@IDataChannelService private readonly _dataChannelService: IDataChannelService
19
) {
20
super();
21
this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostDataChannels);
22
23
this._register(this._dataChannelService.onDidSendData(e => {
24
this._proxy.$onDidReceiveData(e.channelId, e.data);
25
}));
26
}
27
}
28
29