Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Unified Diff: third_party/WebKit/Source/devtools/front_end/main/Main.js

Issue 2419943003: DevTools: allow handing over the raw protocol connection to external clients and back. (Closed)
Patch Set: rebaselined Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/main/Main.js
diff --git a/third_party/WebKit/Source/devtools/front_end/main/Main.js b/third_party/WebKit/Source/devtools/front_end/main/Main.js
index 48e6fb074bf6cc5322674f49c778646c9056b602..88677b8a46ae85d4c1d28cf24412e4328419376d 100644
--- a/third_party/WebKit/Source/devtools/front_end/main/Main.js
+++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
@@ -231,6 +231,9 @@ WebInspector.Main.prototype = {
WebInspector.inspectorView.createToolbars();
InspectorFrontendHost.loadCompleted();
+ InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.EvaluateForTestInFrontend, this._evaluateForTestInFrontend, this);
+ InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.ReloadInspectedPage, this._reloadInspectedPage, this);
+
var extensions = self.runtime.extensions(WebInspector.QueryParamHandler);
for (var extension of extensions) {
var value = Runtime.queryParam(extension.descriptor()["name"]);
@@ -298,6 +301,14 @@ WebInspector.Main.prototype = {
WebInspector.RemoteDebuggingTerminatedScreen.show(event.data.reason);
}
+ this._createMainTarget();
+ InspectorFrontendHost.readyForTest();
+ // Asynchronously run the extensions.
+ setTimeout(this._lateInitialization.bind(this), 100);
+ },
+
+ _createMainTarget: function()
+ {
var capabilities =
WebInspector.Target.Capability.Browser | WebInspector.Target.Capability.DOM |
WebInspector.Target.Capability.JS | WebInspector.Target.Capability.Log |
@@ -309,33 +320,21 @@ WebInspector.Main.prototype = {
else if (Runtime.queryParam("v8only"))
capabilities = WebInspector.Target.Capability.JS;
- this._mainTarget = WebInspector.targetManager.createTarget(WebInspector.UIString("Main"), capabilities, connection, null);
- console.timeStamp("Main._mainTargetCreated");
- this._registerShortcuts();
-
+ this._mainTarget = WebInspector.targetManager.createTarget(WebInspector.UIString("Main"), capabilities, this._mainConnection, null);
this._mainTarget.registerInspectorDispatcher(this);
- InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.ReloadInspectedPage, this._reloadInspectedPage, this);
- InspectorFrontendHost.events.addEventListener(InspectorFrontendHostAPI.Events.EvaluateForTestInFrontend, this._evaluateForTestInFrontend, this);
-
this._mainTarget.runtimeAgent().runIfWaitingForDebugger();
-
if (this._mainTarget.hasBrowserCapability())
this._mainTarget.inspectorAgent().enable();
- InspectorFrontendHost.readyForTest();
-
- // Asynchronously run the extensions.
- setTimeout(lateInitialization.bind(this), 0);
+ console.timeStamp("Main._mainTargetCreated");
+ },
- /**
- * @this {WebInspector.Main}
- */
- function lateInitialization()
- {
- console.timeStamp("Main.lateInitialization");
- WebInspector.extensionServer.initializeExtensions();
- if (Runtime.experiments.isEnabled("nodeDebugging"))
- new WebInspector.RemoteLocationManager(this._mainTarget);
- }
+ _lateInitialization: function()
+ {
+ console.timeStamp("Main._lateInitialization");
+ this._registerShortcuts();
+ WebInspector.extensionServer.initializeExtensions();
+ if (Runtime.experiments.isEnabled("nodeDebugging"))
+ new WebInspector.RemoteLocationManager(this._mainTarget);
},
_registerForwardedShortcuts: function()

Powered by Google App Engine
This is Rietveld 408576698