Bug 1494162 - Part 56: Reorder the function calls in deferredOpen to prioritize initializing the markup and sidebar panels. r=pbro
authorGabriel Luong <gabriel.luong@gmail.com>
Fri, 05 Oct 2018 10:38:48 -0400
changeset 495554 c0ae43bf692e1426a687e1e6b94fd3da8a48eff8
parent 495553 708061fd15ce14baa5d4f8f79be874a77119359a
child 495555 0a095b6e9b7d67071263c8c1b3ba0dd1b8a68884
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1494162
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1494162 - Part 56: Reorder the function calls in deferredOpen to prioritize initializing the markup and sidebar panels. r=pbro
devtools/client/inspector/inspector.js
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -258,61 +258,59 @@ Inspector.prototype = {
    */
   _handleRejectionIfNotDestroyed: function(e) {
     if (!this._panelDestroyer) {
       console.error(e);
     }
   },
 
   _deferredOpen: async function() {
-    this.breadcrumbs = new HTMLBreadcrumbs(this);
-
     this.walker.on("new-root", this.onNewRoot);
     this.toolbox.on("host-changed", this.onHostChanged);
     this.selection.on("new-node-front", this.onNewSelection);
     this.selection.on("detached-front", this.onDetached);
 
-    if (this.target.isLocalTab) {
-      this.target.on("thread-paused", this._updateDebuggerPausedWarning);
-      this.target.on("thread-resumed", this._updateDebuggerPausedWarning);
-      this.toolbox.on("select", this._updateDebuggerPausedWarning);
-      this._updateDebuggerPausedWarning();
-    }
-
     this._initMarkup();
     this.isReady = false;
 
-    this.setupSearchBox();
-
     // Setup the splitter before the sidebar is displayed so,
     // we don't miss any events.
     this.setupSplitter();
 
     // We can display right panel with: tab bar, markup view and breadbrumb. Right after
     // the splitter set the right and left panel sizes, in order to avoid resizing it
     // during load of the inspector.
     this.panelDoc.getElementById("inspector-main-content").style.visibility = "visible";
 
     this.setupSidebar();
-    this.setupExtensionSidebars();
 
     await this.once("markuploaded");
     this.isReady = true;
 
     // All the components are initialized. Let's select a node.
     if (this._defaultNode) {
       const onAllPanelsUpdated = this.once("inspector-updated");
       this.selection.setNodeFront(this._defaultNode, { reason: "inspector-open" });
       await onAllPanelsUpdated;
       await this.markup.expandNode(this.selection.nodeFront);
     }
 
-    // Setup the toolbar only now because it may depend on the document.
+    // Take care of the remaining initialization and setup.
+    this.breadcrumbs = new HTMLBreadcrumbs(this);
+    this.setupExtensionSidebars();
+    this.setupSearchBox();
     await this.setupToolbar();
 
+    if (this.target.isLocalTab) {
+      this.target.on("thread-paused", this._updateDebuggerPausedWarning);
+      this.target.on("thread-resumed", this._updateDebuggerPausedWarning);
+      this.toolbox.on("select", this._updateDebuggerPausedWarning);
+      this._updateDebuggerPausedWarning();
+    }
+
     // Log the 3 pane inspector setting on inspector open. The question we want to answer
     // is:
     // "What proportion of users use the 3 pane vs 2 pane inspector on inspector open?"
     this.telemetry.keyedScalarAdd(THREE_PANE_ENABLED_SCALAR, this.is3PaneModeEnabled, 1);
 
     this.emit("ready");
     return this;
   },