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

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

Issue 11048029: Allow Thread to initialize COM for Windows consumers who need it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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
Index: content/browser/renderer_host/media/media_stream_manager.cc
===================================================================
--- content/browser/renderer_host/media/media_stream_manager.cc (revision 163371)
+++ content/browser/renderer_host/media/media_stream_manager.cc (working copy)
@@ -10,6 +10,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_controller.h"
@@ -61,24 +62,6 @@
options.video_type == stream_type);
}
-#if defined(OS_WIN)
-DeviceThread::DeviceThread(const char* name) : base::Thread(name) {
-}
-
-DeviceThread::~DeviceThread() {
- Stop();
-}
-
-void DeviceThread::Init() {
- com_initializer_.reset(new base::win::ScopedCOMInitializer(
- base::win::ScopedCOMInitializer::kMTA));
-}
-
-void DeviceThread::CleanUp() {
- com_initializer_.reset();
-}
-#endif
-
// TODO(xians): Merge DeviceRequest with MediaStreamRequest.
class MediaStreamManager::DeviceRequest {
public:
@@ -588,7 +571,10 @@
if (device_thread_.get())
return;
- device_thread_.reset(new DeviceThread("MediaStreamDeviceThread"));
+ 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_ =
« no previous file with comments | « content/browser/renderer_host/media/media_stream_manager.h ('k') | media/audio/audio_input_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698