| 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 * @param {!WebInspector.Target} target | 8 * @param {!WebInspector.Target} target |
| 9 */ | 9 */ |
| 10 WebInspector.PowerProfiler = function(target) | 10 WebInspector.PowerProfiler = function(target) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 }, | 27 }, |
| 28 | 28 |
| 29 stopProfile: function() | 29 stopProfile: function() |
| 30 { | 30 { |
| 31 this._target.powerAgent().end(); | 31 this._target.powerAgent().end(); |
| 32 }, | 32 }, |
| 33 | 33 |
| 34 /** | 34 /** |
| 35 * @return {string} | 35 * @return {string} |
| 36 */ | 36 */ |
| 37 getAccuracyLevel: function() | 37 accuracyLevel: function() |
| 38 { | 38 { |
| 39 return this._accuracyLevel; | 39 return this._accuracyLevel; |
| 40 }, | 40 }, |
| 41 | 41 |
| 42 _onAccuracyLevel: function(error, result) { | 42 _onAccuracyLevel: function(error, result) |
| 43 { |
| 43 this._accuracyLevel = ""; | 44 this._accuracyLevel = ""; |
| 44 if (error) { | 45 if (error) { |
| 45 console.log("Unable to retrieve PowerProfiler accuracy level: " + er
ror); | 46 console.log("Unable to retrieve PowerProfiler accuracy level: " + er
ror); |
| 46 return; | 47 return; |
| 47 } | 48 } |
| 48 this._accuracyLevel = result; | 49 this._accuracyLevel = result; |
| 49 }, | 50 }, |
| 50 | 51 |
| 51 __proto__: WebInspector.Object.prototype | 52 __proto__: WebInspector.Object.prototype |
| 52 } | 53 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 64 /** | 65 /** |
| 65 * @override | 66 * @override |
| 66 * @param {!Array.<!PowerAgent.PowerEvent>} events | 67 * @param {!Array.<!PowerAgent.PowerEvent>} events |
| 67 */ | 68 */ |
| 68 dataAvailable: function(events) | 69 dataAvailable: function(events) |
| 69 { | 70 { |
| 70 for (var i = 0; i < events.length; ++i) | 71 for (var i = 0; i < events.length; ++i) |
| 71 this._profiler.dispatchEventToListeners(WebInspector.PowerProfiler.E
ventTypes.PowerEventRecorded, events[i]); | 72 this._profiler.dispatchEventToListeners(WebInspector.PowerProfiler.E
ventTypes.PowerEventRecorded, events[i]); |
| 72 } | 73 } |
| 73 } | 74 } |
| 74 | |
| 75 /** | |
| 76 * @type {!WebInspector.PowerProfiler} | |
| 77 */ | |
| 78 WebInspector.powerProfiler; | |
| OLD | NEW |