OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #ifndef CONTENT_PUBLIC_BROWSER_POWER_DATA_PROVIDER_H_ | |
6 #define CONTENT_PUBLIC_BROWSER_POWER_DATA_PROVIDER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/time/time.h" | |
11 | |
12 namespace content { | |
13 | |
14 struct PowerEvent { | |
15 enum Type { | |
16 // Total power of SoC. including CPU, GT and others on the chip. | |
17 SOC_PACKAGE, | |
18 | |
19 // Count the number of known PowerEvent. | |
20 ID_COUNT | |
21 }; | |
22 | |
23 Type type; | |
24 base::TimeTicks time; | |
qsr
2014/01/23 12:50:06
Comment on those 2 values, especially the |value|
Pan
2014/01/25 09:35:53
Done.
| |
25 double value; | |
26 }; | |
27 | |
28 // a class used to GET power usage. | |
29 class PowerDataProvider { | |
30 public: | |
31 PowerDataProvider() { } | |
32 virtual ~PowerDataProvider() { } | |
33 | |
34 // Return true when success, it fills a single PowerEvent, which should be | |
35 // allocated by its caller. | |
36 virtual bool GetData(PowerEvent*) = 0; | |
37 | |
38 private: | |
39 DISALLOW_COPY_AND_ASSIGN(PowerDataProvider); | |
40 }; | |
41 | |
42 class PowerDataProviderFactory { | |
43 public: | |
44 // Create a provider, and transfer the ownship to PowerProfilerService. | |
45 static scoped_ptr<PowerDataProvider> Create(); | |
46 | |
47 private: | |
48 PowerDataProviderFactory() { } | |
49 DISALLOW_COPY_AND_ASSIGN(PowerDataProviderFactory); | |
50 }; | |
51 | |
52 } // namespace content | |
53 | |
54 #endif // CONTENT_PUBLIC_BROWSER_POWER_DATA_PROVIDER_H_ | |
OLD | NEW |