Bug 1533160 - Clean up dumpThread. r=loganfsmyth
☠☠ backed out by 395886e7b66b ☠ ☠
authorJason Laster <jlaster@mozilla.com>
Thu, 07 Mar 2019 03:01:30 +0000
changeset 520694 238d9fba1b5a62117ddf96bfb020c0743c877ba7
parent 520693 fb1e1ab7408a17c1fda2dc6283fbbb7c4d1cd88f
child 520695 afb2e1e1665f03d83fd217cd953b4759ca3747cb
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersloganfsmyth
bugs1533160
milestone67.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 1533160 - Clean up dumpThread. r=loganfsmyth Differential Revision: https://phabricator.services.mozilla.com/D22399
devtools/client/debugger/new/src/client/firefox/commands.js
devtools/client/debugger/new/src/utils/dbg.js
devtools/server/actors/thread.js
devtools/server/actors/utils/breakpoint-actor-map.js
--- a/devtools/client/debugger/new/src/client/firefox/commands.js
+++ b/devtools/client/debugger/new/src/client/firefox/commands.js
@@ -67,18 +67,18 @@ function createObjectClient(grip: Grip) 
 function releaseActor(actor: String) {
   if (!actor) {
     return;
   }
 
   return debuggerClient.release(actor);
 }
 
-function sendPacket(packet: Object, callback?: Function = r => r) {
-  return debuggerClient.request(packet).then(callback);
+function sendPacket(packet: Object) {
+  return debuggerClient.request(packet)
 }
 
 function lookupThreadClient(thread: string) {
   if (thread == threadClient.actor) {
     return threadClient;
   }
   if (!workerClients[thread]) {
     throw new Error(`Unknown thread client: ${thread}`);
--- a/devtools/client/debugger/new/src/utils/dbg.js
+++ b/devtools/client/debugger/new/src/utils/dbg.js
@@ -13,30 +13,29 @@ function findSource(dbg: any, url: strin
   return sources.find(s => (s.url || "").includes(url));
 }
 
 function findSources(dbg: any, url: string) {
   const sources = dbg.selectors.getSourceList();
   return sources.filter(s => (s.url || "").includes(url));
 }
 
-function sendPacket(dbg: any, packet: any, callback: () => void) {
-  dbg.client.sendPacket(packet, callback || console.log);
+function sendPacket(dbg: any, packet: any) {
+  return dbg.client.sendPacket(packet);
 }
 
-function sendPacketToThread(dbg: Object, packet: any, callback: Function = () => {}) {
-  sendPacket(
+function sendPacketToThread(dbg: Object, packet: any) {
+  return sendPacket(
     dbg,
-    { to: dbg.connection.tabConnection.threadClient.actor, ...packet },
-    callback
+    { to: dbg.connection.tabConnection.threadClient.actor, ...packet }
   );
 }
 
-function evaluate(dbg: Object, expression: any, callback: () => void) {
-  dbg.client.evaluate(expression).then(callback || console.log);
+function evaluate(dbg: Object, expression: any) {
+  return dbg.client.evaluate(expression)
 }
 
 function bindSelectors(obj: Object): Object {
   return Object.keys(obj.selectors).reduce((bound, selector) => {
     bound[selector] = (a, b, c) =>
       obj.selectors[selector](obj.store.getState(), a, b, c);
     return bound;
   }, {});
--- a/devtools/server/actors/thread.js
+++ b/devtools/server/actors/thread.js
@@ -1756,16 +1756,17 @@ const ThreadActor = ActorClassWithSpec(t
     return true;
   },
 
   onDump: function() {
     return {
       pauseOnExceptions: this._options.pauseOnExceptions,
       ignoreCaughtExceptions: this._options.ignoreCaughtExceptions,
       skipBreakpoints: this.skipBreakpoints,
+      breakpoints: this.breakpointActorMap.listKeys(),
     };
   },
 });
 
 Object.assign(ThreadActor.prototype.requestTypes, {
   "attach": ThreadActor.prototype.onAttach,
   "detach": ThreadActor.prototype.onDetach,
   "reconfigure": ThreadActor.prototype.onReconfigure,
--- a/devtools/server/actors/utils/breakpoint-actor-map.js
+++ b/devtools/server/actors/utils/breakpoint-actor-map.js
@@ -26,16 +26,20 @@ BreakpointActorMap.prototype = {
 
   /**
    * Return all BreakpointActors in this BreakpointActorMap.
    */
   findActors() {
     return Object.values(this._actors);
   },
 
+  listKeys() {
+    return Object.keys(this._actors);
+  },
+
   /**
    * Return the BreakpointActor at the given location in this
    * BreakpointActorMap.
    *
    * @param BreakpointLocation location
    *        The location for which the BreakpointActor should be returned.
    *
    * @returns BreakpointActor actor