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

Unified Diff: trunk/src/content/browser/renderer_host/media/media_stream_manager.cc

Issue 18325021: Revert 208403 "Remove MediaStreamDeviceThread in favor of using ..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 6 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 | « trunk/src/content/browser/renderer_host/media/media_stream_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/content/browser/renderer_host/media/media_stream_manager.cc
===================================================================
--- trunk/src/content/browser/renderer_host/media/media_stream_manager.cc (revision 210020)
+++ trunk/src/content/browser/renderer_host/media/media_stream_manager.cc (working copy)
@@ -11,6 +11,7 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/rand_util.h"
+#include "base/threading/thread.h"
#include "content/browser/renderer_host/media/audio_input_device_manager.h"
#include "content/browser/renderer_host/media/media_stream_requester.h"
#include "content/browser/renderer_host/media/media_stream_ui_proxy.h"
@@ -148,7 +149,7 @@
MediaStreamManager::~MediaStreamManager() {
DCHECK(requests_.empty());
- DCHECK(!device_loop_.get());
+ DCHECK(!device_thread_.get());
DCHECK(!io_loop_);
}
@@ -585,15 +586,22 @@
void MediaStreamManager::InitializeDeviceManagersOnIOThread() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- if (device_loop_.get())
+ if (device_thread_)
return;
- device_loop_ = audio_manager_->GetMessageLoop();
+ device_thread_.reset(new base::Thread("MediaStreamDeviceThread"));
+#if defined(OS_WIN)
+ device_thread_->init_com_with_mta(true);
+#endif
+ CHECK(device_thread_->Start());
+
audio_input_device_manager_ = new AudioInputDeviceManager(audio_manager_);
- audio_input_device_manager_->Register(this, device_loop_.get());
+ audio_input_device_manager_->Register(
+ this, device_thread_->message_loop_proxy().get());
video_capture_manager_ = new VideoCaptureManager();
- video_capture_manager_->Register(this, device_loop_.get());
+ video_capture_manager_->Register(this,
+ device_thread_->message_loop_proxy().get());
// We want to be notified of IO message loop destruction to delete the thread
// and the device managers.
@@ -937,12 +945,12 @@
void MediaStreamManager::WillDestroyCurrentMessageLoop() {
DCHECK_EQ(base::MessageLoop::current(), io_loop_);
DCHECK(requests_.empty());
- if (device_loop_.get()) {
+ if (device_thread_) {
StopMonitoring();
video_capture_manager_->Unregister();
audio_input_device_manager_->Unregister();
- device_loop_ = NULL;
+ device_thread_.reset();
}
audio_input_device_manager_ = NULL;
« no previous file with comments | « trunk/src/content/browser/renderer_host/media/media_stream_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698