| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 * @constructor | 32 * @constructor |
| 33 * @extends {WebInspector.VBox} | 33 * @extends {WebInspector.VBox} |
| 34 * @param {!WebInspector.HeapProfileHeader} profile | 34 * @param {!WebInspector.HeapProfileHeader} profile |
| 35 */ | 35 */ |
| 36 WebInspector.HeapSnapshotView = function(profile) | 36 WebInspector.HeapSnapshotView = function(profile) |
| 37 { | 37 { |
| 38 WebInspector.VBox.call(this); | 38 WebInspector.VBox.call(this); |
| 39 | 39 |
| 40 this.element.classList.add("heap-snapshot-view"); | 40 this.element.classList.add("heap-snapshot-view"); |
| 41 | 41 |
| 42 profile.profileType().addEventListener(WebInspector.HeapSnapshotProfileType.
SnapshotReceived, this._onReceivSnapshot, this); | 42 profile.profileType().addEventListener(WebInspector.HeapSnapshotProfileType.
SnapshotReceived, this._onReceiveSnapshot, this); |
| 43 profile.profileType().addEventListener(WebInspector.ProfileType.Events.Remov
eProfileHeader, this._onProfileHeaderRemoved, this); | 43 profile.profileType().addEventListener(WebInspector.ProfileType.Events.Remov
eProfileHeader, this._onProfileHeaderRemoved, this); |
| 44 | 44 |
| 45 if (profile._profileType.id === WebInspector.TrackingHeapSnapshotProfileType
.TypeId) { | 45 if (profile._profileType.id === WebInspector.TrackingHeapSnapshotProfileType
.TypeId) { |
| 46 this._trackingOverviewGrid = new WebInspector.HeapTrackingOverviewGrid(p
rofile); | 46 this._trackingOverviewGrid = new WebInspector.HeapTrackingOverviewGrid(p
rofile); |
| 47 this._trackingOverviewGrid.addEventListener(WebInspector.HeapTrackingOve
rviewGrid.IdsRangeChanged, this._onIdsRangeChanged.bind(this)); | 47 this._trackingOverviewGrid.addEventListener(WebInspector.HeapTrackingOve
rviewGrid.IdsRangeChanged, this._onIdsRangeChanged.bind(this)); |
| 48 } | 48 } |
| 49 | 49 |
| 50 this._splitView = new WebInspector.SplitView(false, true, "heapSnapshotSplit
ViewState", 200, 200); | 50 this._splitView = new WebInspector.SplitView(false, true, "heapSnapshotSplit
ViewState", 200, 200); |
| 51 this._splitView.show(this.element); | 51 this._splitView.show(this.element); |
| 52 this._splitView.setMainElementConstraints(50, 50); | 52 this._splitView.setMainElementConstraints(50, 50); |
| (...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 970 | 970 |
| 971 _updateControls: function() | 971 _updateControls: function() |
| 972 { | 972 { |
| 973 this._updateBaseOptions(); | 973 this._updateBaseOptions(); |
| 974 this._updateFilterOptions(); | 974 this._updateFilterOptions(); |
| 975 }, | 975 }, |
| 976 | 976 |
| 977 /** | 977 /** |
| 978 * @param {!WebInspector.Event} event | 978 * @param {!WebInspector.Event} event |
| 979 */ | 979 */ |
| 980 _onReceivSnapshot: function(event) | 980 _onReceiveSnapshot: function(event) |
| 981 { | 981 { |
| 982 this._updateControls(); | 982 this._updateControls(); |
| 983 }, | 983 }, |
| 984 | 984 |
| 985 /** | 985 /** |
| 986 * @param {!WebInspector.Event} event | 986 * @param {!WebInspector.Event} event |
| 987 */ | 987 */ |
| 988 _onProfileHeaderRemoved: function(event) | 988 _onProfileHeaderRemoved: function(event) |
| 989 { | 989 { |
| 990 var profile = event.data; | 990 var profile = event.data; |
| 991 if (this._profile === profile) { | 991 if (this._profile === profile) { |
| 992 this.detach(); | 992 this.detach(); |
| 993 this._profile.profileType().removeEventListener(WebInspector.Profile
Type.Events.AddProfileHeader, this._onReceivSnapshot, this); | 993 this._profile.profileType().removeEventListener(WebInspector.HeapSna
pshotProfileType.SnapshotReceived, this._onReceiveSnapshot, this); |
| 994 this._profile.profileType().removeEventListener(WebInspector.Profile
Type.Events.RemoveProfileHeader, this._onProfileHeaderRemoved, this); | 994 this._profile.profileType().removeEventListener(WebInspector.Profile
Type.Events.RemoveProfileHeader, this._onProfileHeaderRemoved, this); |
| 995 } else { | 995 } else { |
| 996 this._updateControls(); | 996 this._updateControls(); |
| 997 } | 997 } |
| 998 }, | 998 }, |
| 999 | 999 |
| 1000 __proto__: WebInspector.VBox.prototype | 1000 __proto__: WebInspector.VBox.prototype |
| 1001 } | 1001 } |
| 1002 | 1002 |
| 1003 /** | 1003 /** |
| (...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2160 if (color) | 2160 if (color) |
| 2161 swatchDiv.style.backgroundColor = color; | 2161 swatchDiv.style.backgroundColor = color; |
| 2162 else | 2162 else |
| 2163 swatchDiv.classList.add("heap-snapshot-stats-empty-swatch"); | 2163 swatchDiv.classList.add("heap-snapshot-stats-empty-swatch"); |
| 2164 nameDiv.textContent = name; | 2164 nameDiv.textContent = name; |
| 2165 sizeDiv.textContent = WebInspector.UIString("%s KB", Number.withThousand
sSeparator(Math.round(value / 1024))); | 2165 sizeDiv.textContent = WebInspector.UIString("%s KB", Number.withThousand
sSeparator(Math.round(value / 1024))); |
| 2166 }, | 2166 }, |
| 2167 | 2167 |
| 2168 __proto__: WebInspector.VBox.prototype | 2168 __proto__: WebInspector.VBox.prototype |
| 2169 } | 2169 } |
| OLD | NEW |