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 * @implements {WebInspector.Searchable} | 7 * @implements {WebInspector.Searchable} |
| 8 * @extends {WebInspector.ProfileView} | 8 * @extends {WebInspector.ProfileView} |
| 9 * @param {!WebInspector.SamplingHeapProfileHeader} profileHeader | 9 * @param {!WebInspector.SamplingHeapProfileHeader} profileHeader |
| 10 */ | 10 */ |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 214 __proto__: WebInspector.WritableProfileHeader.prototype | 214 __proto__: WebInspector.WritableProfileHeader.prototype |
| 215 } | 215 } |
| 216 | 216 |
| 217 /** | 217 /** |
| 218 * @constructor | 218 * @constructor |
| 219 * @extends {WebInspector.ProfileNode} | 219 * @extends {WebInspector.ProfileNode} |
| 220 * @param {!HeapProfilerAgent.SamplingHeapProfileNode} node | 220 * @param {!HeapProfilerAgent.SamplingHeapProfileNode} node |
| 221 */ | 221 */ |
| 222 WebInspector.SamplingHeapProfileNode = function(node) | 222 WebInspector.SamplingHeapProfileNode = function(node) |
| 223 { | 223 { |
| 224 WebInspector.ProfileNode.call(this, node.functionName, node.scriptId, node.u rl, node.lineNumber, node.columnNumber); | 224 if (node.callFrame) { |
| 225 WebInspector.ProfileNode.call(this, node.callFrame); | |
| 226 } else { | |
| 227 // Backward compatibility for old SamplingHeapProfileNode format. | |
| 228 var frame = /** @type {!RuntimeAgent.CallFrame} */(node); | |
| 229 WebInspector.ProfileNode.call(this, { functionName: frame.functionName, scriptId: frame.scriptId, url: frame.url, lineNumber: frame.lineNumber - 1, colu mnNumber: frame.columnNumber - 1}); | |
|
alph
2016/07/14 21:53:28
could you please format it to have a field per lin
kozy
2016/07/15 00:19:02
Done.
| |
| 230 } | |
| 225 this.self = node.selfSize; | 231 this.self = node.selfSize; |
| 226 this.callUID = `${this.frame.functionName}@${this.frame.scriptId}:${this.fra me.lineNumber}`; | 232 this.callUID = `${this.callFrame.functionName}@${this.callFrame.scriptId}:${ this.callFrame.lineNumber}`; |
| 227 } | 233 } |
| 228 | 234 |
| 229 WebInspector.SamplingHeapProfileNode.prototype = { | 235 WebInspector.SamplingHeapProfileNode.prototype = { |
| 230 __proto__: WebInspector.ProfileNode.prototype | 236 __proto__: WebInspector.ProfileNode.prototype |
| 231 } | 237 } |
| 232 | 238 |
| 233 /** | 239 /** |
| 234 * @constructor | 240 * @constructor |
| 235 * @extends {WebInspector.ProfileTreeModel} | 241 * @extends {WebInspector.ProfileTreeModel} |
| 236 * @param {!HeapProfilerAgent.SamplingHeapProfile} profile | 242 * @param {!HeapProfilerAgent.SamplingHeapProfile} profile |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 return WebInspector.UIString("%.2f\u2009%%", value); | 301 return WebInspector.UIString("%.2f\u2009%%", value); |
| 296 }, | 302 }, |
| 297 | 303 |
| 298 /** | 304 /** |
| 299 * @override | 305 * @override |
| 300 * @param {!WebInspector.ProfileDataGridNode} node | 306 * @param {!WebInspector.ProfileDataGridNode} node |
| 301 * @return {!Element} | 307 * @return {!Element} |
| 302 */ | 308 */ |
| 303 linkifyNode: function(node) | 309 linkifyNode: function(node) |
| 304 { | 310 { |
| 305 return this._profileView.linkifier().linkifyConsoleCallFrameForTimeline( this._profileView.target(), node.profileNode.frame, "profile-node-file"); | 311 return this._profileView.linkifier().linkifyConsoleCallFrame(this._profi leView.target(), node.profileNode.callFrame, "profile-node-file"); |
| 306 } | 312 } |
| 307 } | 313 } |
| 308 | 314 |
| 309 /** | 315 /** |
| 310 * @constructor | 316 * @constructor |
| 311 * @extends {WebInspector.ProfileFlameChartDataProvider} | 317 * @extends {WebInspector.ProfileFlameChartDataProvider} |
| 312 * @param {!WebInspector.ProfileTreeModel} profile | 318 * @param {!WebInspector.ProfileTreeModel} profile |
| 313 * @param {?WebInspector.Target} target | 319 * @param {?WebInspector.Target} target |
| 314 */ | 320 */ |
| 315 WebInspector.HeapFlameChartDataProvider = function(profile, target) | 321 WebInspector.HeapFlameChartDataProvider = function(profile, target) |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 415 * @param {string} value | 421 * @param {string} value |
| 416 */ | 422 */ |
| 417 function pushEntryInfoRow(title, value) | 423 function pushEntryInfoRow(title, value) |
| 418 { | 424 { |
| 419 entryInfo.push({ title: title, value: value }); | 425 entryInfo.push({ title: title, value: value }); |
| 420 } | 426 } |
| 421 pushEntryInfoRow(WebInspector.UIString("Name"), WebInspector.beautifyFun ctionName(node.functionName)); | 427 pushEntryInfoRow(WebInspector.UIString("Name"), WebInspector.beautifyFun ctionName(node.functionName)); |
| 422 pushEntryInfoRow(WebInspector.UIString("Self size"), Number.bytesToStrin g(node.self)); | 428 pushEntryInfoRow(WebInspector.UIString("Self size"), Number.bytesToStrin g(node.self)); |
| 423 pushEntryInfoRow(WebInspector.UIString("Total size"), Number.bytesToStri ng(node.total)); | 429 pushEntryInfoRow(WebInspector.UIString("Total size"), Number.bytesToStri ng(node.total)); |
| 424 var linkifier = new WebInspector.Linkifier(); | 430 var linkifier = new WebInspector.Linkifier(); |
| 425 var text = (new WebInspector.Linkifier()).linkifyConsoleCallFrameForTime line(this._target, node.frame).textContent; | 431 var text = (new WebInspector.Linkifier()).linkifyConsoleCallFrame(this._ target, node.callFrame).textContent; |
| 426 linkifier.dispose(); | 432 linkifier.dispose(); |
| 427 pushEntryInfoRow(WebInspector.UIString("URL"), text); | 433 pushEntryInfoRow(WebInspector.UIString("URL"), text); |
| 428 return entryInfo; | 434 return entryInfo; |
| 429 }, | 435 }, |
| 430 | 436 |
| 431 __proto__: WebInspector.ProfileFlameChartDataProvider.prototype | 437 __proto__: WebInspector.ProfileFlameChartDataProvider.prototype |
| 432 } | 438 } |
| OLD | NEW |