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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/DebuggerModel.js
diff --git a/Source/devtools/front_end/sdk/DebuggerModel.js b/Source/devtools/front_end/sdk/DebuggerModel.js
index 6abb699ab815557f997f7b26d090b012df0cf809..63a786892eb1339c2e78e7a336dfd21d1d4b719c 100644
--- a/Source/devtools/front_end/sdk/DebuggerModel.js
+++ b/Source/devtools/front_end/sdk/DebuggerModel.js
@@ -63,6 +63,9 @@ WebInspector.DebuggerModel = function(target)
this._applySkipStackFrameSettings();
}
+/** @typedef {{location: ?WebInspector.DebuggerModel.Location, functionName: string, scopeChain: (Array.<!DebuggerAgent.Scope>|null)}} */
+WebInspector.DebuggerModel.FunctionDetails;
+
/**
* Keep these in sync with WebCore::ScriptDebugServer
*
@@ -682,7 +685,7 @@ WebInspector.DebuggerModel.prototype = {
},
/**
- * @param {!WebInspector.DebuggerModel.Location|!DebuggerAgent.Location} rawLocation
+ * @param {!WebInspector.DebuggerModel.Location} rawLocation
* @return {?WebInspector.UILocation}
*/
rawLocationToUILocation: function(rawLocation)
@@ -717,15 +720,16 @@ WebInspector.DebuggerModel.prototype = {
/**
* @param {!WebInspector.RemoteObject} remoteObject
- * @param {function(?DebuggerAgent.FunctionDetails)} callback
+ * @param {function(?WebInspector.DebuggerModel.FunctionDetails)} callback
*/
functionDetails: function(remoteObject, callback)
{
- this._agent.getFunctionDetails(remoteObject.objectId, didGetDetails);
+ this._agent.getFunctionDetails(remoteObject.objectId, didGetDetails.bind(this));
/**
* @param {?Protocol.Error} error
* @param {!DebuggerAgent.FunctionDetails} response
+ * @this {WebInspector.DebuggerModel}
*/
function didGetDetails(error, response)
{
@@ -734,7 +738,10 @@ WebInspector.DebuggerModel.prototype = {
callback(null);
return;
}
- callback(response);
+ var location = response.location;
+ var script = this.scriptForId(location.scriptId);
+ var rawLocation = script ? this.createRawLocation(script, location.lineNumber + 1, location.columnNumber + 1) : null;
+ callback({location: rawLocation, functionName: response.functionName, scopeChain: response.scopeChain || null});
}
},
« 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