Chromium Code Reviews| 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); |