Bug 1370925 - Fix missing DebuggingServer.removeContentServerScript.
MozReview-Commit-ID: F1elUP3b7OD
--- a/devtools/server/main.js
+++ b/devtools/server/main.js
@@ -1378,16 +1378,30 @@ var DebuggerServer = {
for (let connID of Object.getOwnPropertyNames(this._connections)) {
this._connections[connID].rootActor.removeActorByName(name);
}
}
}
},
/**
+ * Called when DevTools are unloaded to remove the contend process server script for the
+ * list of scripts loaded for each new content process. Will also remove message
+ * listeners from already loaded scripts.
+ */
+ removeContentServerScript() {
+ Services.ppmm.removeDelayedProcessScript(CONTENT_PROCESS_DBG_SERVER_SCRIPT);
+ try {
+ Services.ppmm.broadcastAsyncMessage("debug:close-content-server");
+ } catch (e) {
+ // Nothing to do
+ }
+ },
+
+ /**
* Searches all active connections for an actor matching an ID.
*
* ⚠ TO BE USED ONLY FROM SERVER CODE OR TESTING ONLY! ⚠`
*
* This is helpful for some tests which depend on reaching into the server to check some
* properties of an actor, and it is also used by the actors related to the
* DevTools WebExtensions API to be able to interact with the actors created for the
* panels natively provided by the DevTools Toolbox.