mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
send telemetry when keytar shim is handed out to extensions, https://github.com/microsoft/vscode/issues/115215
This commit is contained in:
@@ -59,7 +59,7 @@ export abstract class RequireInterceptor {
|
||||
const extensionPaths = await this._extHostExtensionService.getExtensionPathIndex();
|
||||
|
||||
this.register(new VSCodeNodeModuleFactory(this._apiFactory, extensionPaths, this._extensionRegistry, configProvider, this._logService));
|
||||
this.register(this._instaService.createInstance(KeytarNodeModuleFactory));
|
||||
this.register(this._instaService.createInstance(KeytarNodeModuleFactory, extensionPaths));
|
||||
if (this._initData.remote.isRemote) {
|
||||
this.register(this._instaService.createInstance(OpenNodeModuleFactory, extensionPaths, this._initData.environment.appUriScheme));
|
||||
}
|
||||
@@ -140,14 +140,17 @@ interface IKeytarModule {
|
||||
class KeytarNodeModuleFactory implements INodeModuleFactory {
|
||||
public readonly nodeModuleName: string = 'keytar';
|
||||
|
||||
private readonly _mainThreadTelemetry: MainThreadTelemetryShape;
|
||||
private alternativeNames: Set<string> | undefined;
|
||||
private _impl: IKeytarModule;
|
||||
|
||||
constructor(
|
||||
private readonly _extensionPaths: TernarySearchTree<URI, IExtensionDescription>,
|
||||
@IExtHostRpcService rpcService: IExtHostRpcService,
|
||||
@IExtHostInitDataService initData: IExtHostInitDataService,
|
||||
|
||||
) {
|
||||
this._mainThreadTelemetry = rpcService.getProxy(MainContext.MainThreadTelemetry);
|
||||
const { environment } = initData;
|
||||
const mainThreadKeytar = rpcService.getProxy(MainContext.MainThreadKeytar);
|
||||
|
||||
@@ -182,7 +185,12 @@ class KeytarNodeModuleFactory implements INodeModuleFactory {
|
||||
};
|
||||
}
|
||||
|
||||
public load(_request: string, _parent: URI): any {
|
||||
public load(_request: string, parent: URI): any {
|
||||
const ext = this._extensionPaths.findSubstr(parent);
|
||||
type ShimmingKeytarClassification = {
|
||||
extension: { classification: 'SystemMetaData', purpose: 'FeatureInsight' };
|
||||
};
|
||||
this._mainThreadTelemetry.$publicLog2<{ extension: string }, ShimmingKeytarClassification>('shimming.keytar', { extension: ext?.identifier.value ?? 'unknown_extension' });
|
||||
return this._impl;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user