Index: content/browser/renderer_host/media/video_capture_manager.h |
diff --git a/content/browser/renderer_host/media/video_capture_manager.h b/content/browser/renderer_host/media/video_capture_manager.h |
index 1a0628791efe9b369fd879894fe40f2e7d37dcf4..fe164a1099f5e265552e0ab7fa795fe153c2239a 100644 |
--- a/content/browser/renderer_host/media/video_capture_manager.h |
+++ b/content/browser/renderer_host/media/video_capture_manager.h |
@@ -15,7 +15,6 @@ |
#include <map> |
#include "base/memory/ref_counted.h" |
-#include "base/threading/thread.h" |
#include "content/browser/renderer_host/media/media_stream_provider.h" |
#include "content/common/content_export.h" |
#include "content/common/media/media_stream_options.h" |
@@ -30,13 +29,8 @@ class VideoCaptureControllerEventHandler; |
namespace media_stream { |
// VideoCaptureManager opens/closes and start/stops video capture devices. |
-// It is deleted on the FILE thread so that it can call base::Thread::Stop() |
-// there without blocking UI/IO threads. This is also needed for incognito |
-// window. When incognito window is closed, IO thread is not in shutdown mode |
-// and base::Thread::Stop() can't be called on IO thread. |
class CONTENT_EXPORT VideoCaptureManager |
- : public base::RefCountedThreadSafe<VideoCaptureManager, |
- content::BrowserThread::DeleteOnFileThread>, |
+ : public base::RefCountedThreadSafe<VideoCaptureManager>, |
public MediaStreamProvider { |
public: |
// Calling |Start| of this id will open the first device, even though open has |
@@ -44,7 +38,8 @@ class CONTENT_EXPORT VideoCaptureManager |
// before MediaStream is implemented in Chrome and WebKit. |
enum { kStartOpenSessionId = 1 }; |
- VideoCaptureManager(); |
+ explicit VideoCaptureManager( |
+ scoped_refptr<base::MessageLoopProxy> message_loop); |
// Implements MediaStreamProvider. |
virtual void Register(MediaStreamProviderListener* listener) OVERRIDE; |
@@ -78,7 +73,6 @@ class CONTENT_EXPORT VideoCaptureManager |
// video capture device. Due to timing requirements, the function must be |
// called before EnumerateDevices and Open. |
void UseFakeDevice(); |
- MessageLoop* GetMessageLoop(); |
// Called by VideoCaptureHost to get a controller for |capture_params|. |
// The controller is returned via calling |added_cb|. |
@@ -93,11 +87,7 @@ class CONTENT_EXPORT VideoCaptureManager |
private: |
friend class ::MockVideoCaptureManager; |
- friend struct content::BrowserThread::DeleteOnThread< |
- content::BrowserThread::FILE>; |
- friend class base::DeleteHelper<VideoCaptureManager>; |
- friend class base::RefCountedThreadSafe<VideoCaptureManager, |
- content::BrowserThread::DeleteOnFileThread>; |
+ friend class base::RefCountedThreadSafe<VideoCaptureManager>; |
virtual ~VideoCaptureManager(); |
@@ -142,8 +132,8 @@ class CONTENT_EXPORT VideoCaptureManager |
bool IsOnCaptureDeviceThread() const; |
media::VideoCaptureDevice* GetDeviceInternal(int capture_session_id); |
- // Thread for all calls to VideoCaptureDevice. |
- base::Thread vc_device_thread_; |
+ // The message loop of media stream device thread that this object runs on. |
+ scoped_refptr<base::MessageLoopProxy> message_loop_; |
// Only accessed on Browser::IO thread. |
MediaStreamProviderListener* listener_; |