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

Unified Diff: content/browser/renderer_host/media/media_stream_manager.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/browser/power_monitor_message_broadcaster_unittest.cc ('k') | content/child/child_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/media_stream_manager.cc
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc
index af543fc26d562756c7c3a4a2aa2e42cfd572ab9f..ea0d546b193f3d7f0eb3cb86db3a4fd03c449a05 100644
--- a/content/browser/renderer_host/media/media_stream_manager.cc
+++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -361,11 +361,7 @@ MediaStreamManager::MediaStreamManager(media::AudioManager* audio_manager)
base::Unretained(this)));
}
- base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
- // BrowserMainLoop always creates the PowerMonitor instance before creating
- // MediaStreamManager, but power_monitor may be NULL in unit tests.
- if (power_monitor)
- power_monitor->AddObserver(this);
+ base::PowerMonitor::AddObserver(this);
}
MediaStreamManager::~MediaStreamManager() {
@@ -373,11 +369,7 @@ MediaStreamManager::~MediaStreamManager() {
DCHECK(requests_.empty());
DCHECK(!device_task_runner_);
- base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
- // The PowerMonitor instance owned by BrowserMainLoops always outlives the
- // MediaStreamManager, but it may be NULL in unit tests.
- if (power_monitor)
- power_monitor->RemoveObserver(this);
+ base::PowerMonitor::RemoveObserver(this);
}
VideoCaptureManager* MediaStreamManager::video_capture_manager() {
« no previous file with comments | « content/browser/power_monitor_message_broadcaster_unittest.cc ('k') | content/child/child_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698