| 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 */ |
| 11 WebInspector.HeapProfileView = function(profileHeader) | 11 WebInspector.HeapProfileView = function(profileHeader) |
| 12 { | 12 { |
| 13 this._profileHeader = profileHeader; | 13 this._profileHeader = profileHeader; |
| 14 this.profile = new WebInspector.SamplingHeapProfileModel(profileHeader._prof
ile || profileHeader.protocolProfile()); | 14 this.profile = new WebInspector.SamplingHeapProfileModel(profileHeader._prof
ile || profileHeader.protocolProfile()); |
| 15 this.adjustedTotal = this.profile.total; | 15 this.adjustedTotal = this.profile.total; |
| 16 var views = [ | 16 var views = [ |
| 17 WebInspector.ProfileView.ViewTypes.Heavy, | 17 WebInspector.ProfileView.ViewTypes.Heavy, |
| 18 WebInspector.ProfileView.ViewTypes.Tree | 18 WebInspector.ProfileView.ViewTypes.Tree |
| 19 ]; | 19 ]; |
| 20 WebInspector.ProfileView.call(this, new WebInspector.HeapProfileView.NodeFor
matter(this), views); | 20 WebInspector.ProfileView.call(this, new WebInspector.HeapProfileView.NodeFor
matter(this), views); |
| 21 } | 21 } |
| 22 | 22 |
| 23 WebInspector.HeapProfileView.prototype = { | 23 WebInspector.HeapProfileView.prototype = { |
| 24 /** |
| 25 * @override |
| 26 * @param {string} columnId |
| 27 * @return {string} |
| 28 */ |
| 29 columnHeader: function(columnId) |
| 30 { |
| 31 switch (columnId) { |
| 32 case "self": return WebInspector.UIString("Self Size (bytes)"); |
| 33 case "total": return WebInspector.UIString("Total Size (bytes)"); |
| 34 } |
| 35 return ""; |
| 36 }, |
| 37 |
| 24 __proto__: WebInspector.ProfileView.prototype | 38 __proto__: WebInspector.ProfileView.prototype |
| 25 } | 39 } |
| 26 | 40 |
| 27 /** | 41 /** |
| 28 * @constructor | 42 * @constructor |
| 29 * @extends {WebInspector.ProfileType} | 43 * @extends {WebInspector.ProfileType} |
| 30 */ | 44 */ |
| 31 WebInspector.SamplingHeapProfileType = function() | 45 WebInspector.SamplingHeapProfileType = function() |
| 32 { | 46 { |
| 33 WebInspector.ProfileType.call(this, WebInspector.SamplingHeapProfileType.Typ
eId, WebInspector.UIString("Collect JavaScript Heap Profile")); | 47 WebInspector.ProfileType.call(this, WebInspector.SamplingHeapProfileType.Typ
eId, WebInspector.UIString("Collect JavaScript Heap Profile")); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 * @override | 289 * @override |
| 276 * @param {!WebInspector.ProfileDataGridNode} node | 290 * @param {!WebInspector.ProfileDataGridNode} node |
| 277 * @return {!Element} | 291 * @return {!Element} |
| 278 */ | 292 */ |
| 279 linkifyNode: function(node) | 293 linkifyNode: function(node) |
| 280 { | 294 { |
| 281 var callFrame = node.profileNode.frame; | 295 var callFrame = node.profileNode.frame; |
| 282 return this._profileView.linkifier().linkifyConsoleCallFrame(this._profi
leView.target(), callFrame, "profile-node-file"); | 296 return this._profileView.linkifier().linkifyConsoleCallFrame(this._profi
leView.target(), callFrame, "profile-node-file"); |
| 283 } | 297 } |
| 284 } | 298 } |
| OLD | NEW |