Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(503)

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js

Issue 2881893002: [DevTools] Support async step in from arbitrary position (Closed)
Patch Set: addressed comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
index ab8d20586dc8a300baa471c2ad6c6f37206c8f6a..1d32c3045f4ad361f0848c5bade99bffcab54621 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
@@ -465,6 +465,14 @@ SDK.DebuggerModel = class extends SDK.SDKModel {
_pausedScript(callFrames, reason, auxData, breakpointIds, asyncStackTrace) {
var pausedDetails =
new SDK.DebuggerPausedDetails(this, callFrames, reason, auxData, breakpointIds, asyncStackTrace);
+
+ if (pausedDetails && this._continueToLocationCallback) {
+ var callback = this._continueToLocationCallback;
+ delete this._continueToLocationCallback;
+ if (callback(pausedDetails))
+ return;
+ }
+
if (!this._setDebuggerPausedDetails(pausedDetails))
this._agent.stepInto();
}
@@ -1062,10 +1070,30 @@ SDK.DebuggerModel.Location = class {
return this.debuggerModel.scriptForId(this.scriptId);
}
- continueToLocation() {
+ /**
+ * @param {function()=} pausedCallback
+ */
+ continueToLocation(pausedCallback) {
+ if (pausedCallback)
+ this.debuggerModel._continueToLocationCallback = this._paused.bind(this, pausedCallback);
this.debuggerModel._agent.continueToLocation(this.payload());
}
+ /**
+ * @param {function()|undefined} pausedCallback
+ * @param {!SDK.DebuggerPausedDetails} debuggerPausedDetails
+ * @return {boolean}
+ */
+ _paused(pausedCallback, debuggerPausedDetails) {
+ var location = debuggerPausedDetails.callFrames[0].location();
+ if (location.scriptId === this.scriptId && location.lineNumber === this.lineNumber &&
+ location.columnNumber === this.columnNumber) {
+ pausedCallback();
+ return true;
+ }
+ return false;
+ }
+
/**
* @return {string}
*/
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698