sandbox - self invoke functions for shared process, issues and process explorer

This commit is contained in:
Benjamin Pasero
2020-09-22 08:40:57 +02:00
parent 5497e60ed2
commit 7c5934902c
7 changed files with 90 additions and 54 deletions

View File

@@ -6,28 +6,40 @@
//@ts-check
'use strict';
/**
* @type {{ load: (modules: string[], resultCallback: (result, configuration: object) => any, options?: object) => unknown }}
*/
const bootstrapWindow = (() => {
// @ts-ignore (defined in bootstrap-window.js)
return window.MonacoBootstrapWindow;
})();
(function () {
const bootstrap = bootstrapLib();
const bootstrapWindow = bootstrapWindowLib();
/**
* @type {{ avoidMonkeyPatchFromAppInsights: () => void; }}
*/
const bootstrap = (() => {
// @ts-ignore (defined in bootstrap.js)
return window.MonacoBootstrap;
})();
// Avoid Monkey Patches from Application Insights
bootstrap.avoidMonkeyPatchFromAppInsights();
// Avoid Monkey Patches from Application Insights
bootstrap.avoidMonkeyPatchFromAppInsights();
bootstrapWindow.load(['vs/code/electron-browser/sharedProcess/sharedProcessMain'], function (sharedProcess, configuration) {
sharedProcess.startup({
machineId: configuration.machineId,
windowId: configuration.windowId
// Load shared process into window
bootstrapWindow.load(['vs/code/electron-browser/sharedProcess/sharedProcessMain'], function (sharedProcess, configuration) {
sharedProcess.startup({
machineId: configuration.machineId,
windowId: configuration.windowId
});
});
});
//#region Globals
/**
* @returns {{ avoidMonkeyPatchFromAppInsights: () => void; }}
*/
function bootstrapLib() {
// @ts-ignore (defined in bootstrap.js)
return window.MonacoBootstrap;
}
/**
* @returns {{ load: (modules: string[], resultCallback: (result, configuration: object) => any, options?: object) => unknown }}
*/
function bootstrapWindowLib() {
// @ts-ignore (defined in bootstrap-window.js)
return window.MonacoBootstrapWindow;
}
//#endregion
}());