Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Unified Diff: media/audio/mac/audio_manager_mac.cc

Issue 179923006: Attempting to resolve a race condition with PowerMonitor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Win64 fixes Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/gpu/gpu_watchdog_thread.cc ('k') | net/http/http_network_layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_manager_mac.cc
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
index 60c8a3e7a6cbe5b4aafd98902e0b30462254a914..b9376447477fde133122179be79d196f91bfa3e1 100644
--- a/media/audio/mac/audio_manager_mac.cc
+++ b/media/audio/mac/audio_manager_mac.cc
@@ -226,20 +226,20 @@ class AudioManagerMac::AudioPowerObserver : public base::PowerObserver {
public:
AudioPowerObserver()
: is_suspending_(false),
- is_monitoring_(base::PowerMonitor::Get()) {
+ is_monitoring_(base::PowerMonitor::IsInitialized()) {
// The PowerMonitor requires signifcant setup (a CFRunLoop and preallocated
// IO ports) so it's not available under unit tests. See the OSX impl of
// base::PowerMonitorDeviceSource for more details.
if (!is_monitoring_)
return;
- base::PowerMonitor::Get()->AddObserver(this);
+ base::PowerMonitor::AddObserver(this);
}
virtual ~AudioPowerObserver() {
DCHECK(thread_checker_.CalledOnValidThread());
if (!is_monitoring_)
return;
- base::PowerMonitor::Get()->RemoveObserver(this);
+ base::PowerMonitor::RemoveObserver(this);
}
bool ShouldDeferOutputStreamStart() {
« no previous file with comments | « content/gpu/gpu_watchdog_thread.cc ('k') | net/http/http_network_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698