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

Side by Side Diff: Source/devtools/front_end/Script.js

Issue 98953004: DevTools: Introduce Debugger.StackTrace structure in protocol.json (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/DebuggerModel.js ('k') | Source/devtools/protocol.json » ('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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 if (this.scriptId) { 132 if (this.scriptId) {
133 // Script failed to parse. 133 // Script failed to parse.
134 DebuggerAgent.searchInContent(this.scriptId, query, caseSensitive, i sRegex, innerCallback.bind(this)); 134 DebuggerAgent.searchInContent(this.scriptId, query, caseSensitive, i sRegex, innerCallback.bind(this));
135 } else 135 } else
136 callback([]); 136 callback([]);
137 }, 137 },
138 138
139 /** 139 /**
140 * @param {string} newSource 140 * @param {string} newSource
141 * @param {function(?Protocol.Error, DebuggerAgent.SetScriptSourceError=, !A rray.<DebuggerAgent.CallFrame>=, boolean=)} callback 141 * @param {function(?Protocol.Error, DebuggerAgent.SetScriptSourceError=, !A rray.<DebuggerAgent.CallFrame>=, DebuggerAgent.StackTrace=, boolean=)} callback
142 */ 142 */
143 editSource: function(newSource, callback) 143 editSource: function(newSource, callback)
144 { 144 {
145 /** 145 /**
146 * @this {WebInspector.Script} 146 * @this {WebInspector.Script}
147 * @param {?Protocol.Error} error 147 * @param {?Protocol.Error} error
148 * @param {DebuggerAgent.SetScriptSourceError=} errorData 148 * @param {DebuggerAgent.SetScriptSourceError=} errorData
149 * @param {!Array.<DebuggerAgent.CallFrame>=} callFrames 149 * @param {!Array.<DebuggerAgent.CallFrame>=} callFrames
150 * @param {Object=} debugData 150 * @param {Object=} debugData
151 * @param {DebuggerAgent.StackTrace=} asyncStackTrace
151 */ 152 */
152 function didEditScriptSource(error, errorData, callFrames, debugData) 153 function didEditScriptSource(error, errorData, callFrames, debugData, as yncStackTrace)
153 { 154 {
154 // FIXME: support debugData.stack_update_needs_step_in flag by calli ng WebInspector.debugger_model.callStackModified 155 // FIXME: support debugData.stack_update_needs_step_in flag by calli ng WebInspector.debugger_model.callStackModified
155 if (!error) 156 if (!error)
156 this._source = newSource; 157 this._source = newSource;
157 var needsStepIn = !!debugData && debugData["stack_update_needs_step_ in"] === true; 158 var needsStepIn = !!debugData && debugData["stack_update_needs_step_ in"] === true;
158 callback(error, errorData, callFrames, needsStepIn); 159 callback(error, errorData, callFrames, asyncStackTrace, needsStepIn) ;
159 if (!error) 160 if (!error)
160 this.dispatchEventToListeners(WebInspector.Script.Events.ScriptE dited, newSource); 161 this.dispatchEventToListeners(WebInspector.Script.Events.ScriptE dited, newSource);
161 } 162 }
162 if (this.scriptId) { 163
163 // Script failed to parse. 164 if (this.scriptId)
164 DebuggerAgent.setScriptSource(this.scriptId, newSource, undefined, d idEditScriptSource.bind(this)); 165 DebuggerAgent.setScriptSource(this.scriptId, newSource, undefined, d idEditScriptSource.bind(this));
165 } else 166 else
166 callback("Script failed to parse"); 167 callback("Script failed to parse");
167 }, 168 },
168 169
169 /** 170 /**
170 * @return {boolean} 171 * @return {boolean}
171 */ 172 */
172 isInlineScript: function() 173 isInlineScript: function()
173 { 174 {
174 var startsAtZero = !this.lineOffset && !this.columnOffset; 175 var startsAtZero = !this.lineOffset && !this.columnOffset;
175 return !!this.sourceURL && !startsAtZero; 176 return !!this.sourceURL && !startsAtZero;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 }, 264 },
264 265
265 dispose: function() 266 dispose: function()
266 { 267 {
267 WebInspector.LiveLocation.prototype.dispose.call(this); 268 WebInspector.LiveLocation.prototype.dispose.call(this);
268 this._script._locations.remove(this); 269 this._script._locations.remove(this);
269 }, 270 },
270 271
271 __proto__: WebInspector.LiveLocation.prototype 272 __proto__: WebInspector.LiveLocation.prototype
272 } 273 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/DebuggerModel.js ('k') | Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698