Chromium Code Reviews| 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..dc4111372718ad7d456e2a0db18abf7ab6330408 100644 |
| --- a/content/browser/renderer_host/media/media_stream_manager.cc |
| +++ b/content/browser/renderer_host/media/media_stream_manager.cc |
| @@ -4,6 +4,8 @@ |
| #include "content/browser/renderer_host/media/media_stream_manager.h" |
| +#include <objbase.h> |
|
tommi (sloooow) - chröme
2012/07/06 22:17:09
won't this cause problems on non windows platforms
grt (UTC plus 2)
2012/07/06 23:07:25
what non-windows platforms? ;-)
|
| + |
| #include <list> |
| #include "base/bind.h" |
| @@ -56,6 +58,24 @@ static bool Requested(const StreamOptions& options, |
| return false; |
| } |
| +DeviceThread::DeviceThread(const char* name) |
| + : base::Thread(name), com_initialized_() { |
| +} |
| + |
| +void DeviceThread::Init() { |
| + // Enter the multi-threaded apartment. |
| + HRESULT hr = ::CoInitializeEx(NULL, COINIT_MULTITHREADED); |
|
tommi (sloooow) - chröme
2012/07/06 22:17:09
I thought that this file was a cross platform file
|
| + DCHECK_EQ(hr, S_OK); |
| + com_initialized_ = SUCCEEDED(hr); |
| +} |
| + |
| +void DeviceThread::CleanUp() { |
| + if (com_initialized_) { |
| + CoUninitialize(); |
| + com_initialized_ = false; |
| + } |
| +} |
| + |
| // TODO(xians): Merge DeviceRequest with MediaStreamRequest. |
| struct MediaStreamManager::DeviceRequest { |
| enum RequestState { |