author | Nicolas Chevobbe <nchevobbe@mozilla.com> |
Wed, 28 Aug 2019 06:37:18 +0000 | |
changeset 490322 | 9a111ae683fae0100c145a333e8fdd95086a2ef1 |
parent 490321 | d3fe24ea630981ac7b2fe46912a03aff2665e1b6 |
child 490323 | 2e8bbe940e424ae3a7d7094f556e12da71a4901f |
child 490363 | 4e083e209fcf065338557ae95605d570351da33b |
push id | 93800 |
push user | nchevobbe@mozilla.com |
push date | Wed, 28 Aug 2019 06:38:05 +0000 |
treeherder | autoland@9a111ae683fa [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | ochameau |
bugs | 1572671 |
milestone | 70.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
|
devtools/server/connectors/content-process-connector.js | file | annotate | diff | comparison | revisions |
--- a/devtools/server/connectors/content-process-connector.js +++ b/devtools/server/connectors/content-process-connector.js @@ -16,33 +16,28 @@ loader.lazyRequireGetter( ); const CONTENT_PROCESS_SERVER_STARTUP_SCRIPT = "resource://devtools/server/startup/content-process.js"; loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter"); const ContentProcessConnector = { - // Flag to check if the content process server startup script was already loaded. - _contentProcessServerStartupScriptLoaded: false, - /** * Start a DevTools server in a content process (representing the entire process, not * just a single frame) and add it as a child server for an active connection. */ startServer(connection, mm, onDestroy) { return new Promise(resolve => { const prefix = connection.allocID("content-process"); let actor, childTransport; mm.addMessageListener("debug:content-process-actor", function listener( msg ) { - // Arbitrarily choose the first content process to reply - // XXX: This code needs to be updated if we use more than one content process mm.removeMessageListener("debug:content-process-actor", listener); // Pipe Debugger message from/to parent/child via the message manager childTransport = new ChildDebuggerTransport(mm, prefix); childTransport.hooks = { onPacket: connection.send.bind(connection), onClosed() {}, }; @@ -53,23 +48,25 @@ const ContentProcessConnector = { dumpn(`Start forwarding for process with prefix ${prefix}`); actor = msg.json.actor; resolve(actor); }); // Load the content process server startup script only once. - if (!this._contentProcessServerStartupScriptLoaded) { + const isContentProcessServerStartupScripLoaded = Services.ppmm + .getDelayedProcessScripts() + .some(([uri]) => uri === CONTENT_PROCESS_SERVER_STARTUP_SCRIPT); + if (!isContentProcessServerStartupScripLoaded) { // Load the process script that will receive the debug:init-content-server message Services.ppmm.loadProcessScript( CONTENT_PROCESS_SERVER_STARTUP_SCRIPT, true ); - this._contentProcessServerStartupScriptLoaded = true; } // Send a message to the content process server startup script to forward it the // prefix. mm.sendAsyncMessage("debug:init-content-server", { prefix: prefix, });