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 <[email protected]>
Commit-Queue: Tim Van der Lippe <[email protected]>
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/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));
}