Bug 883600 - Add an isLocal method to the walker. r=paul
authorDave Camp <dcamp@mozilla.com>
Mon, 10 Jun 2013 21:18:43 -0700
changeset 135968 25fba7984dc9638c7c9f5d446feac8d5b102a5ed
parent 135967 98ffaa4da1c7c677f6bd9475e692741bce383a44
child 135969 b2db738f75d8cae8cf236479d558e18f6ba4f5b4
push id1779
push userdcamp@campd.org
push dateFri, 21 Jun 2013 22:07:18 +0000
treeherderfx-team@deb4d87d1684 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaul
bugs883600
milestone24.0a1
Bug 883600 - Add an isLocal method to the walker. r=paul
toolkit/devtools/server/actors/inspector.js
--- a/toolkit/devtools/server/actors/inspector.js
+++ b/toolkit/devtools/server/actors/inspector.js
@@ -1578,20 +1578,24 @@ var WalkerFront = exports.WalkerFront = 
    * Handle the `new-mutations` notification by fetching the
    * available mutation records.
    */
   onMutations: protocol.preEvent("new-mutations", function() {
     // Fetch and process the mutations.
     this.getMutations({cleanup: this.autoCleanup}).then(null, console.error);
   }),
 
+  isLocal: function() {
+    return !!this.conn._transport._serverConnection;
+  },
+
   // XXX hack during transition to remote inspector: get a proper NodeFront
   // for a given local node.  Only works locally.
   frontForRawNode: function(rawNode){
-    if (!this.conn._transport._serverConnection) {
+    if (!this.isLocal()) {
       throw Error("Tried to use frontForRawNode on a remote connection.");
     }
     let walkerActor = this.conn._transport._serverConnection.getActor(this.actorID);
     if (!walkerActor) {
       throw Error("Could not find client side for actor " + this.actorID);
     }
     let nodeActor = walkerActor._ref(rawNode);