Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @param {!RuntimeAgent.CallFrame} callFrame | |
| 7 */ | 8 */ |
| 8 WebInspector.ProfileNode = function(functionName, scriptId, url, lineNumber, col umnNumber) | 9 WebInspector.ProfileNode = function(callFrame) |
| 9 { | 10 { |
| 10 /** @type {!RuntimeAgent.CallFrame} */ | 11 /** @type {!RuntimeAgent.CallFrame} */ |
| 11 this.frame = { | 12 this.frame = { |
|
alph
2016/07/14 17:56:00
The plan was to have this.frame = callFrame;
kozy
2016/07/14 21:35:04
Done.
| |
| 12 functionName: functionName, | 13 functionName: callFrame.functionName, |
| 13 scriptId: scriptId, | 14 scriptId: callFrame.scriptId, |
| 14 url: url, | 15 url: callFrame.url, |
| 15 lineNumber: lineNumber, | 16 lineNumber: callFrame.lineNumber + 1, |
|
dgozman
2016/07/14 15:58:28
Are you going to migrate frontend code in the next
kozy
2016/07/14 21:35:04
It was first plan, added migration right here.
| |
| 16 columnNumber: columnNumber | 17 columnNumber: callFrame.columnNumber + 1 |
| 17 }; | 18 }; |
| 18 /** @type {number|string} */ | 19 /** @type {number|string} */ |
| 19 this.callUID; | 20 this.callUID; |
| 20 /** @type {number} */ | 21 /** @type {number} */ |
| 21 this.self = 0; | 22 this.self = 0; |
| 22 /** @type {number} */ | 23 /** @type {number} */ |
| 23 this.total = 0; | 24 this.total = 0; |
| 24 /** @type {number} */ | 25 /** @type {number} */ |
| 25 this.id = 0; | 26 this.id = 0; |
| 26 /** @type {?WebInspector.ProfileNode} */ | 27 /** @type {?WebInspector.ProfileNode} */ |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 /** | 111 /** |
| 111 * @param {!WebInspector.ProfileNode} node | 112 * @param {!WebInspector.ProfileNode} node |
| 112 * @return {number} | 113 * @return {number} |
| 113 */ | 114 */ |
| 114 _calculateTotals: function(node) | 115 _calculateTotals: function(node) |
| 115 { | 116 { |
| 116 node.total = node.children.reduce((acc, child) => acc + this._calculateT otals(child), node.self); | 117 node.total = node.children.reduce((acc, child) => acc + this._calculateT otals(child), node.self); |
| 117 return node.total; | 118 return node.total; |
| 118 } | 119 } |
| 119 } | 120 } |
| OLD | NEW |