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 */ | 7 */ |
8 WebInspector.ProfileNode = function(functionName, scriptId, url, lineNumber, col
umnNumber) | 8 WebInspector.ProfileNode = function(functionName, scriptId, url, lineNumber, col
umnNumber) |
9 { | 9 { |
10 /** @type {!RuntimeAgent.CallFrame} */ | 10 /** @type {!RuntimeAgent.CallFrame} */ |
11 this.frame = { | 11 this.frame = { |
12 functionName: functionName, | 12 functionName: functionName, |
13 scriptId: scriptId, | 13 scriptId: scriptId, |
14 url: url, | 14 url: url, |
15 lineNumber: lineNumber, | 15 lineNumber: lineNumber, |
16 columnNumber: columnNumber | 16 columnNumber: columnNumber |
17 }; | 17 }; |
18 /** @type {number|string} */ | 18 /** @type {string} */ |
19 this.callUID; | 19 this.callUID = `${this.frame.functionName}@${this.frame.scriptId}:${this.fra
me.lineNumber}`; |
20 /** @type {number} */ | 20 /** @type {number} */ |
21 this.self = 0; | 21 this.self = 0; |
22 /** @type {number} */ | 22 /** @type {number} */ |
23 this.total = 0; | 23 this.total = 0; |
24 /** @type {number} */ | 24 /** @type {number} */ |
25 this.id = 0; | 25 this.id = 0; |
26 /** @type {?WebInspector.ProfileNode} */ | 26 /** @type {?WebInspector.ProfileNode} */ |
27 this.parent = null; | 27 this.parent = null; |
28 /** @type {!Array<!WebInspector.ProfileNode>} */ | 28 /** @type {!Array<!WebInspector.ProfileNode>} */ |
29 this.children = []; | 29 this.children = []; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 /** | 110 /** |
111 * @param {!WebInspector.ProfileNode} node | 111 * @param {!WebInspector.ProfileNode} node |
112 * @return {number} | 112 * @return {number} |
113 */ | 113 */ |
114 _calculateTotals: function(node) | 114 _calculateTotals: function(node) |
115 { | 115 { |
116 node.total = node.children.reduce((acc, child) => acc + this._calculateT
otals(child), node.self); | 116 node.total = node.children.reduce((acc, child) => acc + this._calculateT
otals(child), node.self); |
117 return node.total; | 117 return node.total; |
118 } | 118 } |
119 } | 119 } |
OLD | NEW |