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 #ifndef CONTENT_BROWSER_POWER_PROFILER_POWER_DATA_PROVIDER_H_ | 5 #ifndef CONTENT_BROWSER_POWER_PROFILER_POWER_DATA_PROVIDER_H_ |
6 #define CONTENT_BROWSER_POWER_PROFILER_POWER_DATA_PROVIDER_H_ | 6 #define CONTENT_BROWSER_POWER_PROFILER_POWER_DATA_PROVIDER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "content/browser/power_profiler/power_event.h" | 11 #include "content/browser/power_profiler/power_event.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class TimeDelta; | 14 class TimeDelta; |
15 } // namespace base | 15 } // namespace base |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 typedef std::vector<PowerEvent> PowerEventVector; | 19 typedef std::vector<PowerEvent> PowerEventVector; |
20 | 20 |
21 // A class used to get power usage. | 21 // A class used to get power usage. |
22 class PowerDataProvider { | 22 class PowerDataProvider { |
23 public: | 23 public: |
| 24 enum AccuracyLevel { |
| 25 High, |
| 26 Moderate, |
| 27 Low |
| 28 }; |
| 29 |
24 static scoped_ptr<PowerDataProvider> Create(); | 30 static scoped_ptr<PowerDataProvider> Create(); |
25 | 31 |
26 PowerDataProvider() {} | 32 PowerDataProvider() {} |
27 virtual ~PowerDataProvider() {} | 33 virtual ~PowerDataProvider() {} |
28 | 34 |
29 // Returns a vector of power events, one per type, for the types it supports. | 35 // Returns a vector of power events, one per type, for the types it supports. |
30 virtual PowerEventVector GetData() = 0; | 36 virtual PowerEventVector GetData() = 0; |
31 | 37 |
32 // Returns sampling rate at which the provider can operate. | 38 // Returns sampling rate at which the provider can operate. |
33 virtual base::TimeDelta GetSamplingRate() = 0; | 39 virtual base::TimeDelta GetSamplingRate() = 0; |
| 40 |
| 41 // Returns accuracy level of the provider. |
| 42 virtual AccuracyLevel GetAccuracyLevel() = 0; |
34 }; | 43 }; |
35 | 44 |
36 } // namespace content | 45 } // namespace content |
37 | 46 |
38 #endif // CONTENT_BROWSER_POWER_PROFILER_POWER_DATA_PROVIDER_H_ | 47 #endif // CONTENT_BROWSER_POWER_PROFILER_POWER_DATA_PROVIDER_H_ |
OLD | NEW |