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

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

Issue 10744002: Fix COM initialization on media thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc
index 3f5a8043c46d4e604fdd620b7c29428a9850fbf8..66168e33424150d8b1f9b7cd9bfe1109f13b15ff 100644
--- a/content/browser/renderer_host/media/media_stream_manager.cc
+++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -10,6 +10,7 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/rand_util.h"
+#include "base/win/scoped_com_initializer.h"
#include "content/browser/renderer_host/media/audio_input_device_manager.h"
#include "content/browser/renderer_host/media/media_stream_device_settings.h"
#include "content/browser/renderer_host/media/media_stream_requester.h"
@@ -56,6 +57,23 @@ static bool Requested(const StreamOptions& options,
return false;
}
+DeviceThread::DeviceThread(const char* name)
+ : base::Thread(name) {
+}
+
+DeviceThread::~DeviceThread() {
+}
+
+void DeviceThread::Init() {
+ using base::win::ScopedCOMInitializer;
+ // Enter the multi-threaded apartment.
+ com_initializer_.reset(new ScopedCOMInitializer(ScopedCOMInitializer::kMTA));
+}
+
+void DeviceThread::CleanUp() {
+ com_initializer_.reset();
+}
+
// TODO(xians): Merge DeviceRequest with MediaStreamRequest.
struct MediaStreamManager::DeviceRequest {
enum RequestState {
« no previous file with comments | « content/browser/renderer_host/media/media_stream_manager.h ('k') | media/audio/win/device_enumeration_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698