Bug 821610 - Provide methods to set and remove XHR breakpoints within thread client r=loganfsmyth
authorDavid Walsh <dwalsh@mozilla.com>
Fri, 12 Oct 2018 13:00:35 -0500
changeset 489577 ffb770ed38711114be60f6c2f8f95971b3c6589f
parent 489576 6b57b7631a5d62bd2fc4cf267f7224f0dac8de58
child 489578 ffb2909f660d4ea2f9961e5d1d4964a2c98e51a3
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersloganfsmyth
bugs821610
milestone64.0a1
Bug 821610 - Provide methods to set and remove XHR breakpoints within thread client r=loganfsmyth
devtools/shared/client/thread-client.js
--- a/devtools/shared/client/thread-client.js
+++ b/devtools/shared/client/thread-client.js
@@ -694,16 +694,40 @@ ThreadClient.prototype = {
     this.client._eventsEnabled && this.emit(packet.type, packet);
   },
 
   getLastPausePacket: function() {
     return this._lastPausePacket;
   },
 
   /**
+   * Requests to set XHR breakpoint
+   * @param string path
+   *        pause when url contains `path`
+   * @param string method
+   *        pause when method of request is `method`
+   */
+  setXHRBreakpoint: DebuggerClient.requester({
+    type: "setXHRBreakpoint",
+    path: arg(0),
+    method: arg(1)
+  }),
+
+  /**
+   * Request to remove XHR breakpoint
+   * @param string path
+   * @param string method
+   */
+  removeXHRBreakpoint: DebuggerClient.requester({
+    type: "removeXHRBreakpoint",
+    path: arg(0),
+    method: arg(1)
+  }),
+
+  /**
    * Return an EnvironmentClient instance for the given environment actor form.
    */
   environment: function(form) {
     return new EnvironmentClient(this.client, form);
   },
 
   /**
    * Return an instance of SourceClient for the given source actor form.