OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 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 APP_HI_RES_TIMER_MANAGER_H_ |
| 6 #define APP_HI_RES_TIMER_MANAGER_H_ |
| 7 |
| 8 #include "app/system_monitor.h" |
| 9 |
| 10 // Ensures that the Windows high resolution timer is only used |
| 11 // when not running on battery power. |
| 12 class HighResolutionTimerManager : public SystemMonitor::PowerObserver { |
| 13 public: |
| 14 HighResolutionTimerManager(); |
| 15 virtual ~HighResolutionTimerManager(); |
| 16 |
| 17 // SystemMonitor::PowerObserver: |
| 18 void OnPowerStateChange(bool on_battery_power); |
| 19 |
| 20 private: |
| 21 // Enable or disable the faster multimedia timer. |
| 22 void UseHiResClock(bool use); |
| 23 |
| 24 bool hi_res_clock_used_; |
| 25 |
| 26 DISALLOW_COPY_AND_ASSIGN(HighResolutionTimerManager); |
| 27 }; |
| 28 |
| 29 #endif // APP_HI_RES_TIMER_MANAGER_H_ |
OLD | NEW |