| 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, { |
| 230 functionName: frame.functionName, |
| 231 scriptId: frame.scriptId, url: frame.url, |
| 232 lineNumber: frame.lineNumber - 1, |
| 233 columnNumber: frame.columnNumber - 1 |
| 234 }); |
| 235 } |
| 225 this.self = node.selfSize; | 236 this.self = node.selfSize; |
| 226 } | 237 } |
| 227 | 238 |
| 228 WebInspector.SamplingHeapProfileNode.prototype = { | 239 WebInspector.SamplingHeapProfileNode.prototype = { |
| 229 __proto__: WebInspector.ProfileNode.prototype | 240 __proto__: WebInspector.ProfileNode.prototype |
| 230 } | 241 } |
| 231 | 242 |
| 232 /** | 243 /** |
| 233 * @constructor | 244 * @constructor |
| 234 * @extends {WebInspector.ProfileTreeModel} | 245 * @extends {WebInspector.ProfileTreeModel} |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 return WebInspector.UIString("%.2f\u2009%%", value); | 305 return WebInspector.UIString("%.2f\u2009%%", value); |
| 295 }, | 306 }, |
| 296 | 307 |
| 297 /** | 308 /** |
| 298 * @override | 309 * @override |
| 299 * @param {!WebInspector.ProfileDataGridNode} node | 310 * @param {!WebInspector.ProfileDataGridNode} node |
| 300 * @return {!Element} | 311 * @return {!Element} |
| 301 */ | 312 */ |
| 302 linkifyNode: function(node) | 313 linkifyNode: function(node) |
| 303 { | 314 { |
| 304 return this._profileView.linkifier().linkifyConsoleCallFrameForTimeline(
this._profileView.target(), node.profileNode.frame, "profile-node-file"); | 315 return this._profileView.linkifier().linkifyConsoleCallFrame(this._profi
leView.target(), node.profileNode.callFrame, "profile-node-file"); |
| 305 } | 316 } |
| 306 } | 317 } |
| 307 | 318 |
| 308 /** | 319 /** |
| 309 * @constructor | 320 * @constructor |
| 310 * @extends {WebInspector.ProfileFlameChartDataProvider} | 321 * @extends {WebInspector.ProfileFlameChartDataProvider} |
| 311 * @param {!WebInspector.ProfileTreeModel} profile | 322 * @param {!WebInspector.ProfileTreeModel} profile |
| 312 * @param {?WebInspector.Target} target | 323 * @param {?WebInspector.Target} target |
| 313 */ | 324 */ |
| 314 WebInspector.HeapFlameChartDataProvider = function(profile, target) | 325 WebInspector.HeapFlameChartDataProvider = function(profile, target) |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 * @param {string} value | 425 * @param {string} value |
| 415 */ | 426 */ |
| 416 function pushEntryInfoRow(title, value) | 427 function pushEntryInfoRow(title, value) |
| 417 { | 428 { |
| 418 entryInfo.push({ title: title, value: value }); | 429 entryInfo.push({ title: title, value: value }); |
| 419 } | 430 } |
| 420 pushEntryInfoRow(WebInspector.UIString("Name"), WebInspector.beautifyFun
ctionName(node.functionName)); | 431 pushEntryInfoRow(WebInspector.UIString("Name"), WebInspector.beautifyFun
ctionName(node.functionName)); |
| 421 pushEntryInfoRow(WebInspector.UIString("Self size"), Number.bytesToStrin
g(node.self)); | 432 pushEntryInfoRow(WebInspector.UIString("Self size"), Number.bytesToStrin
g(node.self)); |
| 422 pushEntryInfoRow(WebInspector.UIString("Total size"), Number.bytesToStri
ng(node.total)); | 433 pushEntryInfoRow(WebInspector.UIString("Total size"), Number.bytesToStri
ng(node.total)); |
| 423 var linkifier = new WebInspector.Linkifier(); | 434 var linkifier = new WebInspector.Linkifier(); |
| 424 var text = (new WebInspector.Linkifier()).linkifyConsoleCallFrameForTime
line(this._target, node.frame).textContent; | 435 var text = (new WebInspector.Linkifier()).linkifyConsoleCallFrame(this._
target, node.callFrame).textContent; |
| 425 linkifier.dispose(); | 436 linkifier.dispose(); |
| 426 pushEntryInfoRow(WebInspector.UIString("URL"), text); | 437 pushEntryInfoRow(WebInspector.UIString("URL"), text); |
| 427 return entryInfo; | 438 return entryInfo; |
| 428 }, | 439 }, |
| 429 | 440 |
| 430 __proto__: WebInspector.ProfileFlameChartDataProvider.prototype | 441 __proto__: WebInspector.ProfileFlameChartDataProvider.prototype |
| 431 } | 442 } |
| OLD | NEW |