Created
November 5, 2019 13:48
-
-
Save juliandescottes/b0117c71b6af9769ca3e02444510abfb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/devtools/client/framework/ToolboxProcess.jsm b/devtools/client/framework/ToolboxProcess.jsm | |
--- a/devtools/client/framework/ToolboxProcess.jsm | |
+++ b/devtools/client/framework/ToolboxProcess.jsm | |
@@ -135,17 +135,17 @@ BrowserToolboxProcess.prototype = { | |
dumpn("Initializing the chrome toolbox server."); | |
// Create a separate loader instance, so that we can be sure to receive a | |
// separate instance of the DebuggingServer from the rest of the devtools. | |
// This allows us to safely use the tools against even the actors and | |
// DebuggingServer itself, especially since we can mark this loader as | |
// invisible to the debugger (unlike the usual loader settings). | |
this.loader = new DevToolsLoader({ | |
- invisibleToDebugger: true, | |
+ invisibleToDebugger: false, | |
}); | |
const { DebuggerServer } = this.loader.require( | |
"devtools/server/debugger-server" | |
); | |
const { SocketListener } = this.loader.require( | |
"devtools/shared/security/socket" | |
); | |
this.debuggerServer = DebuggerServer; | |
diff --git a/devtools/server/actors/highlighters/box-model-observer.js b/devtools/server/actors/highlighters/box-model-observer.js | |
--- a/devtools/server/actors/highlighters/box-model-observer.js | |
+++ b/devtools/server/actors/highlighters/box-model-observer.js | |
@@ -16,20 +16,28 @@ const { getCurrentZoom } = require("devt | |
const { | |
getNodeDisplayName, | |
getNodeGridFlexType, | |
} = require("devtools/server/actors/inspector/utils"); | |
const nodeConstants = require("devtools/shared/dom-node-constants"); | |
const { LocalizationHelper } = require("devtools/shared/l10n"); | |
const STRINGS_URI = "devtools/shared/locales/highlighters.properties"; | |
const L10N = new LocalizationHelper(STRINGS_URI); | |
-const { | |
- BOX_MODEL_REGIONS, | |
- BoxModelHighlighterRenderer, | |
-} = require("devtools/server/actors/highlighters/box-model-renderer"); | |
+ | |
+// Use lazyRequireGetter to avoid eagerly loading this file in child processes. | |
+loader.lazyRequireGetter( | |
+ this, | |
+ "BoxModelHighlighterRenderer", | |
+ "devtools/server/actors/highlighters/box-model-renderer", | |
+ true | |
+); | |
+ | |
+// Duplicated from BoxModelHighlighterRenderer. | |
+// Should be extracted to a common constants file. | |
+const BOX_MODEL_REGIONS = ["margin", "border", "padding", "content"]; | |
/** | |
* The BoxModelHighlighterObserver observes the coordinates of a node and communicates | |
* with the BoxModelHighlighterRenderer which draws the box model regions on top the a | |
* node. | |
* | |
* When in the context of the content toolbox, the observer lives in | |
* the child process (aka content process) and the renderer is set up in the parent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment