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

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

Issue 10662049: Move the device enumerate/open/close work to device thread from IO thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ready for review. Created 8 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
Index: content/browser/renderer_host/media/media_stream_manager.h
diff --git a/content/browser/renderer_host/media/media_stream_manager.h b/content/browser/renderer_host/media/media_stream_manager.h
index 17f863e90fda9b5140ee47983298bb4f17ac1026..6a0f8eab1580348e9d7cab8ac0da3ed4567525bd 100644
--- a/content/browser/renderer_host/media/media_stream_manager.h
+++ b/content/browser/renderer_host/media/media_stream_manager.h
@@ -30,19 +30,18 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/supports_user_data.h"
+#include "base/synchronization/waitable_event.h"
scherkus (not reviewing) 2012/06/27 00:52:31 not seeing this used -- remove?
no longer working on chromium 2012/06/27 14:07:16 Sorry, uncleaned code from debugging.
+#include "base/threading/thread.h"
#include "content/browser/renderer_host/media/media_stream_provider.h"
#include "content/browser/renderer_host/media/media_stream_settings_requester.h"
#include "content/common/media/media_stream_options.h"
#include "content/common/content_export.h"
+#include "content/public/browser/browser_thread.h"
namespace content {
class ResourceContext;
}
-namespace media {
-class AudioManager;
-}
-
namespace media_stream {
class AudioInputDeviceManager;
@@ -62,10 +61,10 @@ class CONTENT_EXPORT MediaStreamManager
// Returns the MediaStreamManager for the given ResourceContext. If it hasn't
// been created yet, it will be constructed with the given AudioManager.
static MediaStreamManager* GetForResourceContext(
- content::ResourceContext* resource_context,
- media::AudioManager* audio_manager);
+ content::ResourceContext* resource_context);
+
+ MediaStreamManager();
- explicit MediaStreamManager(media::AudioManager* audio_manager);
virtual ~MediaStreamManager();
// Used to access VideoCaptureManager.
@@ -132,6 +131,8 @@ class CONTENT_EXPORT MediaStreamManager
// devices, which is needed for server based testing.
void UseFakeDevice();
+ scoped_refptr<base::MessageLoopProxy> GetMessageLoop();
+
private:
// Contains all data needed to keep track of requests.
struct DeviceRequest;
@@ -149,6 +150,12 @@ class CONTENT_EXPORT MediaStreamManager
void StartEnumeration(DeviceRequest* new_request,
std::string* label);
+ // Helper to ensure the device thread before passing to device managers.
+ void EnsureDeviceThread();
+
+ // Device thread shared by VideoCaptureManager and AudioInputDeviceManager.
+ scoped_ptr<base::Thread> device_thread_;
+
scoped_ptr<MediaStreamDeviceSettings> device_settings_;
scoped_refptr<VideoCaptureManager> video_capture_manager_;
scoped_refptr<AudioInputDeviceManager> audio_input_device_manager_;
@@ -160,7 +167,6 @@ class CONTENT_EXPORT MediaStreamManager
// All non-closed request.
typedef std::map<std::string, DeviceRequest> DeviceRequests;
DeviceRequests requests_;
- media::AudioManager* audio_manager_;
DISALLOW_COPY_AND_ASSIGN(MediaStreamManager);
};

Powered by Google App Engine
This is Rietveld 408576698