Changeset 60886 in webkit
- Timestamp:
- Jun 9, 2010, 1:57:35 AM (14 years ago)
- Location:
- trunk/WebKit/chromium
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/chromium/ChangeLog
r60884 r60886 1 2010-06-09 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: update stack trace after script source editing 6 https://bugs.webkit.org/show_bug.cgi?id=40357 7 8 * src/js/DebuggerAgent.js: 9 (devtools.DebuggerAgent.prototype.editScriptSource.this.requestSeqToCallback_.cmd.getSequenceNumber): 10 (devtools.DebuggerAgent.prototype.editScriptSource.requestBacktrace): 11 (devtools.DebuggerAgent.prototype.editScriptSource.handleBacktraceResponse): 12 (devtools.DebuggerAgent.prototype.editScriptSource.reportDidCommitEditing): 13 (devtools.DebuggerAgent.prototype.editScriptSource): 14 (devtools.DebuggerAgent.prototype.requestBacktrace_): 15 (devtools.DebuggerAgent.prototype.handleDebuggerOutput_): 16 (devtools.DebuggerAgent.prototype.doHandleBacktraceResponse_): 17 (devtools.DebuggerAgent.prototype.updateCallFramesFromBacktraceResponse_): 18 * src/js/InspectorControllerImpl.js: 19 (.devtools.InspectorBackendImpl.prototype.editScriptSource): 20 1 21 2010-06-08 Tony Chang <tony@chromium.org> 2 22 -
trunk/WebKit/chromium/src/js/DebuggerAgent.js
r60771 r60886 308 308 309 309 /** 310 * Changes given line of the script. 310 * Changes given line of the script. 311 311 */ 312 312 devtools.DebuggerAgent.prototype.editScriptSource = function(sourceId, newContent, callback) … … 320 320 devtools.DebuggerAgent.sendCommand_(cmd); 321 321 this.requestSeqToCallback_[cmd.getSequenceNumber()] = function(msg) { 322 if (!msg.isSuccess()) 323 WebInspector.log("Unable to modify source code within given scope. Only function bodies are editable at the moment.", WebInspector.ConsoleMessage.MessageLevel.Warning); 324 this.resolveScriptSource(sourceId, callback); 322 if (!msg.isSuccess()) { 323 callback(false, "Unable to modify source code within given scope. Only function bodies are editable at the moment.", null); 324 return; 325 } 326 327 this.resolveScriptSource(sourceId, requestBacktrace.bind(this)); 328 }.bind(this); 329 330 331 function requestBacktrace(newScriptSource) { 325 332 if (WebInspector.panels.scripts.paused) 326 this.requestBacktrace_(); 327 }.bind(this); 333 this.requestBacktrace_(handleBacktraceResponse.bind(this, newScriptSource)); 334 else 335 reportDidCommitEditing(newScriptSource); 336 } 337 338 function handleBacktraceResponse(newScriptSource, msg) { 339 this.updateCallFramesFromBacktraceResponse_(msg); 340 reportDidCommitEditing(newScriptSource, this.callFrames_); 341 } 342 343 function reportDidCommitEditing(newScriptSource, callFrames) { 344 callback(true, newScriptSource, callFrames); 345 } 346 328 347 RemoteDebuggerAgent.processDebugCommands(); 329 348 }; … … 680 699 * Sends "backtrace" request to v8. 681 700 */ 682 devtools.DebuggerAgent.prototype.requestBacktrace_ = function( )701 devtools.DebuggerAgent.prototype.requestBacktrace_ = function(opt_customHandler) 683 702 { 684 703 var cmd = new devtools.DebugCommand("backtrace", { … … 686 705 }); 687 706 devtools.DebuggerAgent.sendCommand_(cmd); 707 var responseHandler = opt_customHandler ? opt_customHandler : this.handleBacktraceResponse_.bind(this); 708 this.requestSeqToCallback_[cmd.getSequenceNumber()] = responseHandler; 688 709 }; 689 710 … … 801 822 this.handleClearBreakpointResponse_(msg); 802 823 else if (msg.getCommand() === "backtrace") 803 this. handleBacktraceResponse_(msg);824 this.invokeCallbackForResponse_(msg); 804 825 else if (msg.getCommand() === "lookup") 805 826 this.invokeCallbackForResponse_(msg); … … 992 1013 devtools.DebuggerAgent.prototype.doHandleBacktraceResponse_ = function(msg) 993 1014 { 1015 this.updateCallFramesFromBacktraceResponse_(msg); 1016 WebInspector.pausedScript(this.callFrames_); 1017 this.showPendingExceptionMessage_(); 1018 InspectorFrontendHost.bringToFront(); 1019 }; 1020 1021 1022 devtools.DebuggerAgent.prototype.updateCallFramesFromBacktraceResponse_ = function(msg) 1023 { 994 1024 var frames = msg.getBody().frames; 995 1025 this.callFrames_ = []; 996 1026 for (var i = 0; i < frames.length; ++i) 997 1027 this.callFrames_.push(this.formatCallFrame_(frames[i])); 998 WebInspector.pausedScript(this.callFrames_); 999 this.showPendingExceptionMessage_(); 1000 InspectorFrontendHost.bringToFront(); 1028 return this.callFrames_; 1001 1029 }; 1002 1030 -
trunk/WebKit/chromium/src/js/InspectorControllerImpl.js
r60843 r60886 145 145 devtools.InspectorBackendImpl.prototype.editScriptSource = function(callID, sourceID, newContent) 146 146 { 147 devtools.tools.getDebuggerAgent().editScriptSource(sourceID, newContent, function( newFullBody) {148 WebInspector.didEditScriptSource(callID, newFullBody);147 devtools.tools.getDebuggerAgent().editScriptSource(sourceID, newContent, function(success, newBodyOrErrorMessage, callFrames) { 148 WebInspector.didEditScriptSource(callID, success, newBodyOrErrorMessage, callFrames); 149 149 }); 150 150 };
Note:
See TracChangeset
for help on using the changeset viewer.