| 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_PROFILER_SERVICE_H_ | 5 #ifndef CONTENT_BROWSER_POWER_PROFILER_POWER_PROFILER_SERVICE_H_ |
| 6 #define CONTENT_BROWSER_POWER_PROFILER_POWER_PROFILER_SERVICE_H_ | 6 #define CONTENT_BROWSER_POWER_PROFILER_POWER_PROFILER_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // Query power data from PowerDataProvider, executes on the WorkerPool thread. | 52 // Query power data from PowerDataProvider, executes on the WorkerPool thread. |
| 53 void QueryDataOnTaskRunner(); | 53 void QueryDataOnTaskRunner(); |
| 54 | 54 |
| 55 // Initiate the query on the UI thread, the task is delegated to | 55 // Initiate the query on the UI thread, the task is delegated to |
| 56 // QueryDataOnTaskRunner. | 56 // QueryDataOnTaskRunner. |
| 57 void QueryData(); | 57 void QueryData(); |
| 58 | 58 |
| 59 // Executes on the UI thread. | 59 // Executes on the UI thread. |
| 60 void Notify(const PowerEventVector&); | 60 void Notify(const PowerEventVector&); |
| 61 | 61 |
| 62 base::RepeatingTimer<PowerProfilerService> query_power_timer_; | 62 base::RepeatingTimer query_power_timer_; |
| 63 scoped_refptr<base::TaskRunner> task_runner_; | 63 scoped_refptr<base::TaskRunner> task_runner_; |
| 64 | 64 |
| 65 Status status_; | 65 Status status_; |
| 66 | 66 |
| 67 // Sampling period of power data measurement. | 67 // Sampling period of power data measurement. |
| 68 base::TimeDelta sample_period_; | 68 base::TimeDelta sample_period_; |
| 69 base::ObserverList<PowerProfilerObserver> observers_; | 69 base::ObserverList<PowerProfilerObserver> observers_; |
| 70 | 70 |
| 71 scoped_ptr<PowerDataProvider> data_provider_; | 71 scoped_ptr<PowerDataProvider> data_provider_; |
| 72 | 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(PowerProfilerService); | 73 DISALLOW_COPY_AND_ASSIGN(PowerProfilerService); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace content | 76 } // namespace content |
| 77 | 77 |
| 78 #endif // CONTENT_BROWSER_POWER_PROFILER_POWER_PROFILER_SERVICE_H_ | 78 #endif // CONTENT_BROWSER_POWER_PROFILER_POWER_PROFILER_SERVICE_H_ |
| OLD | NEW |