Bug 792925 - Dynamically-added tab-scoped actors should get a reference to their parent; r=msucan
☠☠ backed out by d3e7a30df2a6 ☠ ☠
authorPanos Astithas <past@mozilla.com>
Mon, 24 Sep 2012 12:43:26 +0100
changeset 108502 4a87ede182ca81e35d0a39f59595a960a0975683
parent 108501 dd150b8dc4dc864e504887d542be9e9543b1b29b
child 108503 fd6633f5666e828a7e61f36ccf3fd7c943b84249
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersmsucan
bugs792925
milestone18.0a1
Bug 792925 - Dynamically-added tab-scoped actors should get a reference to their parent; r=msucan
toolkit/devtools/debugger/server/dbg-browser-actors.js
toolkit/devtools/debugger/server/dbg-server.js
--- a/toolkit/devtools/debugger/server/dbg-browser-actors.js
+++ b/toolkit/devtools/debugger/server/dbg-browser-actors.js
@@ -136,17 +136,17 @@ BrowserRootActor.prototype = {
   /**
    * Adds dynamically-added actors from add-ons to the provided pool.
    */
   _createExtraActors: function BRA_createExtraActors(aFactories, aPool) {
     // Walk over global actors added by extensions.
     for (let name in aFactories) {
       let actor = this._extraActors[name];
       if (!actor) {
-        actor = aFactories[name].bind(null, this.conn);
+        actor = aFactories[name].bind(null, this.conn, this);
         actor.prototype = aFactories[name].prototype;
         actor.parentID = this.actorID;
         this._extraActors[name] = actor;
       }
       aPool.addActor(actor);
     }
   },
 
--- a/toolkit/devtools/debugger/server/dbg-server.js
+++ b/toolkit/devtools/debugger/server/dbg-server.js
@@ -528,16 +528,17 @@ DebuggerServerConnection.prototype = {
       } catch (e) {
         Cu.reportError(e);
         this.transport.send({
           error: "unknownError",
           message: ("error occurred while creating actor '" + actor.name +
                     "': " + safeErrorString(e))
         });
       }
+      instance.parentID = actor.parentID;
       // We want the newly-constructed actor to completely replace the factory
       // actor. Reusing the existing actor ID will make sure ActorPool.addActor
       // does the right thing.
       instance.actorID = actor.actorID;
       actor.registeredPool.addActor(instance);
       actor = instance;
     }