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_PROFILER_OBSERVER_H_ | |
6 #define CONTENT_PUBLIC_BROWSER_POWER_PROFILER_OBSERVER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/memory/ref_counted.h" | |
10 #include "content/common/content_export.h" | |
11 #include "content/public/browser/power_data_provider.h" | |
12 | |
13 namespace content { | |
14 | |
15 // A class used to monitor the power usage and tell profiler the power data | |
16 class CONTENT_EXPORT PowerProfilerObserver | |
qsr
2014/01/22 15:30:01
I'm not sure to understand why the object should b
Pan
2014/01/23 09:37:43
it is there because previously, observer called in
qsr
2014/01/23 10:08:05
Then you should have a virtual method returning th
| |
17 : public base::RefCountedThreadSafe<PowerProfilerObserver> { | |
18 public: | |
19 enum Resolution { | |
20 LOW, | |
21 NORMAL, | |
22 HIGH, | |
23 TYPE_COUNT // this should be always the last one | |
24 }; | |
25 | |
26 PowerProfilerObserver(); | |
27 ~PowerProfilerObserver(); | |
28 | |
29 // Register as an PowerProfilerService observer | |
30 bool Register(); | |
31 | |
32 // Unregister | |
33 void Unregister(); | |
34 | |
35 // Set resolution requirement, PowerProfilerService would change for it. | |
36 void SetResolution(Resolution); | |
37 | |
38 Resolution resolution() const { return resolution_; } | |
39 | |
40 // This method would be called on thread in WorkerPool | |
41 virtual void Send(PowerEvent*) { } | |
qsr
2014/01/22 15:30:01
Make this a pure virtual method, as I do not see w
| |
42 | |
43 private: | |
44 Resolution resolution_; | |
45 | |
46 DISALLOW_COPY_AND_ASSIGN(PowerProfilerObserver); | |
47 }; | |
48 | |
49 } // namespace content | |
50 | |
51 #endif // CONTENT_PUBLIC_BROWSER_POWER_PROFILER_OBSERVER_H_ | |
OLD | NEW |