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 if (node.callFrame) { | 224 var callFrame = node.callFrame || /** @type {!RuntimeAgent.CallFrame} */ ({ |
225 WebInspector.ProfileNode.call(this, node.callFrame); | 225 // Backward compatibility for old CpuProfileNode format. |
226 } else { | 226 functionName: node["functionName"], |
227 // Backward compatibility for old SamplingHeapProfileNode format. | 227 scriptId: node["scriptId"], |
228 var frame = /** @type {!RuntimeAgent.CallFrame} */(node); | 228 url: node["url"], |
229 WebInspector.ProfileNode.call(this, { | 229 lineNumber: node["lineNumber"] - 1, |
230 functionName: frame.functionName, | 230 columnNumber: node["columnNumber"] - 1 |
231 scriptId: frame.scriptId, url: frame.url, | 231 }); |
232 lineNumber: frame.lineNumber - 1, | 232 WebInspector.ProfileNode.call(this, callFrame); |
233 columnNumber: frame.columnNumber - 1 | |
234 }); | |
235 } | |
236 this.self = node.selfSize; | 233 this.self = node.selfSize; |
237 } | 234 } |
238 | 235 |
239 WebInspector.SamplingHeapProfileNode.prototype = { | 236 WebInspector.SamplingHeapProfileNode.prototype = { |
240 __proto__: WebInspector.ProfileNode.prototype | 237 __proto__: WebInspector.ProfileNode.prototype |
241 } | 238 } |
242 | 239 |
243 /** | 240 /** |
244 * @constructor | 241 * @constructor |
245 * @extends {WebInspector.ProfileTreeModel} | 242 * @extends {WebInspector.ProfileTreeModel} |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 var linkifier = new WebInspector.Linkifier(); | 431 var linkifier = new WebInspector.Linkifier(); |
435 var link = linkifier.maybeLinkifyConsoleCallFrame(this._target, node.cal
lFrame); | 432 var link = linkifier.maybeLinkifyConsoleCallFrame(this._target, node.cal
lFrame); |
436 if (link) | 433 if (link) |
437 pushEntryInfoRow(WebInspector.UIString("URL"), link.textContent); | 434 pushEntryInfoRow(WebInspector.UIString("URL"), link.textContent); |
438 linkifier.dispose(); | 435 linkifier.dispose(); |
439 return entryInfo; | 436 return entryInfo; |
440 }, | 437 }, |
441 | 438 |
442 __proto__: WebInspector.ProfileFlameChartDataProvider.prototype | 439 __proto__: WebInspector.ProfileFlameChartDataProvider.prototype |
443 } | 440 } |
OLD | NEW |