Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 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_BROWSER_POWER_PROFILER_HOST_H_ | |
| 6 #define CONTENT_BROWSER_POWER_PROFILER_HOST_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "content/browser/power_profiler/power_event.h" | |
| 11 | |
| 12 #if defined(OS_WIN) | |
| 13 #define ENABLE_POWER_PROFILER 1 | |
|
qsr
2014/01/17 11:50:14
Using pre-processor variable at this level seems b
| |
| 14 #else | |
| 15 #undef ENABLE_POWER_PROFILE | |
| 16 #endif // !OS_WIN | |
| 17 | |
| 18 namespace content { | |
| 19 | |
| 20 // A class used to monitor the power usage and tell profiler the power data | |
| 21 class PowerProfilerHost : public base::RefCountedThreadSafe<PowerProfilerHost> { | |
| 22 public: | |
| 23 enum Resolution { | |
| 24 LOW, | |
| 25 NORMAL, | |
| 26 HIGH, | |
| 27 TYPE_COUNT // this should be always the last one | |
| 28 }; | |
| 29 | |
| 30 PowerProfilerHost(); | |
| 31 ~PowerProfilerHost(); | |
| 32 | |
| 33 void UnRegister(); | |
|
qsr
2014/01/17 11:50:14
Can you add comments on all those methods. Moreove
| |
| 34 void SetResolution(Resolution); | |
| 35 Resolution GetResolution() const { return resolution_; } | |
|
qsr
2014/01/17 11:50:14
Inlined getter should be resolution() { return res
| |
| 36 | |
| 37 virtual bool Register(); | |
| 38 virtual void Send(PowerEvent*, int count) {} | |
| 39 | |
| 40 protected: | |
| 41 Resolution resolution_; | |
|
qsr
2014/01/17 11:50:14
Why is this protected? You are setting this in the
| |
| 42 | |
| 43 private: | |
| 44 void RegisterWrapper(); | |
| 45 void UnRegisterWrapper(); | |
| 46 void SetResolutionWrapper(); | |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(PowerProfilerHost); | |
| 49 }; | |
| 50 | |
| 51 } // namespace content | |
| 52 | |
| 53 #endif // CONTENT_BROWSER_POWER_PROFILER_HOST_H_ | |
| OLD | NEW |