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

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 641dbf639ec33bcf6adb849d5593d07e3874a816..8493864746ade9ba25afc65bb0d26ac81ad4059b 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,18 @@
*/
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
+ });
+ }
this.id = sourceNode.id;
this.self = sourceNode.hitCount * sampleTime;
this.positionTicks = sourceNode.positionTicks;
@@ -65,6 +76,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