Migrate Runtime.js to ESM
Introduce a new namespace "Root" to be able to disambiguate between
Runtime the namespace and Runtime the object.
roll CodeMirror
The above line is necessary to fix the presubmit, which complains
about CodeMirror changes. This is only updating a type reference.
Bug: 1006759
Change-Id: I04941d9f18649701060e3035f7eeb2ef3abb51e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829708
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#701257}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 17cc008cf6ad28c6e8c07c638a1b380ca30e7f79
diff --git a/front_end/Runtime.js b/front_end/Runtime.js
index 7e1d7e0..e958c07 100644
--- a/front_end/Runtime.js
+++ b/front_end/Runtime.js
@@ -27,17 +27,8 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// This gets all concatenated module descriptors in the release mode.
-const allDescriptors = [];
-let applicationDescriptor;
const _loadedScripts = {};
-// FIXME: This is a workaround to force Closure compiler provide
-// the standard ES6 runtime for all modules. This should be removed
-// once Closure provides standard externs for Map et al.
-for (const k of []) { // eslint-disable-line
-}
-
(function() {
const baseUrl = self.location ? self.location.origin + self.location.pathname : '';
self._importScriptPathPrefix = baseUrl.substring(0, baseUrl.lastIndexOf('/') + 1);
@@ -48,20 +39,20 @@
/**
* @unrestricted
*/
-var Runtime = class { // eslint-disable-line
+class Runtime {
/**
- * @param {!Array.<!Runtime.ModuleDescriptor>} descriptors
+ * @param {!Array.<!ModuleDescriptor>} descriptors
*/
constructor(descriptors) {
/** @type {!Array<!Runtime.Module>} */
this._modules = [];
/** @type {!Object<string, !Runtime.Module>} */
this._modulesMap = {};
- /** @type {!Array<!Runtime.Extension>} */
+ /** @type {!Array<!Extension>} */
this._extensions = [];
/** @type {!Object<string, !function(new:Object)>} */
this._cachedTypeClasses = {};
- /** @type {!Object<string, !Runtime.ModuleDescriptor>} */
+ /** @type {!Object<string, !ModuleDescriptor>} */
this._descriptorsMap = {};
for (let i = 0; i < descriptors.length; ++i) {
@@ -264,26 +255,26 @@
* @return {!Promise.<undefined>}
*/
static async startApplication(appName) {
- console.timeStamp('Runtime.startApplication');
+ console.timeStamp('Root.Runtime.startApplication');
const allDescriptorsByName = {};
- for (let i = 0; i < allDescriptors.length; ++i) {
- const d = allDescriptors[i];
+ for (let i = 0; i < Root.allDescriptors.length; ++i) {
+ const d = Root.allDescriptors[i];
allDescriptorsByName[d['name']] = d;
}
- if (!applicationDescriptor) {
+ if (!Root.applicationDescriptor) {
let data = await Runtime.loadResourcePromise(appName + '.json');
- applicationDescriptor = JSON.parse(data);
- let descriptor = applicationDescriptor;
+ Root.applicationDescriptor = JSON.parse(data);
+ let descriptor = Root.applicationDescriptor;
while (descriptor.extends) {
data = await Runtime.loadResourcePromise(descriptor.extends + '.json');
descriptor = JSON.parse(data);
- applicationDescriptor.modules = descriptor.modules.concat(applicationDescriptor.modules);
+ Root.applicationDescriptor.modules = descriptor.modules.concat(Root.applicationDescriptor.modules);
}
}
- const configuration = applicationDescriptor.modules;
+ const configuration = Root.applicationDescriptor.modules;
const moduleJSONPromises = [];
const coreModuleNames = [];
for (let i = 0; i < configuration.length; ++i) {
@@ -319,7 +310,7 @@
* @return {!Promise.<undefined>}
*/
static startWorker(appName) {
- return Runtime.startApplication(appName).then(sendWorkerReady);
+ return Root.Runtime.startApplication(appName).then(sendWorkerReady);
function sendWorkerReady() {
self.postMessage('workerReady');
@@ -431,7 +422,7 @@
}
/**
- * @param {!Runtime.ModuleDescriptor} descriptor
+ * @param {!ModuleDescriptor} descriptor
*/
_registerModule(descriptor) {
const module = new Runtime.Module(this, descriptor);
@@ -460,7 +451,7 @@
}
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Extension} extension
* @param {?function(function(new:Object)):boolean} predicate
* @return {boolean}
*/
@@ -483,7 +474,7 @@
}
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Extension} extension
* @param {?Object} context
* @return {boolean}
*/
@@ -503,7 +494,7 @@
}
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Extension} extension
* @param {!Set.<!Function>=} currentContextTypes
* @return {boolean}
*/
@@ -527,13 +518,13 @@
* @param {*} type
* @param {?Object=} context
* @param {boolean=} sortByTitle
- * @return {!Array.<!Runtime.Extension>}
+ * @return {!Array.<!Extension>}
*/
extensions(type, context, sortByTitle) {
return this._extensions.filter(filter).sort(sortByTitle ? titleComparator : orderComparator);
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Extension} extension
* @return {boolean}
*/
function filter(extension) {
@@ -547,8 +538,8 @@
}
/**
- * @param {!Runtime.Extension} extension1
- * @param {!Runtime.Extension} extension2
+ * @param {!Extension} extension1
+ * @param {!Extension} extension2
* @return {number}
*/
function orderComparator(extension1, extension2) {
@@ -558,8 +549,8 @@
}
/**
- * @param {!Runtime.Extension} extension1
- * @param {!Runtime.Extension} extension2
+ * @param {!Extension} extension1
+ * @param {!Extension} extension2
* @return {number}
*/
function titleComparator(extension1, extension2) {
@@ -572,7 +563,7 @@
/**
* @param {*} type
* @param {?Object=} context
- * @return {?Runtime.Extension}
+ * @return {?Extension}
*/
extension(type, context) {
return this.extensions(type, context)[0] || null;
@@ -619,7 +610,7 @@
constructorFunction[Runtime._instanceSymbol] = instance;
return instance;
}
-};
+}
/** @type {!URLSearchParams} */
Runtime._queryParamsObject = new URLSearchParams(Runtime.queryParamsString());
@@ -644,7 +635,7 @@
/**
* @unrestricted
*/
-Runtime.ModuleDescriptor = class {
+class ModuleDescriptor {
constructor() {
/**
* @type {string}
@@ -652,7 +643,7 @@
this.name;
/**
- * @type {!Array.<!Runtime.ExtensionDescriptor>}
+ * @type {!Array.<!RuntimeExtensionDescriptor>}
*/
this.extensions;
@@ -676,12 +667,14 @@
*/
this.remote;
}
-};
+}
+// This class is named like this, because we already have an "ExtensionDescriptor" in the externs
+// These two do not share the same structure
/**
* @unrestricted
*/
-Runtime.ExtensionDescriptor = class {
+class RuntimeExtensionDescriptor {
constructor() {
/**
* @type {string}
@@ -703,28 +696,28 @@
*/
this.contextTypes;
}
-};
+}
/**
* @unrestricted
*/
-Runtime.Module = class {
+class Module {
/**
* @param {!Runtime} manager
- * @param {!Runtime.ModuleDescriptor} descriptor
+ * @param {!ModuleDescriptor} descriptor
*/
constructor(manager, descriptor) {
this._manager = manager;
this._descriptor = descriptor;
this._name = descriptor.name;
- /** @type {!Array<!Runtime.Extension>} */
+ /** @type {!Array<!Extension>} */
this._extensions = [];
- /** @type {!Map<string, !Array<!Runtime.Extension>>} */
+ /** @type {!Map<string, !Array<!Extension>>} */
this._extensionsByClassName = new Map();
- const extensions = /** @type {?Array.<!Runtime.ExtensionDescriptor>} */ (descriptor.extensions);
+ const extensions = /** @type {?Array.<!RuntimeExtensionDescriptor>} */ (descriptor.extensions);
for (let i = 0; extensions && i < extensions.length; ++i) {
- const extension = new Runtime.Extension(this, extensions[i]);
+ const extension = new Extension(this, extensions[i]);
this._manager._extensions.push(extension);
this._extensions.push(extension);
}
@@ -868,16 +861,15 @@
return base + this._modularizeURL(url);
}
}
-};
+}
/**
* @unrestricted
*/
-Runtime.Extension = class {
- /**
+class Extension { /**
* @param {!Runtime.Module} module
- * @param {!Runtime.ExtensionDescriptor} descriptor
+ * @param {!RuntimeExtensionDescriptor} descriptor
*/
constructor(module, descriptor) {
this._module = module;
@@ -991,12 +983,12 @@
}
return false;
}
-};
+}
/**
* @unrestricted
*/
-Runtime.ExperimentsSupport = class {
+class ExperimentsSupport {
constructor() {
this._supportEnabled = Runtime.queryParam('experiments') !== null;
this._experiments = [];
@@ -1136,12 +1128,12 @@
_checkExperiment(experimentName) {
Runtime._assert(this._experimentNames[experimentName], 'Unknown experiment ' + experimentName);
}
-};
+}
/**
* @unrestricted
*/
-Runtime.Experiment = class {
+class Experiment {
/**
* @param {!Runtime.ExperimentsSupport} experiments
* @param {string} name
@@ -1168,10 +1160,10 @@
setEnabled(enabled) {
this._experiments.setEnabled(this.name, enabled);
}
-};
+}
// This must be constructed after the query parameters have been parsed.
-Runtime.experiments = new Runtime.ExperimentsSupport();
+Runtime.experiments = new ExperimentsSupport();
/** @type {Function} */
Runtime._appStartedPromiseCallback;
@@ -1193,31 +1185,34 @@
}
})();
+self.Root = self.Root || {};
+Root = Root || {};
-/**
- * @interface
- */
-function ServicePort() {
-}
+// This gets all concatenated module descriptors in the release mode.
+Root.allDescriptors = [];
-ServicePort.prototype = {
- /**
- * @param {function(string)} messageHandler
- * @param {function(string)} closeHandler
- */
- setHandlers(messageHandler, closeHandler) {},
+Root.applicationDescriptor = undefined;
- /**
- * @param {string} message
- * @return {!Promise<boolean>}
- */
- send(message) {},
-
- /**
- * @return {!Promise<boolean>}
- */
- close() {}
-};
+/** @constructor */
+Root.Runtime = Runtime;
/** @type {!Runtime} */
-var runtime; // eslint-disable-line
+Root.runtime;
+
+/** @constructor */
+Root.Runtime.ModuleDescriptor = ModuleDescriptor;
+
+/** @constructor */
+Root.Runtime.ExtensionDescriptor = RuntimeExtensionDescriptor;
+
+/** @constructor */
+Root.Runtime.Extension = Extension;
+
+/** @constructor */
+Root.Runtime.Module = Module;
+
+/** @constructor */
+Root.Runtime.ExperimentsSupport = ExperimentsSupport;
+
+/** @constructor */
+Root.Runtime.Experiment = Experiment;
\ No newline at end of file
diff --git a/front_end/Tests.js b/front_end/Tests.js
index 9717a793..8704a71 100644
--- a/front_end/Tests.js
+++ b/front_end/Tests.js
@@ -1033,7 +1033,7 @@
}
function reset() {
- Runtime.experiments.clearForTest();
+ Root.Runtime.experiments.clearForTest();
InspectorFrontendHost.getPreferences(gotPreferences);
}
@@ -1230,7 +1230,7 @@
};
TestSuite.prototype.enableExperiment = function(name) {
- Runtime.experiments.enableForTest(name);
+ Root.Runtime.experiments.enableForTest(name);
};
TestSuite.prototype.checkInputEventsPresent = function() {
diff --git a/front_end/audits/AuditsPanel.js b/front_end/audits/AuditsPanel.js
index baf1029..75eeb92 100644
--- a/front_end/audits/AuditsPanel.js
+++ b/front_end/audits/AuditsPanel.js
@@ -147,7 +147,7 @@
const dom = new DOM(/** @type {!Document} */ (this._auditResultsElement.ownerDocument));
const renderer = new Audits.ReportRenderer(dom);
- const templatesHTML = Runtime.cachedResources['audits/lighthouse/templates.html'];
+ const templatesHTML = Root.Runtime.cachedResources['audits/lighthouse/templates.html'];
const templatesDOM = new DOMParser().parseFromString(templatesHTML, 'text/html');
if (!templatesDOM) {
return;
diff --git a/front_end/audits/AuditsReportRenderer.js b/front_end/audits/AuditsReportRenderer.js
index daa33ae..958c446 100644
--- a/front_end/audits/AuditsReportRenderer.js
+++ b/front_end/audits/AuditsReportRenderer.js
@@ -130,7 +130,7 @@
const clonedReport = document.querySelector('.lh-root').cloneNode(true /* deep */);
const printWindow = window.open('', '_blank', 'channelmode=1,status=1,resizable=1');
const style = printWindow.document.createElement('style');
- style.textContent = Runtime.cachedResources['audits/lighthouse/report.css'];
+ style.textContent = Root.Runtime.cachedResources['audits/lighthouse/report.css'];
printWindow.document.head.appendChild(style);
printWindow.document.body.replaceWith(clonedReport);
// Linkified nodes are shadow elements, which aren't exposed via `cloneNode`.
diff --git a/front_end/audits/lighthouse/report-generator.js b/front_end/audits/lighthouse/report-generator.js
index 829a1b1..9827150 100644
--- a/front_end/audits/lighthouse/report-generator.js
+++ b/front_end/audits/lighthouse/report-generator.js
@@ -8,14 +8,14 @@
/**
* @fileoverview Instead of loading report assets form the filesystem, in Devtools we must load
- * them via Runtime.cachedResources. We use this module to shim
+ * them via Root.Runtime.cachedResources. We use this module to shim
* lighthouse-core/report/html/html-report-assets.js in Devtools.
*/
/* global Runtime */
// @ts-ignore: Runtime exists in Devtools.
-const cachedResources = Runtime.cachedResources;
+const cachedResources = Root.Runtime.cachedResources;
// Getters are necessary because the DevTools bundling processes
// resources after this module is resolved. These properties are not
diff --git a/front_end/audits_worker.js b/front_end/audits_worker.js
index 77fad7f..56b8146 100644
--- a/front_end/audits_worker.js
+++ b/front_end/audits_worker.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Release build has Runtime.js bundled.
-if (!self.Runtime) {
+if (!self.Root || !self.Root.Runtime) {
self.importScripts('Runtime.js');
}
-Runtime.startWorker('audits_worker');
+Root.Runtime.startWorker('audits_worker');
diff --git a/front_end/audits_worker/AuditsService.js b/front_end/audits_worker/AuditsService.js
index 8068907..a66191c 100644
--- a/front_end/audits_worker/AuditsService.js
+++ b/front_end/audits_worker/AuditsService.js
@@ -42,7 +42,7 @@
* @return {!Promise<!ReportRenderer.RunnerResult>}
*/
start(params) {
- if (Runtime.queryParam('isUnderTest')) {
+ if (Root.Runtime.queryParam('isUnderTest')) {
this._disableLoggingForTest();
params.flags.maxWaitForLoad = 2 * 1000;
}
diff --git a/front_end/cm_modes/DefaultCodeMirrorMimeMode.js b/front_end/cm_modes/DefaultCodeMirrorMimeMode.js
index 31497d4..c76bf67 100644
--- a/front_end/cm_modes/DefaultCodeMirrorMimeMode.js
+++ b/front_end/cm_modes/DefaultCodeMirrorMimeMode.js
@@ -6,19 +6,16 @@
* @constructor
* @implements {TextEditor.CodeMirrorMimeMode}
*/
-CmModes.DefaultCodeMirrorMimeMode = function()
-{
-}
+CmModes.DefaultCodeMirrorMimeMode = function() {};
CmModes.DefaultCodeMirrorMimeMode.prototype = {
- /**
- * @param {!Runtime.Extension} extension
+ /**
+ * @param {!Root.Runtime.Extension} extension
* @override
*/
- install: function(extension)
- {
- var modeFileName = extension.descriptor()["fileName"];
- var modeContent = extension.module().resource(modeFileName);
- self.eval(modeContent + "\n//# sourceURL=" + modeFileName);
- }
+ install: function(extension) {
+ var modeFileName = extension.descriptor()['fileName'];
+ var modeContent = extension.module().resource(modeFileName);
+ self.eval(modeContent + '\n//# sourceURL=' + modeFileName);
+ }
}
diff --git a/front_end/common/ParsedURL.js b/front_end/common/ParsedURL.js
index 280a37f..16718fa 100644
--- a/front_end/common/ParsedURL.js
+++ b/front_end/common/ParsedURL.js
@@ -269,7 +269,7 @@
if (hrefPath.charAt(0) !== '/') {
hrefPath = parsedURL.folderPathComponents + '/' + hrefPath;
}
- return securityOrigin + Runtime.normalizePath(hrefPath) + hrefSuffix;
+ return securityOrigin + Root.Runtime.normalizePath(hrefPath) + hrefSuffix;
}
/**
diff --git a/front_end/common/Settings.js b/front_end/common/Settings.js
index d60d453..2c10023 100644
--- a/front_end/common/Settings.js
+++ b/front_end/common/Settings.js
@@ -50,7 +50,7 @@
}
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
*/
_registerModuleSetting(extension) {
const descriptor = extension.descriptor();
@@ -77,7 +77,7 @@
setting.setTitle(extension.title());
}
if (descriptor['userActionCondition']) {
- setting.setRequiresUserAction(!!Runtime.queryParam(descriptor['userActionCondition']));
+ setting.setRequiresUserAction(!!Root.Runtime.queryParam(descriptor['userActionCondition']));
}
setting._extension = extension;
this._moduleSettings.set(settingName, setting);
@@ -367,7 +367,7 @@
}
/**
- * @return {?Runtime.Extension}
+ * @return {?Root.Runtime.Extension}
*/
extension() {
return this._extension;
diff --git a/front_end/common/Worker.js b/front_end/common/Worker.js
index 62c243a..bdf73e8 100644
--- a/front_end/common/Worker.js
+++ b/front_end/common/Worker.js
@@ -37,7 +37,7 @@
*/
constructor(appName) {
let url = appName + '.js';
- url += Runtime.queryParamsString();
+ url += Root.Runtime.queryParamsString();
/** @type {!Promise<!Worker>} */
this._workerPromise = new Promise(fulfill => {
diff --git a/front_end/console_counters/WarningErrorCounter.js b/front_end/console_counters/WarningErrorCounter.js
index 172463d..b218fdc 100644
--- a/front_end/console_counters/WarningErrorCounter.js
+++ b/front_end/console_counters/WarningErrorCounter.js
@@ -24,14 +24,14 @@
});
const violationShadowRoot =
UI.createShadowRootWithCoreStyles(this._violationCounter, 'console_counters/errorWarningCounter.css');
- if (Runtime.experiments.isEnabled('spotlight')) {
+ if (Root.Runtime.experiments.isEnabled('spotlight')) {
countersWrapper.appendChild(this._violationCounter);
}
this._errors = this._createItem(shadowRoot, 'smallicon-error');
this._warnings = this._createItem(shadowRoot, 'smallicon-warning');
- if (Runtime.experiments.isEnabled('spotlight')) {
+ if (Root.Runtime.experiments.isEnabled('spotlight')) {
this._violations = this._createItem(violationShadowRoot, 'smallicon-info');
}
this._titles = [];
@@ -121,7 +121,7 @@
this._titles.push(warningCountTitle);
}
- if (Runtime.experiments.isEnabled('spotlight')) {
+ if (Root.Runtime.experiments.isEnabled('spotlight')) {
let violationCountTitle = '';
if (violations === 1) {
violationCountTitle = ls`${violations} violation`;
diff --git a/front_end/devtools_app.html b/front_end/devtools_app.html
index 2460c32..7387941 100644
--- a/front_end/devtools_app.html
+++ b/front_end/devtools_app.html
@@ -10,7 +10,6 @@
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://chrome-devtools-frontend.appspot.com">
<meta name="referrer" content="no-referrer">
<script type="module" src="root.js"></script>
- <script defer src="Runtime.js"></script>
<script defer src="devtools_app.js"></script>
</head>
<body class="undocked" id="-blink-dev-tools"></body>
diff --git a/front_end/devtools_app.js b/front_end/devtools_app.js
index 17310fa..75cbe26 100644
--- a/front_end/devtools_app.js
+++ b/front_end/devtools_app.js
@@ -1,4 +1,4 @@
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-Runtime.startApplication('devtools_app');
+Root.Runtime.startApplication('devtools_app');
diff --git a/front_end/elements/InspectElementModeController.js b/front_end/elements/InspectElementModeController.js
index a2e8462..900c89d 100644
--- a/front_end/elements/InspectElementModeController.js
+++ b/front_end/elements/InspectElementModeController.js
@@ -161,4 +161,4 @@
/** @type {?Elements.InspectElementModeController} */
Elements.inspectElementModeController =
- Runtime.queryParam('isSharedWorker') ? null : new Elements.InspectElementModeController();
+ Root.Runtime.queryParam('isSharedWorker') ? null : new Elements.InspectElementModeController();
diff --git a/front_end/elements/MarkerDecorator.js b/front_end/elements/MarkerDecorator.js
index 1b67e5d..a39c9c7 100644
--- a/front_end/elements/MarkerDecorator.js
+++ b/front_end/elements/MarkerDecorator.js
@@ -21,7 +21,7 @@
*/
Elements.GenericDecorator = class {
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
*/
constructor(extension) {
this._title = Common.UIString(extension.title());
diff --git a/front_end/emulation/DeviceModeWrapper.js b/front_end/emulation/DeviceModeWrapper.js
index 91f0680..8dd0897 100644
--- a/front_end/emulation/DeviceModeWrapper.js
+++ b/front_end/emulation/DeviceModeWrapper.js
@@ -17,7 +17,7 @@
this._toggleDeviceModeAction = UI.actionRegistry.action('emulation.toggle-device-mode');
const model = self.singleton(Emulation.DeviceModeModel);
this._showDeviceModeSetting = model.enabledSetting();
- this._showDeviceModeSetting.setRequiresUserAction(!!Runtime.queryParam('hasOtherClients'));
+ this._showDeviceModeSetting.setRequiresUserAction(!!Root.Runtime.queryParam('hasOtherClients'));
this._showDeviceModeSetting.addChangeListener(this._update.bind(this, false));
SDK.targetManager.addModelListener(
SDK.OverlayModel, SDK.OverlayModel.Events.ScreenshotRequested, this._screenshotRequestedFromOverlay, this);
diff --git a/front_end/emulation/EmulatedDevices.js b/front_end/emulation/EmulatedDevices.js
index 81d092e..1456dea 100644
--- a/front_end/emulation/EmulatedDevices.js
+++ b/front_end/emulation/EmulatedDevices.js
@@ -28,7 +28,7 @@
/** @type {boolean} */
this._showByDefault = true;
- /** @type {?Runtime.Extension} */
+ /** @type {?Root.Runtime.Extension} */
this._extension = null;
}
@@ -191,14 +191,14 @@
}
/**
- * @return {?Runtime.Extension}
+ * @return {?Root.Runtime.Extension}
*/
extension() {
return this._extension;
}
/**
- * @param {?Runtime.Extension} extension
+ * @param {?Root.Runtime.Extension} extension
*/
setExtension(extension) {
this._extension = extension;
diff --git a/front_end/extensions/ExtensionServer.js b/front_end/extensions/ExtensionServer.js
index a2d05e6..17fc8ce 100644
--- a/front_end/extensions/ExtensionServer.js
+++ b/front_end/extensions/ExtensionServer.js
@@ -236,7 +236,7 @@
* @suppressGlobalPropertiesCheck
*/
_onApplyStyleSheet(message) {
- if (!Runtime.experiments.isEnabled('applyCustomStylesheet')) {
+ if (!Root.Runtime.experiments.isEnabled('applyCustomStylesheet')) {
return;
}
const styleSheet = createElement('style');
diff --git a/front_end/externs.js b/front_end/externs.js
index eaaf2a7..00ac005 100644
--- a/front_end/externs.js
+++ b/front_end/externs.js
@@ -1475,4 +1475,29 @@
statusCode: number,
headers: (!Object.<string, string>|undefined)
}} */
-InspectorFrontendHostAPI.LoadNetworkResourceResult;
\ No newline at end of file
+InspectorFrontendHostAPI.LoadNetworkResourceResult;
+
+/**
+ * @interface
+ */
+class ServicePort {
+ /**
+ * @param {function(string)} messageHandler
+ * @param {function(string)} closeHandler
+ */
+ setHandlers(messageHandler, closeHandler) {
+ }
+
+ /**
+ * @param {string} message
+ * @return {!Promise<boolean>}
+ */
+ send(message) {
+ }
+
+ /**
+ * @return {!Promise<boolean>}
+ */
+ close() {
+ }
+}
\ No newline at end of file
diff --git a/front_end/formatter_worker.js b/front_end/formatter_worker.js
index 26dd25e..dd63d31 100644
--- a/front_end/formatter_worker.js
+++ b/front_end/formatter_worker.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Release build has Runtime.js bundled.
-if (!self.Runtime) {
+if (!self.Root || !self.Root.Runtime) {
self.importScripts('Runtime.js');
}
-Runtime.startWorker('formatter_worker');
+Root.Runtime.startWorker('formatter_worker');
diff --git a/front_end/formatter_worker/FormatterWorker.js b/front_end/formatter_worker/FormatterWorker.js
index c37f746..56649a6 100644
--- a/front_end/formatter_worker/FormatterWorker.js
+++ b/front_end/formatter_worker/FormatterWorker.js
@@ -597,7 +597,7 @@
extension.instance().then(instance => instance.parse(content)).catchException(null).then(postMessage);
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
* @return {boolean}
*/
function findExtension(extension) {
@@ -606,7 +606,7 @@
};
(function disableLoggingForTest() {
- if (Runtime.queryParam('test')) {
+ if (Root.Runtime.queryParam('test')) {
console.error = () => undefined;
}
})();
diff --git a/front_end/heap_snapshot_worker.js b/front_end/heap_snapshot_worker.js
index 1a3552b..6b63f51 100644
--- a/front_end/heap_snapshot_worker.js
+++ b/front_end/heap_snapshot_worker.js
@@ -3,7 +3,7 @@
// found in the LICENSE file.
// Release build has Runtime.js bundled.
-if (!self.Runtime) {
+if (!self.Root || !self.Root.Runtime) {
self.importScripts('Runtime.js');
}
@@ -65,4 +65,4 @@
self.serializeUIString = serializeUIString;
self.deserializeUIString = deserializeUIString;
-Runtime.startWorker('heap_snapshot_worker');
+Root.Runtime.startWorker('heap_snapshot_worker');
diff --git a/front_end/heap_snapshot_worker/HeapSnapshot.js b/front_end/heap_snapshot_worker/HeapSnapshot.js
index 3b59ae2..2c8a778 100644
--- a/front_end/heap_snapshot_worker/HeapSnapshot.js
+++ b/front_end/heap_snapshot_worker/HeapSnapshot.js
@@ -3281,7 +3281,7 @@
(function disableLoggingForTest() {
// Runtime doesn't exist because this file is loaded as a one-off
// file in some inspector-protocol tests.
- if (self.Runtime && Runtime.queryParam('test')) {
+ if (self.Root && self.Root.Runtime && Root.Runtime.queryParam('test')) {
console.warn = () => undefined;
}
})();
diff --git a/front_end/host/InspectorFrontendHost.js b/front_end/host/InspectorFrontendHost.js
index 0fff65c..33cbc85 100644
--- a/front_end/host/InspectorFrontendHost.js
+++ b/front_end/host/InspectorFrontendHost.js
@@ -285,7 +285,7 @@
* @param {function(!InspectorFrontendHostAPI.LoadNetworkResourceResult)} callback
*/
loadNetworkResource(url, headers, streamId, callback) {
- Runtime.loadResourcePromise(url)
+ Root.Runtime.loadResourcePromise(url)
.then(function(text) {
Host.ResourceLoader.streamWrite(streamId, text);
callback({statusCode: 200});
@@ -506,7 +506,7 @@
Host.InspectorFrontendAPIImpl = class {
constructor() {
this._debugFrontend =
- !!Runtime.queryParam('debugFrontend') || (window['InspectorTest'] && window['InspectorTest']['debugTest']);
+ !!Root.Runtime.queryParam('debugFrontend') || (window['InspectorTest'] && window['InspectorTest']['debugTest']);
const descriptors = Host.InspectorFrontendAPIImpl.EventDescriptors;
for (let i = 0; i < descriptors.length; ++i) {
@@ -640,7 +640,7 @@
*/
Host.isUnderTest = function(prefs) {
// Integration tests rely on test queryParam.
- if (Runtime.queryParam('test')) {
+ if (Root.Runtime.queryParam('test')) {
return true;
}
// Browser tests rely on prefs.
diff --git a/front_end/inspector.html b/front_end/inspector.html
index 1ab4d31..e26cd22 100644
--- a/front_end/inspector.html
+++ b/front_end/inspector.html
@@ -10,7 +10,6 @@
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://chrome-devtools-frontend.appspot.com">
<meta name="referrer" content="no-referrer">
<script type="module" src="root.js"></script>
- <script defer src="Runtime.js"></script>
<script defer src="inspector.js"></script>
</head>
<body class="undocked" id="-blink-dev-tools"></body>
diff --git a/front_end/inspector.js b/front_end/inspector.js
index c690b32..bfb7f06 100644
--- a/front_end/inspector.js
+++ b/front_end/inspector.js
@@ -1,4 +1,4 @@
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-Runtime.startApplication('inspector');
+Root.Runtime.startApplication('inspector');
diff --git a/front_end/inspector_main/InspectorMain.js b/front_end/inspector_main/InspectorMain.js
index 19146a8..f948cac 100644
--- a/front_end/inspector_main/InspectorMain.js
+++ b/front_end/inspector_main/InspectorMain.js
@@ -12,8 +12,8 @@
async run() {
let firstCall = true;
await SDK.initMainConnection(async () => {
- const type = Runtime.queryParam('v8only') ? SDK.Target.Type.Node : SDK.Target.Type.Frame;
- const waitForDebuggerInPage = type === SDK.Target.Type.Frame && Runtime.queryParam('panel') === 'sources';
+ const type = Root.Runtime.queryParam('v8only') ? SDK.Target.Type.Node : SDK.Target.Type.Frame;
+ const waitForDebuggerInPage = type === SDK.Target.Type.Frame && Root.Runtime.queryParam('panel') === 'sources';
const target =
SDK.targetManager.createTarget('main', Common.UIString('Main'), type, null, undefined, waitForDebuggerInPage);
diff --git a/front_end/integration_test_runner.html b/front_end/integration_test_runner.html
index 073b301..ebf13c4 100644
--- a/front_end/integration_test_runner.html
+++ b/front_end/integration_test_runner.html
@@ -9,7 +9,6 @@
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://chrome-devtools-frontend.appspot.com">
<script type="module" src="root.js"></script>
- <script defer src="Runtime.js"></script>
<script defer src="integration_test_runner.js"></script>
</head>
<body id="-blink-dev-tools"></body>
diff --git a/front_end/integration_test_runner.js b/front_end/integration_test_runner.js
index 3eddfa0..f6f6a7a 100644
--- a/front_end/integration_test_runner.js
+++ b/front_end/integration_test_runner.js
@@ -7,4 +7,4 @@
testRunner.waitUntilDone();
}
-Runtime.startApplication('integration_test_runner');
+Root.Runtime.startApplication('integration_test_runner');
diff --git a/front_end/js_app.html b/front_end/js_app.html
index 8cc144c..8d7b199 100644
--- a/front_end/js_app.html
+++ b/front_end/js_app.html
@@ -10,7 +10,6 @@
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://chrome-devtools-frontend.appspot.com">
<meta name="referrer" content="no-referrer">
<script type="module" src="root.js"></script>
- <script defer src="Runtime.js"></script>
<script defer src="js_app.js"></script>
</head>
<body class="undocked" id="-blink-dev-tools"></body>
diff --git a/front_end/js_app.js b/front_end/js_app.js
index 11427a0..076e3f7 100644
--- a/front_end/js_app.js
+++ b/front_end/js_app.js
@@ -1,4 +1,4 @@
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-Runtime.startApplication('js_app');
+Root.Runtime.startApplication('js_app');
diff --git a/front_end/main/Main.js b/front_end/main/Main.js
index d0e24d3..04d62f0 100644
--- a/front_end/main/Main.js
+++ b/front_end/main/Main.js
@@ -62,9 +62,9 @@
async _loaded() {
console.timeStamp('Main._loaded');
- await Runtime.appStarted();
- Runtime.setPlatform(Host.platform());
- Runtime.setL10nCallback(ls);
+ await Root.Runtime.appStarted();
+ Root.Runtime.setPlatform(Host.platform());
+ Root.Runtime.setL10nCallback(ls);
InspectorFrontendHost.getPreferences(this._gotPreferences.bind(this));
}
@@ -89,7 +89,8 @@
let storagePrefix = '';
if (Host.isCustomDevtoolsFrontend()) {
storagePrefix = '__custom__';
- } else if (!Runtime.queryParam('can_dock') && !!Runtime.queryParam('debugFrontend') && !Host.isUnderTest()) {
+ } else if (
+ !Root.Runtime.queryParam('can_dock') && !!Root.Runtime.queryParam('debugFrontend') && !Host.isUnderTest()) {
storagePrefix = '__bundled__';
}
@@ -111,51 +112,56 @@
_initializeExperiments() {
// Keep this sorted alphabetically: both keys and values.
- Runtime.experiments.register('applyCustomStylesheet', 'Allow custom UI themes');
- Runtime.experiments.register('captureNodeCreationStacks', 'Capture node creation stacks');
- Runtime.experiments.register('sourcesPrettyPrint', 'Automatically pretty print in the Sources Panel');
- Runtime.experiments.register('backgroundServices', 'Background web platform feature events', true);
- Runtime.experiments.register('backgroundServicesNotifications', 'Background services section for Notifications');
- Runtime.experiments.register('backgroundServicesPaymentHandler', 'Background services section for Payment Handler');
- Runtime.experiments.register('backgroundServicesPushMessaging', 'Background services section for Push Messaging');
- Runtime.experiments.register(
+ Root.Runtime.experiments.register('applyCustomStylesheet', 'Allow custom UI themes');
+ Root.Runtime.experiments.register('captureNodeCreationStacks', 'Capture node creation stacks');
+ Root.Runtime.experiments.register('sourcesPrettyPrint', 'Automatically pretty print in the Sources Panel');
+ Root.Runtime.experiments.register('backgroundServices', 'Background web platform feature events', true);
+ Root.Runtime.experiments.register(
+ 'backgroundServicesNotifications', 'Background services section for Notifications');
+ Root.Runtime.experiments.register(
+ 'backgroundServicesPaymentHandler', 'Background services section for Payment Handler');
+ Root.Runtime.experiments.register(
+ 'backgroundServicesPushMessaging', 'Background services section for Push Messaging');
+ Root.Runtime.experiments.register(
'backgroundServicesPeriodicBackgroundSync', 'Background services section for Periodic Background Sync');
- Runtime.experiments.register('blackboxJSFramesOnTimeline', 'Blackbox JavaScript frames on Timeline', true);
- Runtime.experiments.register('cssOverview', 'CSS Overview');
- Runtime.experiments.register('emptySourceMapAutoStepping', 'Empty sourcemap auto-stepping');
- Runtime.experiments.register('inputEventsOnTimelineOverview', 'Input events on Timeline overview', true);
- Runtime.experiments.register('liveHeapProfile', 'Live heap profile', true);
- Runtime.experiments.register('nativeHeapProfiler', 'Native memory sampling heap profiler', true);
- Runtime.experiments.register('protocolMonitor', 'Protocol Monitor');
- Runtime.experiments.register('recordCoverageWithPerformanceTracing', 'Record coverage while performance tracing');
- Runtime.experiments.register('samplingHeapProfilerTimeline', 'Sampling heap profiler timeline', true);
- Runtime.experiments.register('sourceDiff', 'Source diff');
- Runtime.experiments.register('splitInDrawer', 'Split in drawer', true);
- Runtime.experiments.register('spotlight', 'Spotlight', true);
- Runtime.experiments.register('terminalInDrawer', 'Terminal in drawer', true);
+ Root.Runtime.experiments.register('blackboxJSFramesOnTimeline', 'Blackbox JavaScript frames on Timeline', true);
+ Root.Runtime.experiments.register('cssOverview', 'CSS Overview');
+ Root.Runtime.experiments.register('emptySourceMapAutoStepping', 'Empty sourcemap auto-stepping');
+ Root.Runtime.experiments.register('inputEventsOnTimelineOverview', 'Input events on Timeline overview', true);
+ Root.Runtime.experiments.register('liveHeapProfile', 'Live heap profile', true);
+ Root.Runtime.experiments.register('nativeHeapProfiler', 'Native memory sampling heap profiler', true);
+ Root.Runtime.experiments.register('protocolMonitor', 'Protocol Monitor');
+ Root.Runtime.experiments.register(
+ 'recordCoverageWithPerformanceTracing', 'Record coverage while performance tracing');
+ Root.Runtime.experiments.register('samplingHeapProfilerTimeline', 'Sampling heap profiler timeline', true);
+ Root.Runtime.experiments.register('sourceDiff', 'Source diff');
+ Root.Runtime.experiments.register('splitInDrawer', 'Split in drawer', true);
+ Root.Runtime.experiments.register('spotlight', 'Spotlight', true);
+ Root.Runtime.experiments.register('terminalInDrawer', 'Terminal in drawer', true);
// Timeline
- Runtime.experiments.register('timelineEventInitiators', 'Timeline: event initiators');
- Runtime.experiments.register('timelineFlowEvents', 'Timeline: flow events', true);
- Runtime.experiments.register('timelineInvalidationTracking', 'Timeline: invalidation tracking', true);
- Runtime.experiments.register('timelineShowAllEvents', 'Timeline: show all events', true);
- Runtime.experiments.register('timelineV8RuntimeCallStats', 'Timeline: V8 Runtime Call Stats on Timeline', true);
- Runtime.experiments.register('timelineWebGL', 'Timeline: WebGL-based flamechart');
+ Root.Runtime.experiments.register('timelineEventInitiators', 'Timeline: event initiators');
+ Root.Runtime.experiments.register('timelineFlowEvents', 'Timeline: flow events', true);
+ Root.Runtime.experiments.register('timelineInvalidationTracking', 'Timeline: invalidation tracking', true);
+ Root.Runtime.experiments.register('timelineShowAllEvents', 'Timeline: show all events', true);
+ Root.Runtime.experiments.register(
+ 'timelineV8RuntimeCallStats', 'Timeline: V8 Runtime Call Stats on Timeline', true);
+ Root.Runtime.experiments.register('timelineWebGL', 'Timeline: WebGL-based flamechart');
- Runtime.experiments.cleanUpStaleExperiments();
- const enabledExperiments = Runtime.queryParam('enabledExperiments');
+ Root.Runtime.experiments.cleanUpStaleExperiments();
+ const enabledExperiments = Root.Runtime.queryParam('enabledExperiments');
if (enabledExperiments) {
- Runtime.experiments.setServerEnabledExperiments(enabledExperiments.split(';'));
+ Root.Runtime.experiments.setServerEnabledExperiments(enabledExperiments.split(';'));
}
- Runtime.experiments.setDefaultExperiments([
+ Root.Runtime.experiments.setDefaultExperiments([
'backgroundServices',
'backgroundServicesNotifications',
'backgroundServicesPushMessaging',
'backgroundServicesPaymentHandler',
]);
- if (Host.isUnderTest() && Runtime.queryParam('test').includes('live-line-level-heap-profile.js')) {
- Runtime.experiments.enableForTest('liveHeapProfile');
+ if (Host.isUnderTest() && Root.Runtime.queryParam('test').includes('live-line-level-heap-profile.js')) {
+ Root.Runtime.experiments.enableForTest('liveHeapProfile');
}
}
@@ -178,7 +184,7 @@
this._addMainEventListeners(document);
- const canDock = !!Runtime.queryParam('can_dock');
+ const canDock = !!Root.Runtime.queryParam('can_dock');
UI.zoomManager = new UI.ZoomManager(window, InspectorFrontendHost);
UI.inspectorView = UI.InspectorView.instance();
UI.ContextMenu.initialize();
@@ -255,7 +261,7 @@
const extensions = self.runtime.extensions(Common.QueryParamHandler);
for (const extension of extensions) {
- const value = Runtime.queryParam(extension.descriptor()['name']);
+ const value = Root.Runtime.queryParam(extension.descriptor()['name']);
if (value !== null) {
extension.instance().then(handleQueryParam.bind(null, value));
}
diff --git a/front_end/ndb_app.html b/front_end/ndb_app.html
index d6f1748..9c25b86 100644
--- a/front_end/ndb_app.html
+++ b/front_end/ndb_app.html
@@ -10,7 +10,6 @@
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://chrome-devtools-frontend.appspot.com">
<meta name="referrer" content="no-referrer">
<script type="module" src="root.js"></script>
- <script defer src="Runtime.js"></script>
<script defer src="ndb_app.js"></script>
</head>
<body class="undocked" id="-blink-dev-tools"></body>
diff --git a/front_end/ndb_app.js b/front_end/ndb_app.js
index c3eb0e5..379d9b2 100644
--- a/front_end/ndb_app.js
+++ b/front_end/ndb_app.js
@@ -1,4 +1,4 @@
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-Runtime.startApplication('ndb_app');
+Root.Runtime.startApplication('ndb_app');
diff --git a/front_end/node_app.html b/front_end/node_app.html
index 5b475a1..f24991c 100644
--- a/front_end/node_app.html
+++ b/front_end/node_app.html
@@ -10,7 +10,6 @@
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://chrome-devtools-frontend.appspot.com">
<meta name="referrer" content="no-referrer">
<script type="module" src="root.js"></script>
- <script defer src="Runtime.js"></script>
<script defer src="node_app.js"></script>
</head>
<body class="undocked" id="-blink-dev-tools"></body>
diff --git a/front_end/node_app.js b/front_end/node_app.js
index 6517c7d..1125741 100644
--- a/front_end/node_app.js
+++ b/front_end/node_app.js
@@ -2,4 +2,4 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-Runtime.startApplication('node_app');
+Root.Runtime.startApplication('node_app');
diff --git a/front_end/perf_ui/FlameChart.js b/front_end/perf_ui/FlameChart.js
index 3e3f673..4358145 100644
--- a/front_end/perf_ui/FlameChart.js
+++ b/front_end/perf_ui/FlameChart.js
@@ -73,7 +73,7 @@
this._groupExpansionState = groupExpansionSetting && groupExpansionSetting.get() || {};
this._flameChartDelegate = flameChartDelegate;
- this._useWebGL = Runtime.experiments.isEnabled('timelineWebGL');
+ this._useWebGL = Root.Runtime.experiments.isEnabled('timelineWebGL');
this._chartViewport = new PerfUI.ChartViewport(this);
this._chartViewport.show(this.contentElement);
diff --git a/front_end/profiler/HeapProfileView.js b/front_end/profiler/HeapProfileView.js
index 61e0a08..b3d87f7 100644
--- a/front_end/profiler/HeapProfileView.js
+++ b/front_end/profiler/HeapProfileView.js
@@ -32,7 +32,7 @@
this._selectedSizeText = new UI.ToolbarText();
- if (Runtime.experiments.isEnabled('samplingHeapProfilerTimeline')) {
+ if (Root.Runtime.experiments.isEnabled('samplingHeapProfilerTimeline')) {
this._timelineOverview = new Profiler.HeapTimelineOverview();
this._timelineOverview.addEventListener(
Profiler.HeapTimelineOverview.IdsRangeChanged, this._onIdsRangeChanged.bind(this));
@@ -372,7 +372,7 @@
* @return {boolean}
*/
hasTemporaryView() {
- return Runtime.experiments.isEnabled('samplingHeapProfilerTimeline');
+ return Root.Runtime.experiments.isEnabled('samplingHeapProfilerTimeline');
}
/**
@@ -380,7 +380,7 @@
*/
_startSampling() {
this.profileBeingRecorded().heapProfilerModel().startSampling();
- if (Runtime.experiments.isEnabled('samplingHeapProfilerTimeline')) {
+ if (Root.Runtime.experiments.isEnabled('samplingHeapProfilerTimeline')) {
this._updateTimer = setTimeout(this._updateStats.bind(this), this._updateIntervalMs);
}
}
diff --git a/front_end/profiler/HeapProfilerPanel.js b/front_end/profiler/HeapProfilerPanel.js
index 284f885..a9bfc1d 100644
--- a/front_end/profiler/HeapProfilerPanel.js
+++ b/front_end/profiler/HeapProfilerPanel.js
@@ -11,7 +11,7 @@
const registry = Profiler.ProfileTypeRegistry.instance;
const profileTypes =
[registry.heapSnapshotProfileType, registry.trackingHeapSnapshotProfileType, registry.samplingHeapProfileType];
- if (Runtime.experiments.isEnabled('nativeHeapProfiler')) {
+ if (Root.Runtime.experiments.isEnabled('nativeHeapProfiler')) {
profileTypes.push(registry.samplingNativeHeapProfileType);
profileTypes.push(registry.samplingNativeHeapSnapshotRendererType);
profileTypes.push(registry.samplingNativeHeapSnapshotBrowserType);
diff --git a/front_end/quick_open/CommandMenu.js b/front_end/quick_open/CommandMenu.js
index 90edd46..b16bdc5 100644
--- a/front_end/quick_open/CommandMenu.js
+++ b/front_end/quick_open/CommandMenu.js
@@ -31,7 +31,7 @@
}
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
* @param {string} title
* @param {V} value
* @return {!QuickOpen.CommandMenu.Command}
@@ -63,7 +63,7 @@
}
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
* @param {string} category
* @return {!QuickOpen.CommandMenu.Command}
*/
diff --git a/front_end/quick_open/HelpQuickOpen.js b/front_end/quick_open/HelpQuickOpen.js
index 89b2d9a..9834c69 100644
--- a/front_end/quick_open/HelpQuickOpen.js
+++ b/front_end/quick_open/HelpQuickOpen.js
@@ -10,7 +10,7 @@
}
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
*/
_addProvider(extension) {
if (extension.title()) {
diff --git a/front_end/quick_open/QuickOpen.js b/front_end/quick_open/QuickOpen.js
index 742014d..3f3fe24 100644
--- a/front_end/quick_open/QuickOpen.js
+++ b/front_end/quick_open/QuickOpen.js
@@ -30,7 +30,7 @@
}
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
*/
_addProvider(extension) {
const prefix = extension.descriptor()['prefix'];
diff --git a/front_end/resources/ApplicationPanelSidebar.js b/front_end/resources/ApplicationPanelSidebar.js
index 4698362..b52aed8 100644
--- a/front_end/resources/ApplicationPanelSidebar.js
+++ b/front_end/resources/ApplicationPanelSidebar.js
@@ -104,7 +104,7 @@
cacheTreeElement.appendChild(this.applicationCacheListTreeElement);
- if (Runtime.experiments.isEnabled('backgroundServices')) {
+ if (Root.Runtime.experiments.isEnabled('backgroundServices')) {
const backgroundServiceTreeElement = this._addSidebarSection(ls`Background Services`);
this.backgroundFetchTreeElement =
@@ -114,22 +114,22 @@
new Resources.BackgroundServiceTreeElement(panel, Protocol.BackgroundService.ServiceName.BackgroundSync);
backgroundServiceTreeElement.appendChild(this.backgroundSyncTreeElement);
- if (Runtime.experiments.isEnabled('backgroundServicesNotifications')) {
+ if (Root.Runtime.experiments.isEnabled('backgroundServicesNotifications')) {
this.notificationsTreeElement =
new Resources.BackgroundServiceTreeElement(panel, Protocol.BackgroundService.ServiceName.Notifications);
backgroundServiceTreeElement.appendChild(this.notificationsTreeElement);
}
- if (Runtime.experiments.isEnabled('backgroundServicesPaymentHandler')) {
+ if (Root.Runtime.experiments.isEnabled('backgroundServicesPaymentHandler')) {
this.paymentHandlerTreeElement =
new Resources.BackgroundServiceTreeElement(panel, Protocol.BackgroundService.ServiceName.PaymentHandler);
backgroundServiceTreeElement.appendChild(this.paymentHandlerTreeElement);
}
- if (Runtime.experiments.isEnabled('backgroundServicesPeriodicBackgroundSync')) {
+ if (Root.Runtime.experiments.isEnabled('backgroundServicesPeriodicBackgroundSync')) {
this.periodicBackgroundSyncTreeElement = new Resources.BackgroundServiceTreeElement(
panel, Protocol.BackgroundService.ServiceName.PeriodicBackgroundSync);
backgroundServiceTreeElement.appendChild(this.periodicBackgroundSyncTreeElement);
}
- if (Runtime.experiments.isEnabled('backgroundServicesPushMessaging')) {
+ if (Root.Runtime.experiments.isEnabled('backgroundServicesPushMessaging')) {
this.pushMessagingTreeElement =
new Resources.BackgroundServiceTreeElement(panel, Protocol.BackgroundService.ServiceName.PushMessaging);
backgroundServiceTreeElement.appendChild(this.pushMessagingTreeElement);
@@ -265,19 +265,19 @@
const serviceWorkerCacheModel = this._target.model(SDK.ServiceWorkerCacheModel);
this.cacheStorageListTreeElement._initialize(serviceWorkerCacheModel);
const backgroundServiceModel = this._target.model(Resources.BackgroundServiceModel);
- if (Runtime.experiments.isEnabled('backgroundServices')) {
+ if (Root.Runtime.experiments.isEnabled('backgroundServices')) {
this.backgroundFetchTreeElement._initialize(backgroundServiceModel);
this.backgroundSyncTreeElement._initialize(backgroundServiceModel);
- if (Runtime.experiments.isEnabled('backgroundServicesNotifications')) {
+ if (Root.Runtime.experiments.isEnabled('backgroundServicesNotifications')) {
this.notificationsTreeElement._initialize(backgroundServiceModel);
}
- if (Runtime.experiments.isEnabled('backgroundServicesPaymentHandler')) {
+ if (Root.Runtime.experiments.isEnabled('backgroundServicesPaymentHandler')) {
this.paymentHandlerTreeElement._initialize(backgroundServiceModel);
}
- if (Runtime.experiments.isEnabled('backgroundServicesPeriodicBackgroundSync')) {
+ if (Root.Runtime.experiments.isEnabled('backgroundServicesPeriodicBackgroundSync')) {
this.periodicBackgroundSyncTreeElement._initialize(backgroundServiceModel);
}
- if (Runtime.experiments.isEnabled('backgroundServicesPushMessaging')) {
+ if (Root.Runtime.experiments.isEnabled('backgroundServicesPushMessaging')) {
this.pushMessagingTreeElement._initialize(backgroundServiceModel);
}
}
diff --git a/front_end/resources/ServiceWorkersView.js b/front_end/resources/ServiceWorkersView.js
index db9e13a..01b793a 100644
--- a/front_end/resources/ServiceWorkersView.js
+++ b/front_end/resources/ServiceWorkersView.js
@@ -353,7 +353,7 @@
this._push.bind(this));
this._createSyncNotificationField(
Common.UIString('Sync'), this._syncTagNameSetting.get(), Common.UIString('Sync tag'), this._sync.bind(this));
- if (Runtime.experiments.isEnabled('backgroundServicesPeriodicBackgroundSync')) {
+ if (Root.Runtime.experiments.isEnabled('backgroundServicesPeriodicBackgroundSync')) {
this._createSyncNotificationField(
ls`Periodic Sync`, this._periodicSyncTagNameSetting.get(), ls`Periodic Sync tag`,
tag => this._periodicSync(tag));
diff --git a/front_end/root.js b/front_end/root.js
index 022ced9..df20787 100644
--- a/front_end/root.js
+++ b/front_end/root.js
@@ -2,5 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+import './Runtime.js';
import './common/common.js';
import './ui/ui.js';
diff --git a/front_end/sdk/Connections.js b/front_end/sdk/Connections.js
index bc44429..3580a03 100644
--- a/front_end/sdk/Connections.js
+++ b/front_end/sdk/Connections.js
@@ -329,8 +329,8 @@
* @return {!Protocol.Connection}
*/
SDK._createMainConnection = function(websocketConnectionLost) {
- const wsParam = Runtime.queryParam('ws');
- const wssParam = Runtime.queryParam('wss');
+ const wsParam = Root.Runtime.queryParam('ws');
+ const wssParam = Root.Runtime.queryParam('wss');
if (wsParam || wssParam) {
const ws = wsParam ? `ws://${wsParam}` : `wss://${wssParam}`;
return new SDK.WebSocketConnection(ws, websocketConnectionLost);
diff --git a/front_end/sdk/DOMModel.js b/front_end/sdk/DOMModel.js
index 9c80dbf..015701a 100644
--- a/front_end/sdk/DOMModel.js
+++ b/front_end/sdk/DOMModel.js
@@ -1188,7 +1188,7 @@
this._agent.enable();
}
- if (Runtime.experiments.isEnabled('captureNodeCreationStacks')) {
+ if (Root.Runtime.experiments.isEnabled('captureNodeCreationStacks')) {
this._agent.setNodeStackTracesEnabled(true);
}
}
diff --git a/front_end/sdk/DebuggerModel.js b/front_end/sdk/DebuggerModel.js
index c577767..ead515c 100644
--- a/front_end/sdk/DebuggerModel.js
+++ b/front_end/sdk/DebuggerModel.js
@@ -121,7 +121,7 @@
// Set a limit for the total size of collected script sources retained by debugger.
// 10MB for remote frontends, 100MB for others.
- const isRemoteFrontend = Runtime.queryParam('remoteFrontend') || Runtime.queryParam('ws');
+ const isRemoteFrontend = Root.Runtime.queryParam('remoteFrontend') || Root.Runtime.queryParam('ws');
const maxScriptsCacheSize = isRemoteFrontend ? 10e6 : 100e6;
const enablePromise = this._agent.enable(maxScriptsCacheSize);
enablePromise.then(this._registerDebugger.bind(this));
@@ -515,7 +515,7 @@
this._isPausing = false;
this._debuggerPausedDetails = debuggerPausedDetails;
if (this._debuggerPausedDetails) {
- if (Runtime.experiments.isEnabled('emptySourceMapAutoStepping') && this._beforePausedCallback) {
+ if (Root.Runtime.experiments.isEnabled('emptySourceMapAutoStepping') && this._beforePausedCallback) {
if (!this._beforePausedCallback.call(null, this._debuggerPausedDetails)) {
return false;
}
diff --git a/front_end/services/ServiceManager.js b/front_end/services/ServiceManager.js
index 9c0ee7f..36fb53c 100644
--- a/front_end/services/ServiceManager.js
+++ b/front_end/services/ServiceManager.js
@@ -11,7 +11,7 @@
*/
createRemoteService(serviceName) {
if (!this._remoteConnection) {
- const url = Runtime.queryParam('service-backend');
+ const url = Root.Runtime.queryParam('service-backend');
if (!url) {
console.error('No endpoint address specified');
return /** @type {!Promise<?Services.ServiceManager.Service>} */ (Promise.resolve(null));
@@ -29,8 +29,8 @@
*/
createAppService(appName, serviceName) {
let url = appName + '.js';
- const remoteBase = Runtime.queryParam('remoteBase');
- const debugFrontend = Runtime.queryParam('debugFrontend');
+ const remoteBase = Root.Runtime.queryParam('remoteBase');
+ const debugFrontend = Root.Runtime.queryParam('debugFrontend');
const isUnderTest = Host.isUnderTest();
const queryParams = [];
diff --git a/front_end/settings/SettingsScreen.js b/front_end/settings/SettingsScreen.js
index 5d0405f..13c505f 100644
--- a/front_end/settings/SettingsScreen.js
+++ b/front_end/settings/SettingsScreen.js
@@ -172,7 +172,7 @@
}
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
* @return {boolean}
*/
static isSettingVisible(extension) {
@@ -187,7 +187,7 @@
}
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
*/
_addSetting(extension) {
if (!Settings.GenericSettingsTab.isSettingVisible(extension)) {
@@ -202,7 +202,7 @@
}
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
*/
_addSettingUI(extension) {
const descriptor = extension.descriptor();
@@ -244,7 +244,7 @@
constructor() {
super(Common.UIString('Experiments'), 'experiments-tab-content');
- const experiments = Runtime.experiments.allConfigurableExperiments();
+ const experiments = Root.Runtime.experiments.allConfigurableExperiments();
if (experiments.length) {
const experimentsSection = this._appendSection();
experimentsSection.appendChild(this._createExperimentsWarningSubsection());
@@ -332,7 +332,7 @@
return success ? Promise.resolve() : Promise.reject();
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
*/
function revealModuleSetting(extension) {
if (!Settings.GenericSettingsTab.isSettingVisible(extension)) {
@@ -346,7 +346,7 @@
}
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
*/
function revealSettingUI(extension) {
const settings = extension.descriptor()['settings'];
@@ -358,7 +358,7 @@
}
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
*/
function revealSettingsView(extension) {
const location = extension.descriptor()['location'];
diff --git a/front_end/sources/DebuggerPlugin.js b/front_end/sources/DebuggerPlugin.js
index b03d58a..763d1d6 100644
--- a/front_end/sources/DebuggerPlugin.js
+++ b/front_end/sources/DebuggerPlugin.js
@@ -138,7 +138,7 @@
this._hasLineWithoutMapping = false;
this._updateLinesWithoutMappingHighlight();
- if (!Runtime.experiments.isEnabled('sourcesPrettyPrint')) {
+ if (!Root.Runtime.experiments.isEnabled('sourcesPrettyPrint')) {
/** @type {?UI.Infobar} */
this._prettyPrintInfobar = null;
this._detectMinified();
diff --git a/front_end/sources/SourcesView.js b/front_end/sources/SourcesView.js
index 226a54e..4bab3e0 100644
--- a/front_end/sources/SourcesView.js
+++ b/front_end/sources/SourcesView.js
@@ -36,7 +36,7 @@
this._historyManager = new Sources.EditingLocationHistoryManager(this, this.currentSourceFrame.bind(this));
this._toolbarContainerElement = this.element.createChild('div', 'sources-toolbar');
- if (!Runtime.experiments.isEnabled('sourcesPrettyPrint')) {
+ if (!Root.Runtime.experiments.isEnabled('sourcesPrettyPrint')) {
this._toolbarEditorActions = new UI.Toolbar('', this._toolbarContainerElement);
self.runtime.allInstances(Sources.SourcesView.EditorAction).then(appendButtonsForExtensions.bind(this));
}
diff --git a/front_end/sources/UISourceCodeFrame.js b/front_end/sources/UISourceCodeFrame.js
index 137d817..4bc5fd0 100644
--- a/front_end/sources/UISourceCodeFrame.js
+++ b/front_end/sources/UISourceCodeFrame.js
@@ -34,7 +34,7 @@
super(workingCopy);
this._uiSourceCode = uiSourceCode;
- if (Runtime.experiments.isEnabled('sourceDiff')) {
+ if (Root.Runtime.experiments.isEnabled('sourceDiff')) {
this._diff = new SourceFrame.SourceCodeDiff(this.textEditor);
}
@@ -172,7 +172,7 @@
this._updateStyle();
this._decorateAllTypes();
this._refreshHighlighterType();
- if (Runtime.experiments.isEnabled('sourcesPrettyPrint')) {
+ if (Root.Runtime.experiments.isEnabled('sourcesPrettyPrint')) {
const supportedPrettyTypes = new Set(['text/html', 'text/css', 'text/javascript']);
this.setCanPrettyPrint(supportedPrettyTypes.has(this.highlighterType()), true);
}
@@ -352,7 +352,7 @@
if (Sources.ScriptOriginPlugin.accepts(pluginUISourceCode)) {
this._plugins.push(new Sources.ScriptOriginPlugin(this.textEditor, pluginUISourceCode));
}
- if (!this.pretty && Runtime.experiments.isEnabled('sourceDiff') &&
+ if (!this.pretty && Root.Runtime.experiments.isEnabled('sourceDiff') &&
Sources.GutterDiffPlugin.accepts(pluginUISourceCode)) {
this._plugins.push(new Sources.GutterDiffPlugin(this.textEditor, pluginUISourceCode));
}
diff --git a/front_end/test_runner/TestRunner.js b/front_end/test_runner/TestRunner.js
index eec2722..040c362 100644
--- a/front_end/test_runner/TestRunner.js
+++ b/front_end/test_runner/TestRunner.js
@@ -30,7 +30,7 @@
};
TestRunner._executeTestScript = function() {
- const testScriptURL = /** @type {string} */ (Runtime.queryParam('test'));
+ const testScriptURL = /** @type {string} */ (Root.Runtime.queryParam('test'));
fetch(testScriptURL)
.then(data => data.text())
.then(testScript => {
@@ -428,7 +428,7 @@
const lines = new Error().stack.split('at ');
// Handles cases where the function is safe wrapped
- const testScriptURL = /** @type {string} */ (Runtime.queryParam('test'));
+ const testScriptURL = /** @type {string} */ (Root.Runtime.queryParam('test'));
const functionLine = lines.reduce((acc, line) => line.includes(testScriptURL) ? line : acc, lines[lines.length - 2]);
const components = functionLine.trim().split('/');
@@ -1296,7 +1296,7 @@
};
/**
- * @return {!Array<!Runtime.Module>}
+ * @return {!Array<!Root.Runtime.Module>}
*/
TestRunner.loadedModules = function() {
return self.runtime._modules.filter(module => module._loadedForTest)
@@ -1305,8 +1305,8 @@
};
/**
- * @param {!Array<!Runtime.Module>} relativeTo
- * @return {!Array<!Runtime.Module>}
+ * @param {!Array<!Root.Runtime.Module>} relativeTo
+ * @return {!Array<!Root.Runtime.Module>}
*/
TestRunner.dumpLoadedModules = function(relativeTo) {
const previous = new Set(relativeTo || []);
@@ -1369,7 +1369,7 @@
* @return {string}
*/
TestRunner.url = function(url = '') {
- const testScriptURL = /** @type {string} */ (Runtime.queryParam('test'));
+ const testScriptURL = /** @type {string} */ (Root.Runtime.queryParam('test'));
// This handles relative (e.g. "../file"), root (e.g. "/resource"),
// absolute (e.g. "http://", "data:") and empty (e.g. "") paths
@@ -1474,14 +1474,14 @@
* @return {boolean}
*/
TestRunner._isDebugTest = function() {
- return !self.testRunner || !!Runtime.queryParam('debugFrontend');
+ return !self.testRunner || !!Root.Runtime.queryParam('debugFrontend');
};
/**
* @return {boolean}
*/
TestRunner._isStartupTest = function() {
- return Runtime.queryParam('test').includes('/startup/');
+ return Root.Runtime.queryParam('test').includes('/startup/');
};
(async function() {
diff --git a/front_end/text_editor/CodeMirrorTextEditor.js b/front_end/text_editor/CodeMirrorTextEditor.js
index 486dd04..62be767 100644
--- a/front_end/text_editor/CodeMirrorTextEditor.js
+++ b/front_end/text_editor/CodeMirrorTextEditor.js
@@ -288,7 +288,7 @@
/**
* @param {string} mimeType
- * @return {!Array<!Runtime.Extension>}}
+ * @return {!Array<!Root.Runtime.Extension>}}
*/
static _collectUninstalledModes(mimeType) {
const installed = TextEditor.CodeMirrorTextEditor._loadedMimeModeExtensions;
@@ -319,7 +319,7 @@
}
/**
- * @param {!Array<!Runtime.Extension>} extensions
+ * @param {!Array<!Root.Runtime.Extension>} extensions
* @return {!Promise}
*/
static _installMimeTypeModes(extensions) {
@@ -327,7 +327,7 @@
return Promise.all(promises);
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
* @param {!Object} instance
*/
function installMode(extension, instance) {
@@ -1764,7 +1764,7 @@
TextEditor.CodeMirrorTextEditor._overrideModeWithPrefixedTokens('javascript', 'js-');
TextEditor.CodeMirrorTextEditor._overrideModeWithPrefixedTokens('xml', 'xml-');
-/** @type {!Set<!Runtime.Extension>} */
+/** @type {!Set<!Root.Runtime.Extension>} */
TextEditor.CodeMirrorTextEditor._loadedMimeModeExtensions = new Set();
@@ -1775,7 +1775,7 @@
TextEditor.CodeMirrorMimeMode.prototype = {
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
*/
install(extension) {}
};
diff --git a/front_end/timeline/TimelineController.js b/front_end/timeline/TimelineController.js
index 0d6e19e..6b28cbb 100644
--- a/front_end/timeline/TimelineController.js
+++ b/front_end/timeline/TimelineController.js
@@ -59,21 +59,21 @@
];
categoriesArray.push(TimelineModel.TimelineModel.Category.LatencyInfo);
- if (Runtime.experiments.isEnabled('timelineFlowEvents')) {
+ if (Root.Runtime.experiments.isEnabled('timelineFlowEvents')) {
categoriesArray.push('devtools.timeline.async');
}
- if (Runtime.experiments.isEnabled('timelineV8RuntimeCallStats') && options.enableJSSampling) {
+ if (Root.Runtime.experiments.isEnabled('timelineV8RuntimeCallStats') && options.enableJSSampling) {
categoriesArray.push(disabledByDefault('v8.runtime_stats_sampling'));
}
- if (!Runtime.queryParam('timelineTracingJSProfileDisabled') && options.enableJSSampling) {
+ if (!Root.Runtime.queryParam('timelineTracingJSProfileDisabled') && options.enableJSSampling) {
categoriesArray.push(disabledByDefault('v8.cpu_profiler'));
if (Common.moduleSetting('highResolutionCpuProfiling').get()) {
categoriesArray.push(disabledByDefault('v8.cpu_profiler.hires'));
}
}
categoriesArray.push(disabledByDefault('devtools.timeline.stack'));
- if (Runtime.experiments.isEnabled('timelineInvalidationTracking')) {
+ if (Root.Runtime.experiments.isEnabled('timelineInvalidationTracking')) {
categoriesArray.push(disabledByDefault('devtools.timeline.invalidationTracking'));
}
if (options.capturePictures) {
@@ -198,7 +198,7 @@
// caused by starting CPU profiler, that needs to traverse JS heap to collect
// all the functions data.
await SDK.targetManager.suspendAllTargets('performance-timeline');
- if (enableJSSampling && Runtime.queryParam('timelineTracingJSProfileDisabled')) {
+ if (enableJSSampling && Root.Runtime.queryParam('timelineTracingJSProfileDisabled')) {
await this._startProfilingOnAllModels();
}
if (!this._tracingManager) {
diff --git a/front_end/timeline/TimelineFlameChartDataProvider.js b/front_end/timeline/TimelineFlameChartDataProvider.js
index b2a177a..5943e1c 100644
--- a/front_end/timeline/TimelineFlameChartDataProvider.js
+++ b/front_end/timeline/TimelineFlameChartDataProvider.js
@@ -417,8 +417,8 @@
}
const isExtension = entryType === Timeline.TimelineFlameChartDataProvider.EntryType.ExtensionEvent;
const openEvents = [];
- const flowEventsEnabled = Runtime.experiments.isEnabled('timelineFlowEvents');
- const blackboxingEnabled = !isExtension && Runtime.experiments.isEnabled('blackboxJSFramesOnTimeline');
+ const flowEventsEnabled = Root.Runtime.experiments.isEnabled('timelineFlowEvents');
+ const blackboxingEnabled = !isExtension && Root.Runtime.experiments.isEnabled('blackboxJSFramesOnTimeline');
let maxStackDepth = 0;
let group = null;
if (track && track.type === TimelineModel.TimelineModel.TrackType.MainThread) {
diff --git a/front_end/timeline/TimelineFlameChartView.js b/front_end/timeline/TimelineFlameChartView.js
index 24b29d8..4c10ef6 100644
--- a/front_end/timeline/TimelineFlameChartView.js
+++ b/front_end/timeline/TimelineFlameChartView.js
@@ -301,7 +301,7 @@
*/
_onEntrySelected(dataProvider, event) {
const entryIndex = /** @type{number} */ (event.data);
- if (Runtime.experiments.isEnabled('timelineEventInitiators') && dataProvider === this._mainDataProvider) {
+ if (Root.Runtime.experiments.isEnabled('timelineEventInitiators') && dataProvider === this._mainDataProvider) {
if (this._mainDataProvider.buildFlowForInitiator(entryIndex)) {
this._mainFlameChart.scheduleUpdate();
}
diff --git a/front_end/timeline/TimelinePanel.js b/front_end/timeline/TimelinePanel.js
index 74d990c..d9ac62e 100644
--- a/front_end/timeline/TimelinePanel.js
+++ b/front_end/timeline/TimelinePanel.js
@@ -73,7 +73,7 @@
this._startCoverage = Common.settings.createSetting('timelineStartCoverage', false);
this._startCoverage.setTitle(ls`Coverage`);
- if (!Runtime.experiments.isEnabled('recordCoverageWithPerformanceTracing')) {
+ if (!Root.Runtime.experiments.isEnabled('recordCoverageWithPerformanceTracing')) {
this._startCoverage.set(false);
}
@@ -235,7 +235,7 @@
this._createSettingCheckbox(this._showMemorySetting, Common.UIString('Show memory timeline'));
this._panelToolbar.appendToolbarItem(this._showMemoryToolbarCheckbox);
- if (Runtime.experiments.isEnabled('recordCoverageWithPerformanceTracing')) {
+ if (Root.Runtime.experiments.isEnabled('recordCoverageWithPerformanceTracing')) {
this._startCoverageCheckbox =
this._createSettingCheckbox(this._startCoverage, ls`Record coverage with performance trace`);
this._panelToolbar.appendToolbarItem(this._startCoverageCheckbox);
@@ -431,7 +431,7 @@
_updateOverviewControls() {
this._overviewControls = [];
this._overviewControls.push(new Timeline.TimelineEventOverviewResponsiveness());
- if (Runtime.experiments.isEnabled('inputEventsOnTimelineOverview')) {
+ if (Root.Runtime.experiments.isEnabled('inputEventsOnTimelineOverview')) {
this._overviewControls.push(new Timeline.TimelineEventOverviewInput());
}
this._overviewControls.push(new Timeline.TimelineEventOverviewFrames());
@@ -626,7 +626,7 @@
* @param {!Timeline.PerformanceModel} model
*/
_applyFilters(model) {
- if (model.timelineModel().isGenericTrace() || Runtime.experiments.isEnabled('timelineShowAllEvents')) {
+ if (model.timelineModel().isGenericTrace() || Root.Runtime.experiments.isEnabled('timelineShowAllEvents')) {
return;
}
model.setFilters([Timeline.TimelineUIUtils.visibleEventsFilter()]);
diff --git a/front_end/timeline_model/TimelineJSProfile.js b/front_end/timeline_model/TimelineJSProfile.js
index d2478f2..0d45339 100644
--- a/front_end/timeline_model/TimelineJSProfile.js
+++ b/front_end/timeline_model/TimelineJSProfile.js
@@ -81,8 +81,8 @@
const jsFramesStack = [];
const lockedJsStackDepth = [];
let ordinal = 0;
- const showAllEvents = Runtime.experiments.isEnabled('timelineShowAllEvents');
- const showRuntimeCallStats = Runtime.experiments.isEnabled('timelineV8RuntimeCallStats');
+ const showAllEvents = Root.Runtime.experiments.isEnabled('timelineShowAllEvents');
+ const showRuntimeCallStats = Root.Runtime.experiments.isEnabled('timelineV8RuntimeCallStats');
const showNativeFunctions = Common.moduleSetting('showNativeFunctionsInJSProfile').get();
/**
diff --git a/front_end/toolbox.html b/front_end/toolbox.html
index ab89205..98dbdd3 100644
--- a/front_end/toolbox.html
+++ b/front_end/toolbox.html
@@ -9,7 +9,6 @@
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' 'unsafe-inline' ">
<script type="module" src="root.js"></script>
- <script defer src="Runtime.js"></script>
<script defer src="toolbox.js"></script>
</head>
<body class="undocked" id="-blink-dev-tools"></body>
diff --git a/front_end/toolbox.js b/front_end/toolbox.js
index fe47ccc..0a1583c 100644
--- a/front_end/toolbox.js
+++ b/front_end/toolbox.js
@@ -1,4 +1,4 @@
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-Runtime.startApplication('toolbox');
+Root.Runtime.startApplication('toolbox');
diff --git a/front_end/ui/ActionRegistry.js b/front_end/ui/ActionRegistry.js
index a4b37a1..247505e 100644
--- a/front_end/ui/ActionRegistry.js
+++ b/front_end/ui/ActionRegistry.js
@@ -15,7 +15,7 @@
self.runtime.extensions('action').forEach(registerExtension, this);
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
* @this {UI.ActionRegistry}
*/
function registerExtension(extension) {
@@ -58,7 +58,7 @@
return context.applicableExtensions(extensions).valuesArray().map(extensionToAction.bind(this));
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
* @return {!UI.Action}
* @this {UI.ActionRegistry}
*/
@@ -81,7 +81,7 @@
*/
UI.Action = class extends Common.Object {
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
*/
constructor(extension) {
super();
diff --git a/front_end/ui/Context.js b/front_end/ui/Context.js
index 062c83c..8c08f9d 100644
--- a/front_end/ui/Context.js
+++ b/front_end/ui/Context.js
@@ -95,8 +95,8 @@
}
/**
- * @param {!Array.<!Runtime.Extension>} extensions
- * @return {!Set.<!Runtime.Extension>}
+ * @param {!Array.<!Root.Runtime.Extension>} extensions
+ * @return {!Set.<!Root.Runtime.Extension>}
*/
applicableExtensions(extensions) {
const targetExtensionSet = new Set();
diff --git a/front_end/ui/InspectorView.js b/front_end/ui/InspectorView.js
index 7337570..8b2af91 100644
--- a/front_end/ui/InspectorView.js
+++ b/front_end/ui/InspectorView.js
@@ -44,7 +44,7 @@
this._drawerSplitWidget.enableShowModeSaving();
this._drawerSplitWidget.show(this.element);
- if (Runtime.experiments.isEnabled('splitInDrawer')) {
+ if (Root.Runtime.experiments.isEnabled('splitInDrawer')) {
this._innerDrawerSplitWidget = new UI.SplitWidget(true, true, 'Inspector.drawerSidebarSplitViewState', 200, 200);
this._drawerSplitWidget.setSidebarWidget(this._innerDrawerSplitWidget);
this._drawerSidebarTabbedLocation =
@@ -78,7 +78,7 @@
// Create main area tabbed pane.
this._tabbedLocation = UI.viewManager.createTabbedLocation(
InspectorFrontendHost.bringToFront.bind(InspectorFrontendHost), 'panel', true, true,
- Runtime.queryParam('panel'));
+ Root.Runtime.queryParam('panel'));
this._tabbedPane = this._tabbedLocation.tabbedPane();
this._tabbedPane.registerRequiredCSS('ui/inspectorViewTabbedPane.css');
diff --git a/front_end/ui/ShortcutRegistry.js b/front_end/ui/ShortcutRegistry.js
index c017e8b..3a2cefe 100644
--- a/front_end/ui/ShortcutRegistry.js
+++ b/front_end/ui/ShortcutRegistry.js
@@ -210,7 +210,7 @@
extensions.forEach(registerExtension, this);
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
* @this {UI.ShortcutRegistry}
*/
function registerExtension(extension) {
diff --git a/front_end/ui/UIUtils.js b/front_end/ui/UIUtils.js
index 3a0badd..a0ec703 100644
--- a/front_end/ui/UIUtils.js
+++ b/front_end/ui/UIUtils.js
@@ -1375,7 +1375,7 @@
* @suppressGlobalPropertiesCheck
*/
UI.appendStyle = function(node, cssFile) {
- const content = Runtime.cachedResources[cssFile] || '';
+ const content = Root.Runtime.cachedResources[cssFile] || '';
if (!content) {
console.error(cssFile + ' not preloaded. Check module.json');
}
@@ -1386,7 +1386,7 @@
const themeStyleSheet = UI.themeSupport.themeStyleSheet(cssFile, content);
if (themeStyleSheet) {
styleElement = createElement('style');
- styleElement.textContent = themeStyleSheet + '\n' + Runtime.resolveSourceURL(cssFile + '.theme');
+ styleElement.textContent = themeStyleSheet + '\n' + Root.Runtime.resolveSourceURL(cssFile + '.theme');
node.appendChild(styleElement);
}
};
diff --git a/front_end/ui/View.js b/front_end/ui/View.js
index 53efa5e..a55c478 100644
--- a/front_end/ui/View.js
+++ b/front_end/ui/View.js
@@ -145,7 +145,7 @@
*/
UI.ProvidedView = class {
/**
- * @param {!Runtime.Extension} extension
+ * @param {!Root.Runtime.Extension} extension
*/
constructor(extension) {
this._extension = extension;
diff --git a/front_end/worker_app.html b/front_end/worker_app.html
index c041d37..09f263d 100644
--- a/front_end/worker_app.html
+++ b/front_end/worker_app.html
@@ -10,7 +10,6 @@
<meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' 'unsafe-inline' https://chrome-devtools-frontend.appspot.com">
<meta name="referrer" content="no-referrer">
<script type="module" src="root.js"></script>
- <script defer src="Runtime.js"></script>
<script defer src="worker_app.js"></script>
</head>
<body class="undocked" id="-blink-dev-tools"></body>
diff --git a/front_end/worker_app.js b/front_end/worker_app.js
index 4cd27a8..6864279 100644
--- a/front_end/worker_app.js
+++ b/front_end/worker_app.js
@@ -2,4 +2,4 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-Runtime.startApplication('worker_app');
+Root.Runtime.startApplication('worker_app');