Bug 784824 - support for remote debugging of b2g desktop builds; r=fabrice a=jst
authorPanos Astithas <past@mozilla.com>
Thu, 10 Jan 2013 13:00:32 +0200
changeset 118146 3f72e485670df3852ff707c4550f52b007aa4573
parent 118145 b7102f307ea0c6d25ca7638c128aaf3fd93ced2e
child 118147 73992309b6dc9cbedde76e0c96b63d1cb050b0b7
push id239
push userpastithas@mozilla.com
push dateFri, 11 Jan 2013 16:50:02 +0000
reviewersfabrice, jst
bugs784824
milestone18.0
Bug 784824 - support for remote debugging of b2g desktop builds; r=fabrice a=jst
b2g/chrome/content/dbg-browser-actors.js
b2g/chrome/jar.mn
toolkit/devtools/debugger/server/dbg-server.js
--- a/b2g/chrome/content/dbg-browser-actors.js
+++ b/b2g/chrome/content/dbg-browser-actors.js
@@ -48,30 +48,45 @@ DeviceRootActor.prototype.disconnect = f
 /**
  * Handles the listTabs request.  Builds a list of actors for the single
  * tab (window) running in the process. The actors will survive
  * until at least the next listTabs request.
  */
 DeviceRootActor.prototype.onListTabs = function DRA_onListTabs() {
   let actorPool = new ActorPool(this.conn);
 
+#ifndef MOZ_WIDGET_GONK
+  let actor = this._tabActors.get(this.browser);
+  if (!actor) {
+    actor = new DeviceTabActor(this.conn, this.browser);
+    // this.actorID is set by ActorPool when an actor is put into one.
+    actor.parentID = this.actorID;
+    this._tabActors.set(this.browser, actor);
+  }
+  actorPool.addActor(actor);
+#endif
+
   this._createExtraActors(DebuggerServer.globalActorFactories, actorPool);
 
   // Now drop the old actorID -> actor map. Actors that still mattered were
   // added to the new map, others will go away.
   if (this._tabActorPool) {
     this.conn.removeActorPool(this._tabActorPool);
   }
   this._tabActorPool = actorPool;
   this.conn.addActorPool(this._tabActorPool);
 
   let response = {
     'from': 'root',
     'selected': 0,
+#ifndef MOZ_WIDGET_GONK
+    'tabs': [actor.grip()]
+#else
     'tabs': []
+#endif
   };
   this._appendExtraActors(response);
   return response;
 };
 
 /**
  * The request types this actor can handle.
  */
--- a/b2g/chrome/jar.mn
+++ b/b2g/chrome/jar.mn
@@ -4,17 +4,17 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 
 chrome.jar:
 % content branding %content/branding/
 % content browser %content/
 
   content/arrow.svg                     (content/arrow.svg)
-  content/dbg-browser-actors.js         (content/dbg-browser-actors.js)
+* content/dbg-browser-actors.js         (content/dbg-browser-actors.js)
 * content/dbg-webapps-actors.js         (content/dbg-webapps-actors.js)
   content/forms.js                      (content/forms.js)
 * content/settings.js                   (content/settings.js)
 * content/shell.xul                     (content/shell.xul)
 * content/shell.js                      (content/shell.js)
 #ifndef ANDROID
   content/screen.js                     (content/screen.js)
   content/runapp.js                     (content/runapp.js)
--- a/toolkit/devtools/debugger/server/dbg-server.js
+++ b/toolkit/devtools/debugger/server/dbg-server.js
@@ -180,17 +180,17 @@ var DebuggerServer = {
     loadSubScript.call(this, aURL);
   },
 
   /**
    * Install Firefox-specific actors.
    */
   addBrowserActors: function DH_addBrowserActors() {
     this.addActors("chrome://global/content/devtools/dbg-browser-actors.js");
-#ifndef MOZ_B2G
+#ifndef MOZ_WIDGET_GONK
     this.addActors("chrome://global/content/devtools/dbg-webconsole-actors.js");
     this.addTabActor(this.WebConsoleActor, "consoleActor");
     this.addGlobalActor(this.WebConsoleActor, "consoleActor");
 #endif
     if ("nsIProfiler" in Ci)
       this.addActors("chrome://global/content/devtools/dbg-profiler-actors.js");
   },