diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-14 21:31:07 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-14 21:31:07 +0000 |
commit | 3f03f1f2dfa411916fc5db22e32a05c6360d6bcc (patch) | |
tree | 51981422445df005dd7f8ae8783459fe18513d95 /chrome/common | |
parent | 44f724478aa3b97e69c1609598b98b2cd03d9670 (diff) | |
download | chromium_src-3f03f1f2dfa411916fc5db22e32a05c6360d6bcc.zip chromium_src-3f03f1f2dfa411916fc5db22e32a05c6360d6bcc.tar.gz chromium_src-3f03f1f2dfa411916fc5db22e32a05c6360d6bcc.tar.bz2 |
Revert 71487 - Move SystemMonitor to src/ui/base/system_monitor.
Move HiResTimerManager to src/chrome/common.
BUG=none
TEST=none
TBR=brettw
Review URL: http://codereview.chromium.org/6361002
TBR=ben@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71489 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/hi_res_timer_manager.h | 30 | ||||
-rw-r--r-- | chrome/common/hi_res_timer_manager_posix.cc | 20 | ||||
-rw-r--r-- | chrome/common/hi_res_timer_manager_win.cc | 29 |
3 files changed, 0 insertions, 79 deletions
diff --git a/chrome/common/hi_res_timer_manager.h b/chrome/common/hi_res_timer_manager.h deleted file mode 100644 index 5610a61..0000000 --- a/chrome/common/hi_res_timer_manager.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2011 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 CHROME_COMMON_HI_RES_TIMER_MANAGER_H_ -#define CHROME_COMMON_HI_RES_TIMER_MANAGER_H_ -#pragma once - -#include "ui/base/system_monitor/system_monitor.h" - -// Ensures that the Windows high resolution timer is only used -// when not running on battery power. -class HighResolutionTimerManager : public ui::SystemMonitor::PowerObserver { - public: - HighResolutionTimerManager(); - virtual ~HighResolutionTimerManager(); - - // ui::SystemMonitor::PowerObserver: - virtual void OnPowerStateChange(bool on_battery_power); - - private: - // Enable or disable the faster multimedia timer. - void UseHiResClock(bool use); - - bool hi_res_clock_used_; - - DISALLOW_COPY_AND_ASSIGN(HighResolutionTimerManager); -}; - -#endif // CHROME_COMMON_HI_RES_TIMER_MANAGER_H_
\ No newline at end of file diff --git a/chrome/common/hi_res_timer_manager_posix.cc b/chrome/common/hi_res_timer_manager_posix.cc deleted file mode 100644 index fc9c1ba..0000000 --- a/chrome/common/hi_res_timer_manager_posix.cc +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2011 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. - -#include "chrome/common/hi_res_timer_manager.h" - -// On POSIX we don't need to do anything special with the system timer. - -HighResolutionTimerManager::HighResolutionTimerManager() - : hi_res_clock_used_(false) { -} - -HighResolutionTimerManager::~HighResolutionTimerManager() { -} - -void HighResolutionTimerManager::OnPowerStateChange(bool on_battery_power) { -} - -void HighResolutionTimerManager::UseHiResClock(bool use) { -} diff --git a/chrome/common/hi_res_timer_manager_win.cc b/chrome/common/hi_res_timer_manager_win.cc deleted file mode 100644 index c165222..0000000 --- a/chrome/common/hi_res_timer_manager_win.cc +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2011 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. - -#include "chrome/common/hi_res_timer_manager.h" - -#include "base/time.h" - -HighResolutionTimerManager::HighResolutionTimerManager() - : hi_res_clock_used_(false) { - ui::SystemMonitor* system_monitor = ui::SystemMonitor::Get(); - system_monitor->AddObserver(this); - UseHiResClock(!system_monitor->BatteryPower()); -} - -HighResolutionTimerManager::~HighResolutionTimerManager() { - ui::SystemMonitor::Get()->RemoveObserver(this); - UseHiResClock(false); -} - -void HighResolutionTimerManager::OnPowerStateChange(bool on_battery_power) { - UseHiResClock(!on_battery_power); -} - -void HighResolutionTimerManager::UseHiResClock(bool use) { - if (use == hi_res_clock_used_) - return; - base::Time::EnableHighResolutionTimer(use); -} |