Bug 1446222 - Move DevTools worker startup to new dir. r=jdescottes

Move and rename the server's worker debugger script that starts DevTools for a
worker from `worker.js` to `startup/worker.js`.

These code paths will likely change more as Site Isolation work continues, but
for now, we have this light cleanup to gather startup-related paths together.

MozReview-Commit-ID: EvzDSGnG1vU

--HG--
rename : devtools/server/worker.js => devtools/server/startup/worker.js
extra : rebase_source : e0b4600a0644e3e8ebb14f3da9c7dcea94d776ad
This commit is contained in:
J. Ryan Stinnett 2018-03-19 22:14:08 -05:00
parent aed6462de1
commit c690e84914
4 changed files with 12 additions and 2 deletions

View File

@ -779,11 +779,15 @@ var DebuggerServer = {
});
},
/**
* Start a DevTools server in a worker and add it as a child server for an active
* connection.
*/
connectToWorker(connection, dbg, id, options) {
return new Promise((resolve, reject) => {
// Step 1: Ensure the worker debugger is initialized.
if (!dbg.isInitialized) {
dbg.initialize("resource://devtools/server/worker.js");
dbg.initialize("resource://devtools/server/startup/worker.js");
// Create a listener for rpc requests from the worker debugger. Only do
// this once, when the worker debugger is first initialized, rather than

View File

@ -19,7 +19,6 @@ XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
DevToolsModules(
'main.js',
'worker.js'
)
with Files('**'):

View File

@ -8,4 +8,5 @@ DevToolsModules(
'content-process.js',
'content-process.jsm',
'frame.js',
'worker.js',
)

View File

@ -7,6 +7,12 @@
/* eslint-env mozilla/chrome-worker */
/* global worker, loadSubScript, global */
/*
* Worker debugger script that listens for requests to start a `DebuggerServer` for a
* worker in a process. Loaded into a specific worker during
* `DebuggerServer.connectToWorker` which is called from the same process as the worker.
*/
// This function is used to do remote procedure calls from the worker to the
// main thread. It is exposed as a built-in global to every module by the
// worker loader. To make sure the worker loader can access it, it needs to be