| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * @extends {WebInspector.Object} | 7 * @extends {WebInspector.Object} |
| 8 */ | 8 */ |
| 9 WebInspector.PowerProfiler = function() | 9 WebInspector.PowerProfiler = function() |
| 10 { | 10 { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 stopProfile: function () | 26 stopProfile: function () |
| 27 { | 27 { |
| 28 PowerAgent.end(); | 28 PowerAgent.end(); |
| 29 }, | 29 }, |
| 30 | 30 |
| 31 __proto__: WebInspector.Object.prototype | 31 __proto__: WebInspector.Object.prototype |
| 32 } | 32 } |
| 33 | 33 |
| 34 /** | 34 /** |
| 35 * @constructor | 35 * @constructor |
| 36 * @implements {WebInspector.PowerEventDispatcher} | 36 * @implements {PowerAgent.Dispatcher} |
| 37 */ | 37 */ |
| 38 WebInspector.PowerDispatcher = function(profiler) | 38 WebInspector.PowerDispatcher = function(profiler) |
| 39 { | 39 { |
| 40 this._profiler = profiler; | 40 this._profiler = profiler; |
| 41 InspectorBackend.registerPowerDispatcher(this); | 41 InspectorBackend.registerPowerDispatcher(this); |
| 42 } | 42 } |
| 43 | 43 |
| 44 WebInspector.PowerDispatcher.prototype = { | 44 WebInspector.PowerDispatcher.prototype = { |
| 45 dataAvailable: function(events) | 45 dataAvailable: function(events) |
| 46 { | 46 { |
| 47 for (var i in events) | 47 for (var i = 0; i < events.length; ++i) |
| 48 this._profiler.dispatchEventToListeners(WebInspector.PowerProfiler.E
ventTypes.PowerEventRecorded, events[i]); | 48 this._profiler.dispatchEventToListeners(WebInspector.PowerProfiler.E
ventTypes.PowerEventRecorded, events[i]); |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 | 51 |
| 52 /** | 52 /** |
| 53 * @type {!WebInspector.PowerProfiler} | 53 * @type {!WebInspector.PowerProfiler} |
| 54 */ | 54 */ |
| 55 WebInspector.powerProfiler; | 55 WebInspector.powerProfiler; |
| OLD | NEW |