Chromium Code Reviews| Index: content/public/browser/power_profiler_observer.h |
| diff --git a/content/public/browser/power_profiler_observer.h b/content/public/browser/power_profiler_observer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9ed401a47297e6bb2031fb154cd925d5b74c7b95 |
| --- /dev/null |
| +++ b/content/public/browser/power_profiler_observer.h |
| @@ -0,0 +1,51 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_PUBLIC_BROWSER_POWER_PROFILER_OBSERVER_H_ |
| +#define CONTENT_PUBLIC_BROWSER_POWER_PROFILER_OBSERVER_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "content/common/content_export.h" |
| +#include "content/public/browser/power_data_provider.h" |
| + |
| +namespace content { |
| + |
| +// A class used to monitor the power usage and tell profiler the power data |
| +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
|
| + : public base::RefCountedThreadSafe<PowerProfilerObserver> { |
| + public: |
| + enum Resolution { |
| + LOW, |
| + NORMAL, |
| + HIGH, |
| + TYPE_COUNT // this should be always the last one |
| + }; |
| + |
| + PowerProfilerObserver(); |
| + ~PowerProfilerObserver(); |
| + |
| + // Register as an PowerProfilerService observer |
| + bool Register(); |
| + |
| + // Unregister |
| + void Unregister(); |
| + |
| + // Set resolution requirement, PowerProfilerService would change for it. |
| + void SetResolution(Resolution); |
| + |
| + Resolution resolution() const { return resolution_; } |
| + |
| + // This method would be called on thread in WorkerPool |
| + virtual void Send(PowerEvent*) { } |
|
qsr
2014/01/22 15:30:01
Make this a pure virtual method, as I do not see w
|
| + |
| + private: |
| + Resolution resolution_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(PowerProfilerObserver); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_BROWSER_POWER_PROFILER_OBSERVER_H_ |