OLD | NEW |
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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 }, | 192 }, |
193 | 193 |
194 /** | 194 /** |
195 * @param {!WebInspector.DebuggerModel.Location} rawLocation | 195 * @param {!WebInspector.DebuggerModel.Location} rawLocation |
196 */ | 196 */ |
197 continueToLocation: function(rawLocation) | 197 continueToLocation: function(rawLocation) |
198 { | 198 { |
199 this._agent.continueToLocation(rawLocation); | 199 this._agent.continueToLocation(rawLocation); |
200 }, | 200 }, |
201 | 201 |
202 /** | |
203 * @param {!WebInspector.DebuggerModel.Location} rawLocation | |
204 */ | |
205 stepIntoSelection: function(rawLocation) | |
206 { | |
207 /** | |
208 * @param {!WebInspector.DebuggerModel.Location} requestedLocation | |
209 * @param {?string} error | |
210 * @this {WebInspector.DebuggerModel} | |
211 */ | |
212 function callback(requestedLocation, error) | |
213 { | |
214 if (error) | |
215 return; | |
216 this._pendingStepIntoLocation = requestedLocation; | |
217 }; | |
218 this._agent.continueToLocation(rawLocation, true, callback.bind(this, ra
wLocation)); | |
219 }, | |
220 | |
221 stepInto: function() | 202 stepInto: function() |
222 { | 203 { |
223 /** | 204 /** |
224 * @this {WebInspector.DebuggerModel} | 205 * @this {WebInspector.DebuggerModel} |
225 */ | 206 */ |
226 function callback() | 207 function callback() |
227 { | 208 { |
228 this._agent.stepInto(); | 209 this._agent.stepInto(); |
229 } | 210 } |
230 this._agent.setOverlayMessage(undefined, callback.bind(this)); | 211 this._agent.setOverlayMessage(undefined, callback.bind(this)); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 | 456 |
476 /** | 457 /** |
477 * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames | 458 * @param {!Array.<!DebuggerAgent.CallFrame>} callFrames |
478 * @param {string} reason | 459 * @param {string} reason |
479 * @param {!Object|undefined} auxData | 460 * @param {!Object|undefined} auxData |
480 * @param {!Array.<string>} breakpointIds | 461 * @param {!Array.<string>} breakpointIds |
481 * @param {!DebuggerAgent.StackTrace=} asyncStackTrace | 462 * @param {!DebuggerAgent.StackTrace=} asyncStackTrace |
482 */ | 463 */ |
483 _pausedScript: function(callFrames, reason, auxData, breakpointIds, asyncSta
ckTrace) | 464 _pausedScript: function(callFrames, reason, auxData, breakpointIds, asyncSta
ckTrace) |
484 { | 465 { |
485 if (this._pendingStepIntoLocation) { | |
486 var requestedLocation = this._pendingStepIntoLocation; | |
487 delete this._pendingStepIntoLocation; | |
488 | |
489 if (callFrames.length > 0) { | |
490 var topLocation = callFrames[0].location; | |
491 if (topLocation.lineNumber == requestedLocation.lineNumber && to
pLocation.columnNumber == requestedLocation.columnNumber && topLocation.scriptId
== requestedLocation.scriptId) { | |
492 this.stepInto(); | |
493 return; | |
494 } | |
495 } | |
496 } | |
497 | |
498 this._setDebuggerPausedDetails(new WebInspector.DebuggerPausedDetails(th
is, callFrames, reason, auxData, breakpointIds, asyncStackTrace)); | 466 this._setDebuggerPausedDetails(new WebInspector.DebuggerPausedDetails(th
is, callFrames, reason, auxData, breakpointIds, asyncStackTrace)); |
499 }, | 467 }, |
500 | 468 |
501 _resumedScript: function() | 469 _resumedScript: function() |
502 { | 470 { |
503 this._setDebuggerPausedDetails(null); | 471 this._setDebuggerPausedDetails(null); |
504 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debugger
Resumed); | 472 this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.Debugger
Resumed); |
505 }, | 473 }, |
506 | 474 |
507 /** | 475 /** |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
972 { | 940 { |
973 if (!error) | 941 if (!error) |
974 this._debuggerModel.callStackModified(callFrames, details, async
StackTrace); | 942 this._debuggerModel.callStackModified(callFrames, details, async
StackTrace); |
975 if (callback) | 943 if (callback) |
976 callback(error); | 944 callback(error); |
977 } | 945 } |
978 this._debuggerAgent.restartFrame(this._payload.callFrameId, protocolCall
back.bind(this)); | 946 this._debuggerAgent.restartFrame(this._payload.callFrameId, protocolCall
back.bind(this)); |
979 }, | 947 }, |
980 | 948 |
981 /** | 949 /** |
982 * @param {function(!Array.<!DebuggerAgent.Location>)} callback | |
983 */ | |
984 getStepIntoLocations: function(callback) | |
985 { | |
986 if (this._stepInLocations) { | |
987 callback(this._stepInLocations.slice(0)); | |
988 return; | |
989 } | |
990 /** | |
991 * @param {?string} error | |
992 * @param {!Array.<!DebuggerAgent.Location>=} stepInPositions | |
993 * @this {WebInspector.DebuggerModel.CallFrame} | |
994 */ | |
995 function getStepInPositionsCallback(error, stepInPositions) | |
996 { | |
997 if (error) | |
998 return; | |
999 this._stepInLocations = stepInPositions; | |
1000 callback(this._stepInLocations.slice(0)); | |
1001 } | |
1002 this._debuggerAgent.getStepInPositions(this.id, getStepInPositionsCallba
ck.bind(this)); | |
1003 }, | |
1004 | |
1005 /** | |
1006 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDel
egate | 950 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDel
egate |
1007 * @return {!WebInspector.LiveLocation} | 951 * @return {!WebInspector.LiveLocation} |
1008 */ | 952 */ |
1009 createLiveLocation: function(updateDelegate) | 953 createLiveLocation: function(updateDelegate) |
1010 { | 954 { |
1011 var location = this._script.createLiveLocation(this.location, updateDele
gate); | 955 var location = this._script.createLiveLocation(this.location, updateDele
gate); |
1012 this._locations.push(location); | 956 this._locations.push(location); |
1013 return location; | 957 return location; |
1014 }, | 958 }, |
1015 | 959 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 this.callFrames[i].dispose(); | 1030 this.callFrames[i].dispose(); |
1087 if (this.asyncStackTrace) | 1031 if (this.asyncStackTrace) |
1088 this.asyncStackTrace.dispose(); | 1032 this.asyncStackTrace.dispose(); |
1089 } | 1033 } |
1090 } | 1034 } |
1091 | 1035 |
1092 /** | 1036 /** |
1093 * @type {!WebInspector.DebuggerModel} | 1037 * @type {!WebInspector.DebuggerModel} |
1094 */ | 1038 */ |
1095 WebInspector.debuggerModel; | 1039 WebInspector.debuggerModel; |
OLD | NEW |