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

Side by Side Diff: Source/devtools/front_end/sdk/DebuggerModel.js

Issue 402873002: DevTools: Build function details' raw location in DebuggerModel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Comment addressed Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/front_end/sdk/RemoteObject.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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 WebInspector.settings.enableAsyncStackTraces.addChangeListener(this._asyncSt ackTracesStateChanged, this); 57 WebInspector.settings.enableAsyncStackTraces.addChangeListener(this._asyncSt ackTracesStateChanged, this);
58 target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged, this._profilingStateChanged, this); 58 target.profilingLock.addEventListener(WebInspector.Lock.Events.StateChanged, this._profilingStateChanged, this);
59 59
60 this.enableDebugger(); 60 this.enableDebugger();
61 61
62 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._applySk ipStackFrameSettings, this); 62 WebInspector.settings.skipStackFramesPattern.addChangeListener(this._applySk ipStackFrameSettings, this);
63 this._applySkipStackFrameSettings(); 63 this._applySkipStackFrameSettings();
64 } 64 }
65 65
66 /** @typedef {{location: ?WebInspector.DebuggerModel.Location, functionName: str ing, scopeChain: (Array.<!DebuggerAgent.Scope>|null)}} */
67 WebInspector.DebuggerModel.FunctionDetails;
68
66 /** 69 /**
67 * Keep these in sync with WebCore::ScriptDebugServer 70 * Keep these in sync with WebCore::ScriptDebugServer
68 * 71 *
69 * @enum {string} 72 * @enum {string}
70 */ 73 */
71 WebInspector.DebuggerModel.PauseOnExceptionsState = { 74 WebInspector.DebuggerModel.PauseOnExceptionsState = {
72 DontPauseOnExceptions : "none", 75 DontPauseOnExceptions : "none",
73 PauseOnAllExceptions : "all", 76 PauseOnAllExceptions : "all",
74 PauseOnUncaughtExceptions: "uncaught" 77 PauseOnUncaughtExceptions: "uncaught"
75 }; 78 };
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
675 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDel egate 678 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDel egate
676 * @return {!WebInspector.Script.Location} 679 * @return {!WebInspector.Script.Location}
677 */ 680 */
678 createLiveLocation: function(rawLocation, updateDelegate) 681 createLiveLocation: function(rawLocation, updateDelegate)
679 { 682 {
680 var script = this._scripts[rawLocation.scriptId]; 683 var script = this._scripts[rawLocation.scriptId];
681 return script.createLiveLocation(rawLocation, updateDelegate); 684 return script.createLiveLocation(rawLocation, updateDelegate);
682 }, 685 },
683 686
684 /** 687 /**
685 * @param {!WebInspector.DebuggerModel.Location|!DebuggerAgent.Location} raw Location 688 * @param {!WebInspector.DebuggerModel.Location} rawLocation
686 * @return {?WebInspector.UILocation} 689 * @return {?WebInspector.UILocation}
687 */ 690 */
688 rawLocationToUILocation: function(rawLocation) 691 rawLocationToUILocation: function(rawLocation)
689 { 692 {
690 var script = this._scripts[rawLocation.scriptId]; 693 var script = this._scripts[rawLocation.scriptId];
691 if (!script) 694 if (!script)
692 return null; 695 return null;
693 return script.rawLocationToUILocation(rawLocation.lineNumber, rawLocatio n.columnNumber); 696 return script.rawLocationToUILocation(rawLocation.lineNumber, rawLocatio n.columnNumber);
694 }, 697 },
695 698
(...skipping 14 matching lines...) Expand all
710 713
711 _applySkipStackFrameSettings: function() 714 _applySkipStackFrameSettings: function()
712 { 715 {
713 if (!WebInspector.experimentsSettings.frameworksDebuggingSupport.isEnabl ed()) 716 if (!WebInspector.experimentsSettings.frameworksDebuggingSupport.isEnabl ed())
714 return; 717 return;
715 this._agent.skipStackFrames(WebInspector.settings.skipStackFramesPattern .get()); 718 this._agent.skipStackFrames(WebInspector.settings.skipStackFramesPattern .get());
716 }, 719 },
717 720
718 /** 721 /**
719 * @param {!WebInspector.RemoteObject} remoteObject 722 * @param {!WebInspector.RemoteObject} remoteObject
720 * @param {function(?DebuggerAgent.FunctionDetails)} callback 723 * @param {function(?WebInspector.DebuggerModel.FunctionDetails)} callback
721 */ 724 */
722 functionDetails: function(remoteObject, callback) 725 functionDetails: function(remoteObject, callback)
723 { 726 {
724 this._agent.getFunctionDetails(remoteObject.objectId, didGetDetails); 727 this._agent.getFunctionDetails(remoteObject.objectId, didGetDetails.bind (this));
725 728
726 /** 729 /**
727 * @param {?Protocol.Error} error 730 * @param {?Protocol.Error} error
728 * @param {!DebuggerAgent.FunctionDetails} response 731 * @param {!DebuggerAgent.FunctionDetails} response
732 * @this {WebInspector.DebuggerModel}
729 */ 733 */
730 function didGetDetails(error, response) 734 function didGetDetails(error, response)
731 { 735 {
732 if (error) { 736 if (error) {
733 console.error(error); 737 console.error(error);
734 callback(null); 738 callback(null);
735 return; 739 return;
736 } 740 }
737 callback(response); 741 var location = response.location;
742 var script = this.scriptForId(location.scriptId);
743 var rawLocation = script ? this.createRawLocation(script, location.l ineNumber + 1, location.columnNumber + 1) : null;
744 callback({location: rawLocation, functionName: response.functionName , scopeChain: response.scopeChain || null});
738 } 745 }
739 }, 746 },
740 747
741 /** 748 /**
742 * @param {!DebuggerAgent.BreakpointId} breakpointId 749 * @param {!DebuggerAgent.BreakpointId} breakpointId
743 * @param {function(!WebInspector.Event)} listener 750 * @param {function(!WebInspector.Event)} listener
744 * @param {!Object=} thisObject 751 * @param {!Object=} thisObject
745 */ 752 */
746 addBreakpointListener: function(breakpointId, listener, thisObject) 753 addBreakpointListener: function(breakpointId, listener, thisObject)
747 { 754 {
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 this.asyncStackTrace.dispose(); 1203 this.asyncStackTrace.dispose();
1197 }, 1204 },
1198 1205
1199 __proto__: WebInspector.SDKObject.prototype 1206 __proto__: WebInspector.SDKObject.prototype
1200 } 1207 }
1201 1208
1202 /** 1209 /**
1203 * @type {!WebInspector.DebuggerModel} 1210 * @type {!WebInspector.DebuggerModel}
1204 */ 1211 */
1205 WebInspector.debuggerModel; 1212 WebInspector.debuggerModel;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/main/Main.js ('k') | Source/devtools/front_end/sdk/RemoteObject.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698