| 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; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 var defaultSamplingIntervalInBytes = 16384; | 35 var defaultSamplingIntervalInBytes = 16384; |
| 36 this._heapProfilerAgent.startSampling(defaultSamplingIntervalInBytes); | 36 this._heapProfilerAgent.startSampling(defaultSamplingIntervalInBytes); |
| 37 }, | 37 }, |
| 38 | 38 |
| 39 /** | 39 /** |
| 40 * @return {!Promise.<?ProfilerAgent.Profile>} | 40 * @return {!Promise.<?ProfilerAgent.Profile>} |
| 41 */ | 41 */ |
| 42 stopSampling: function() | 42 stopSampling: function() |
| 43 { | 43 { |
| 44 this._isRecording = false; | 44 this._isRecording = false; |
| 45 var currentProfile = null; | 45 return this._heapProfilerAgent.stopSampling((error, profile) => error ?
null : profile); |
| 46 return this._heapProfilerAgent.stopSampling((error, profile) => { curren
tProfile = !error ? profile : null; }) | |
| 47 .then(() => currentProfile); | |
| 48 }, | 46 }, |
| 49 | 47 |
| 50 /** | 48 /** |
| 51 * @param {!Array.<number>} samples | 49 * @param {!Array.<number>} samples |
| 52 */ | 50 */ |
| 53 heapStatsUpdate: function(samples) | 51 heapStatsUpdate: function(samples) |
| 54 { | 52 { |
| 55 this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.Heap
StatsUpdate, samples); | 53 this.dispatchEventToListeners(WebInspector.HeapProfilerModel.Events.Heap
StatsUpdate, samples); |
| 56 }, | 54 }, |
| 57 | 55 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 }, | 139 }, |
| 142 | 140 |
| 143 /** | 141 /** |
| 144 * @override | 142 * @override |
| 145 */ | 143 */ |
| 146 resetProfiles: function() | 144 resetProfiles: function() |
| 147 { | 145 { |
| 148 this._heapProfilerModel.resetProfiles(); | 146 this._heapProfilerModel.resetProfiles(); |
| 149 } | 147 } |
| 150 }; | 148 }; |
| OLD | NEW |