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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/CPUProfileDataModel.js

Issue 2150803002: [DevTools] Add callFrame to CPUProfileNode & SamplingHeapProfileNode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 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
Index: third_party/WebKit/Source/devtools/front_end/sdk/CPUProfileDataModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfileDataModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfileDataModel.js
index 81d89040f4f657acb21fb9a0b42c746a0a3a58c7..ecaa5c7f09abb9cd81f019327adf0ec1f45f2d77 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfileDataModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/CPUProfileDataModel.js
@@ -10,7 +10,13 @@
*/
WebInspector.CPUProfileNode = function(sourceNode, sampleTime)
{
- WebInspector.ProfileNode.call(this, sourceNode.functionName, sourceNode.scriptId, sourceNode.url, sourceNode.lineNumber, sourceNode.columnNumber);
+ if (sourceNode.callFrame) {
+ WebInspector.ProfileNode.call(this, sourceNode.callFrame);
+ } else {
+ // Backward compatibility for old CPUProfileNode format.
+ var frame = /** @type {!RuntimeAgent.CallFrame} */(sourceNode);
+ WebInspector.ProfileNode.call(this, { functionName: frame.functionName, scriptId: frame.scriptId, url: frame.url, lineNumber: frame.lineNumber - 1, columnNumber: frame.columnNumber - 1});
alph 2016/07/14 21:53:29 ditto
kozy 2016/07/15 00:19:02 Done.
+ }
this.id = sourceNode.id;
this.self = sourceNode.hitCount * sampleTime;
this.callUID = sourceNode.callUID;
@@ -66,6 +72,8 @@ WebInspector.CPUProfileDataModel.prototype = {
*/
function isNativeNode(node)
{
+ if (node.callFrame)
+ return !!node.callFrame.url && node.callFrame.url.startsWith("native ");
return !!node.url && node.url.startsWith("native ");
}
this.totalHitCount = computeHitCountForSubtree(root);

Powered by Google App Engine
This is Rietveld 408576698