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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 /** 458 /**
459 * @param {!Array.<!Protocol.Debugger.CallFrame>} callFrames 459 * @param {!Array.<!Protocol.Debugger.CallFrame>} callFrames
460 * @param {string} reason 460 * @param {string} reason
461 * @param {!Object|undefined} auxData 461 * @param {!Object|undefined} auxData
462 * @param {!Array.<string>} breakpointIds 462 * @param {!Array.<string>} breakpointIds
463 * @param {!Protocol.Runtime.StackTrace=} asyncStackTrace 463 * @param {!Protocol.Runtime.StackTrace=} asyncStackTrace
464 */ 464 */
465 _pausedScript(callFrames, reason, auxData, breakpointIds, asyncStackTrace) { 465 _pausedScript(callFrames, reason, auxData, breakpointIds, asyncStackTrace) {
466 var pausedDetails = 466 var pausedDetails =
467 new SDK.DebuggerPausedDetails(this, callFrames, reason, auxData, breakpo intIds, asyncStackTrace); 467 new SDK.DebuggerPausedDetails(this, callFrames, reason, auxData, breakpo intIds, asyncStackTrace);
468
469 if (pausedDetails && this._continueToLocationCallback) {
470 var callback = this._continueToLocationCallback;
471 delete this._continueToLocationCallback;
472 if (callback(pausedDetails))
473 return;
474 }
475
468 if (!this._setDebuggerPausedDetails(pausedDetails)) 476 if (!this._setDebuggerPausedDetails(pausedDetails))
469 this._agent.stepInto(); 477 this._agent.stepInto();
470 } 478 }
471 479
472 _resumedScript() { 480 _resumedScript() {
473 this._setDebuggerPausedDetails(null); 481 this._setDebuggerPausedDetails(null);
474 this.dispatchEventToListeners(SDK.DebuggerModel.Events.DebuggerResumed, this ); 482 this.dispatchEventToListeners(SDK.DebuggerModel.Events.DebuggerResumed, this );
475 } 483 }
476 484
477 /** 485 /**
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 return {scriptId: this.scriptId, lineNumber: this.lineNumber, columnNumber: this.columnNumber}; 1063 return {scriptId: this.scriptId, lineNumber: this.lineNumber, columnNumber: this.columnNumber};
1056 } 1064 }
1057 1065
1058 /** 1066 /**
1059 * @return {?SDK.Script} 1067 * @return {?SDK.Script}
1060 */ 1068 */
1061 script() { 1069 script() {
1062 return this.debuggerModel.scriptForId(this.scriptId); 1070 return this.debuggerModel.scriptForId(this.scriptId);
1063 } 1071 }
1064 1072
1065 continueToLocation() { 1073 /**
1074 * @param {function()=} pausedCallback
1075 */
1076 continueToLocation(pausedCallback) {
1077 if (pausedCallback)
1078 this.debuggerModel._continueToLocationCallback = this._paused.bind(this, p ausedCallback);
1066 this.debuggerModel._agent.continueToLocation(this.payload()); 1079 this.debuggerModel._agent.continueToLocation(this.payload());
1067 } 1080 }
1068 1081
1069 /** 1082 /**
1083 * @param {function()|undefined} pausedCallback
1084 * @param {!SDK.DebuggerPausedDetails} debuggerPausedDetails
1085 * @return {boolean}
1086 */
1087 _paused(pausedCallback, debuggerPausedDetails) {
1088 var location = debuggerPausedDetails.callFrames[0].location();
1089 if (location.scriptId === this.scriptId && location.lineNumber === this.line Number &&
1090 location.columnNumber === this.columnNumber) {
1091 pausedCallback();
1092 return true;
1093 }
1094 return false;
1095 }
1096
1097 /**
1070 * @return {string} 1098 * @return {string}
1071 */ 1099 */
1072 id() { 1100 id() {
1073 return this.debuggerModel.target().id() + ':' + this.scriptId + ':' + this.l ineNumber + ':' + this.columnNumber; 1101 return this.debuggerModel.target().id() + ':' + this.scriptId + ':' + this.l ineNumber + ':' + this.columnNumber;
1074 } 1102 }
1075 }; 1103 };
1076 1104
1077 /** 1105 /**
1078 * @unrestricted 1106 * @unrestricted
1079 */ 1107 */
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 stack.callFrames.shift(); 1471 stack.callFrames.shift();
1444 if (previous && (!stack.callFrames.length && !stack.promiseCreationFrame)) 1472 if (previous && (!stack.callFrames.length && !stack.promiseCreationFrame))
1445 previous.parent = stack.parent; 1473 previous.parent = stack.parent;
1446 else 1474 else
1447 previous = stack; 1475 previous = stack;
1448 stack = stack.parent; 1476 stack = stack.parent;
1449 } 1477 }
1450 return asyncStackTrace; 1478 return asyncStackTrace;
1451 } 1479 }
1452 }; 1480 };
OLDNEW
« 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