| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 * @fileoverview Heap profiler panel implementation. | 6 * @fileoverview Heap profiler panel implementation. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 WebInspector.ProfilesPanel.prototype.addSnapshot = function(snapshot) { | 9 WebInspector.ProfilesPanel.prototype.addSnapshot = function(snapshot) { |
| 10 snapshot.title = WebInspector.UIString("Snapshot %d", snapshot.number); | 10 snapshot.title = WebInspector.UIString("Snapshot %d", snapshot.number); |
| 11 snapshot.typeId = WebInspector.HeapSnapshotProfileType.TypeId; |
| 11 | 12 |
| 12 var snapshots = WebInspector.HeapSnapshotProfileType.snapshots; | 13 var snapshots = WebInspector.HeapSnapshotProfileType.snapshots; |
| 13 snapshots.push(snapshot); | 14 snapshots.push(snapshot); |
| 14 | 15 |
| 15 snapshot.listIndex = snapshots.length - 1; | 16 snapshot.listIndex = snapshots.length - 1; |
| 16 | 17 |
| 17 this.addProfileHeader(WebInspector.HeapSnapshotProfileType.TypeId, snapshot)
; | 18 if (WebInspector.CPUProfile) |
| 19 this.addProfileHeader(WebInspector.HeapSnapshotProfileType.TypeId, snaps
hot); |
| 20 else |
| 21 this.addProfileHeader(snapshot); |
| 18 | 22 |
| 19 this.dispatchEventToListeners("snapshot added"); | 23 this.dispatchEventToListeners("snapshot added"); |
| 20 } | 24 } |
| 21 | 25 |
| 22 | 26 |
| 23 WebInspector.HeapSnapshotView = function(parent, profile) | 27 WebInspector.HeapSnapshotView = function(parent, profile) |
| 24 { | 28 { |
| 25 WebInspector.View.call(this); | 29 WebInspector.View.call(this); |
| 26 | 30 |
| 27 this.element.addStyleClass("heap-snapshot-view"); | 31 this.element.addStyleClass("heap-snapshot-view"); |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 | 879 |
| 876 | 880 |
| 877 (function() { | 881 (function() { |
| 878 var originalCreatePanels = WebInspector._createPanels; | 882 var originalCreatePanels = WebInspector._createPanels; |
| 879 WebInspector._createPanels = function() { | 883 WebInspector._createPanels = function() { |
| 880 originalCreatePanels.apply(this, arguments); | 884 originalCreatePanels.apply(this, arguments); |
| 881 if (WebInspector.panels.profiles) | 885 if (WebInspector.panels.profiles) |
| 882 WebInspector.panels.profiles.registerProfileType(new WebInspector.He
apSnapshotProfileType()); | 886 WebInspector.panels.profiles.registerProfileType(new WebInspector.He
apSnapshotProfileType()); |
| 883 } | 887 } |
| 884 })(); | 888 })(); |
| OLD | NEW |