OLD | NEW |
1 /** | 1 /** |
2 * @constructor | 2 * @constructor |
3 * @extends {WebInspector.SDKModel} | 3 * @extends {WebInspector.SDKModel} |
4 * @param {!WebInspector.Target} target | 4 * @param {!WebInspector.Target} target |
5 */ | 5 */ |
6 WebInspector.HeapProfilerModel = function(target) | 6 WebInspector.HeapProfilerModel = function(target) |
7 { | 7 { |
8 WebInspector.SDKModel.call(this, WebInspector.HeapProfilerModel, target); | 8 WebInspector.SDKModel.call(this, WebInspector.HeapProfilerModel, target); |
9 target.registerHeapProfilerDispatcher(new WebInspector.HeapProfilerDispatche
r(this)); | 9 target.registerHeapProfilerDispatcher(new WebInspector.HeapProfilerDispatche
r(this)); |
10 this._enabled = false; | 10 this._enabled = false; |
11 this._heapProfilerAgent = target.heapProfilerAgent(); | 11 this._heapProfilerAgent = target.heapProfilerAgent(); |
12 } | 12 }; |
13 | 13 |
14 /** @enum {symbol} */ | 14 /** @enum {symbol} */ |
15 WebInspector.HeapProfilerModel.Events = { | 15 WebInspector.HeapProfilerModel.Events = { |
16 HeapStatsUpdate: Symbol("HeapStatsUpdate"), | 16 HeapStatsUpdate: Symbol("HeapStatsUpdate"), |
17 LastSeenObjectId: Symbol("LastSeenObjectId"), | 17 LastSeenObjectId: Symbol("LastSeenObjectId"), |
18 AddHeapSnapshotChunk: Symbol("AddHeapSnapshotChunk"), | 18 AddHeapSnapshotChunk: Symbol("AddHeapSnapshotChunk"), |
19 ReportHeapSnapshotProgress: Symbol("ReportHeapSnapshotProgress"), | 19 ReportHeapSnapshotProgress: Symbol("ReportHeapSnapshotProgress"), |
20 ResetProfiles: Symbol("ResetProfiles") | 20 ResetProfiles: Symbol("ResetProfiles") |
21 } | 21 }; |
22 | 22 |
23 WebInspector.HeapProfilerModel.prototype = { | 23 WebInspector.HeapProfilerModel.prototype = { |
24 enable: function() | 24 enable: function() |
25 { | 25 { |
26 if (this._enabled) | 26 if (this._enabled) |
27 return; | 27 return; |
28 | 28 |
29 this._enabled = true; | 29 this._enabled = true; |
30 this._heapProfilerAgent.enable(); | 30 this._heapProfilerAgent.enable(); |
31 }, | 31 }, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 { | 81 { |
82 this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.Repo
rtHeapSnapshotProgress, {done: done, total: total, finished: finished}); | 82 this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.Repo
rtHeapSnapshotProgress, {done: done, total: total, finished: finished}); |
83 }, | 83 }, |
84 | 84 |
85 resetProfiles: function() | 85 resetProfiles: function() |
86 { | 86 { |
87 this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.Rese
tProfiles); | 87 this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.Rese
tProfiles); |
88 }, | 88 }, |
89 | 89 |
90 __proto__: WebInspector.SDKModel.prototype | 90 __proto__: WebInspector.SDKModel.prototype |
91 } | 91 }; |
92 | 92 |
93 | 93 |
94 /** | 94 /** |
95 * @constructor | 95 * @constructor |
96 * @implements {HeapProfilerAgent.Dispatcher} | 96 * @implements {HeapProfilerAgent.Dispatcher} |
97 */ | 97 */ |
98 WebInspector.HeapProfilerDispatcher = function(model) | 98 WebInspector.HeapProfilerDispatcher = function(model) |
99 { | 99 { |
100 this._heapProfilerModel = model; | 100 this._heapProfilerModel = model; |
101 } | 101 }; |
102 | 102 |
103 WebInspector.HeapProfilerDispatcher.prototype = { | 103 WebInspector.HeapProfilerDispatcher.prototype = { |
104 /** | 104 /** |
105 * @override | 105 * @override |
106 * @param {!Array.<number>} samples | 106 * @param {!Array.<number>} samples |
107 */ | 107 */ |
108 heapStatsUpdate: function(samples) | 108 heapStatsUpdate: function(samples) |
109 { | 109 { |
110 this._heapProfilerModel.heapStatsUpdate(samples); | 110 this._heapProfilerModel.heapStatsUpdate(samples); |
111 }, | 111 }, |
(...skipping 28 matching lines...) Expand all Loading... |
140 this._heapProfilerModel.reportHeapSnapshotProgress(done, total, finished
); | 140 this._heapProfilerModel.reportHeapSnapshotProgress(done, total, finished
); |
141 }, | 141 }, |
142 | 142 |
143 /** | 143 /** |
144 * @override | 144 * @override |
145 */ | 145 */ |
146 resetProfiles: function() | 146 resetProfiles: function() |
147 { | 147 { |
148 this._heapProfilerModel.resetProfiles(); | 148 this._heapProfilerModel.resetProfiles(); |
149 } | 149 } |
150 } | 150 }; |
OLD | NEW |