Bug 937172 - Use a parent-determined prefix for debugging child processes (r=ochameau,past)
authorBill McCloskey <wmccloskey@mozilla.com>
Mon, 10 Mar 2014 09:38:12 -0700
changeset 191035 7d9a9a8d653bf1512df368428d1bd4c8fd1d0ee6
parent 191034 11209dad5892f7702a42c1104f551ed6900f6340
child 191036 6d99499b74b6497e702a598edb9f04b7c7c9cb3a
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau, past
bugs937172
milestone30.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 937172 - Use a parent-determined prefix for debugging child processes (r=ochameau,past)
toolkit/devtools/server/child.js
toolkit/devtools/server/main.js
--- a/toolkit/devtools/server/child.js
+++ b/toolkit/devtools/server/child.js
@@ -21,24 +21,20 @@
   // time we load child.js
   DebuggerServer.addChildActors();
 
   let onConnect = DevToolsUtils.makeInfallible(function (msg) {
     removeMessageListener("debug:connect", onConnect);
 
     let mm = msg.target;
 
-    let prefix = msg.data.prefix + docShell.appId;
-
-    let conn = DebuggerServer.connectToParent(prefix, mm);
+    let conn = DebuggerServer.connectToParent(msg.data.prefix, mm);
 
     let actor = new DebuggerServer.ContentAppActor(conn, content);
     let actorPool = new ActorPool(conn);
     actorPool.addActor(actor);
     conn.addActorPool(actorPool);
 
-    sendAsyncMessage("debug:actor", {actor: actor.grip(),
-                                     appId: docShell.appId,
-                                     prefix: prefix});
+    sendAsyncMessage("debug:actor", {actor: actor.grip()});
   });
 
   addMessageListener("debug:connect", onConnect);
 })();
--- a/toolkit/devtools/server/main.js
+++ b/toolkit/devtools/server/main.js
@@ -526,23 +526,22 @@ var DebuggerServer = {
   },
 
   connectToChild: function(aConnection, aMessageManager, aOnDisconnect) {
     let deferred = Promise.defer();
 
     let mm = aMessageManager;
     mm.loadFrameScript("resource://gre/modules/devtools/server/child.js", false);
 
-    let actor, childTransport, prefix;
+    let actor, childTransport;
+    let prefix = aConnection.allocID("child");
 
     let onActorCreated = DevToolsUtils.makeInfallible(function (msg) {
       mm.removeMessageListener("debug:actor", onActorCreated);
 
-      prefix = msg.json.prefix;
-
       // Pipe Debugger message from/to parent/child via the message manager
       childTransport = new ChildDebuggerTransport(mm, prefix);
       childTransport.hooks = {
         onPacket: aConnection.send.bind(aConnection),
         onClosed: function () {}
       };
       childTransport.ready();
 
@@ -581,18 +580,17 @@ var DebuggerServer = {
         if (aOnDisconnect) {
           aOnDisconnect(mm);
         }
       }
     }).bind(this);
     Services.obs.addObserver(onMessageManagerDisconnect,
                              "message-manager-disconnect", false);
 
-    let prefixStart = aConnection.prefix + "child";
-    mm.sendAsyncMessage("debug:connect", { prefix: prefixStart });
+    mm.sendAsyncMessage("debug:connect", { prefix: prefix });
 
     return deferred.promise;
   },
 
   // nsIServerSocketListener implementation
 
   onSocketAccepted:
   DevToolsUtils.makeInfallible(function DS_onSocketAccepted(aSocket, aTransport) {