Make thread state changes opt-in for clients with an onThreadState handler (bug 1037514); r=fitzgen
authorPanos Astithas <past@mozilla.com>
Thu, 24 Jul 2014 18:10:21 +0300
changeset 217491 362b6f5773801360cedd288df3b518b3cd60a649
parent 217490 7086cfb5b6fed56a9cb5606799609fdfa4ab81ba
child 217492 8bb77d17d0ee332006e8815eb8cdcc7c5ef152ea
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfitzgen
bugs1037514
milestone34.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
Make thread state changes opt-in for clients with an onThreadState handler (bug 1037514); r=fitzgen
toolkit/devtools/client/dbg-client.jsm
--- a/toolkit/devtools/client/dbg-client.jsm
+++ b/toolkit/devtools/client/dbg-client.jsm
@@ -61,17 +61,17 @@ this.makeInfallible = DevToolsUtils.make
 
 let LOG_PREF = "devtools.debugger.log";
 let VERBOSE_PREF = "devtools.debugger.log.verbose";
 let wantLogging = Services.prefs.getBoolPref(LOG_PREF);
 let wantVerbose =
   Services.prefs.getPrefType(VERBOSE_PREF) !== Services.prefs.PREF_INVALID &&
   Services.prefs.getBoolPref(VERBOSE_PREF);
 
-let noop = () => {};
+const noop = () => {};
 
 function dumpn(str) {
   if (wantLogging) {
     dump("DBG-CLIENT: " + str + "\n");
   }
 }
 
 function dumpv(msg) {
@@ -896,17 +896,18 @@ DebuggerClient.prototype = {
           !(aPacket.type == ThreadStateTypes.paused &&
             aPacket.why.type in UnsolicitedPauses)) {
         activeRequest = this._activeRequests.get(aPacket.from);
         this._activeRequests.delete(aPacket.from);
       }
 
       // Packets that indicate thread state changes get special treatment.
       if (aPacket.type in ThreadStateTypes &&
-          this._clients.has(aPacket.from)) {
+          this._clients.has(aPacket.from) &&
+          typeof this._clients.get(aPacket.from)._onThreadState == "function") {
         this._clients.get(aPacket.from)._onThreadState(aPacket);
       }
       // On navigation the server resumes, so the client must resume as well.
       // We achieve that by generating a fake resumption packet that triggers
       // the client's thread state change listeners.
       if (aPacket.type == UnsolicitedNotifications.tabNavigated &&
           this._clients.has(aPacket.from) &&
           this._clients.get(aPacket.from).thread) {
@@ -2678,16 +2679,8 @@ this.debuggerSocketConnect = function (a
     transport = new DebuggerTransport(s.openInputStream(0, 0, 0),
                                       s.openOutputStream(0, 0, 0));
   } catch(e) {
     DevToolsUtils.reportException("debuggerSocketConnect", e);
     throw e;
   }
   return transport;
 }
-
-/**
- * Takes a pair of items and returns them as an array.
- */
-function pair(aItemOne, aItemTwo) {
-  return [aItemOne, aItemTwo];
-}
-function noop() {}