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
3 // found in the LICENSE file.
7 * @extends {WebInspector.Object}
9 WebInspector.PowerProfiler = function()
11 WebInspector.Object.call(this);
12 this._dispatcher = new WebInspector.PowerDispatcher(this);
15 WebInspector.PowerProfiler.EventTypes = {
16 PowerEventRecorded: "PowerEventRecorded"
19 WebInspector.PowerProfiler.prototype = {
21 startProfile: function ()
26 stopProfile: function ()
31 __proto__: WebInspector.Object.prototype
36 * @implements {PowerAgent.Dispatcher}
38 WebInspector.PowerDispatcher = function(profiler)
40 this._profiler = profiler;
41 InspectorBackend.registerPowerDispatcher(this);
44 WebInspector.PowerDispatcher.prototype = {
45 dataAvailable: function(events)
47 for (var i = 0; i < events.length; ++i)
48 this._profiler.dispatchEventToListeners(WebInspector.PowerProfiler.EventTypes.PowerEventRecorded, events[i]);
53 * @type {!WebInspector.PowerProfiler}
55 WebInspector.powerProfiler;