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

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

Issue 8677012: Refactor the AudioInputDeviceManager by removing the device thread. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 1 month 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/audio_input_device_manager.h
===================================================================
--- content/browser/renderer_host/media/audio_input_device_manager.h (revision 111522)
+++ content/browser/renderer_host/media/audio_input_device_manager.h (working copy)
@@ -7,8 +7,7 @@
// browser IO thread, handles queries like enumerate/open/close from
// MediaStreamManager and start/stop from AudioInputRendererHost.
-// All the queries come from the IO thread, while the work to enumerate devices
-// is done on its own thread.
+// All the queries and work are handled on the IO thread.
#ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_DEVICE_MANAGER_H_
#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_DEVICE_MANAGER_H_
@@ -52,46 +51,17 @@
// Stop the device referenced by the session id.
void Stop(int session_id);
- // Function used for testing to mock platform dependent device code.
- MessageLoop* message_loop();
-
private:
- // Executed on audio_input_device_thread_.
- void EnumerateOnDeviceThread();
- void OpenOnDeviceThread(int session_id, const StreamDeviceInfo& device);
- void CloseOnDeviceThread(int session_id);
- void StartOnDeviceThread(int session_id);
- void StopOnDeviceThread(int session_id);
-
// Executed on IO thread to call Listener.
- void DevicesEnumeratedOnIOThread(const StreamDeviceInfoArray& devices);
+ void DevicesEnumeratedOnIOThread(StreamDeviceInfoArray* devices);
void OpenedOnIOThread(int session_id);
void ClosedOnIOThread(int session_id);
void ErrorOnIOThread(int session_id, MediaStreamProviderError error);
- // Executed on IO thread to call the event handler.
- void StartedOnIOThread(int session_id, const std::string& device_id);
- void StoppedOnIOThread(int session_id);
-
- // Executed on audio_input_device_thread_ to make sure
- // MediaStreamProviderListener is called from IO thread.
- void SignalError(int session_id, MediaStreamProviderError error);
-
- // Helpers.
- bool IsOnCaptureDeviceThread() const;
- void UnregisterEventHandler(int session_id);
- bool HasEventHandler(int session_id);
-
- // Thread for all calls to AudioInputDeviceManager.
- base::Thread audio_input_device_thread_;
-
- // Only accessed on Browser::IO thread.
MediaStreamProviderListener* listener_;
int next_capture_session_id_;
typedef std::map<int, AudioInputDeviceManagerEventHandler*> EventHandlerMap;
EventHandlerMap event_handlers_;
-
- // Only accessed from audio_input_device_thread_.
typedef std::map<int, media::AudioDeviceName> AudioInputDeviceMap;
AudioInputDeviceMap devices_;

Powered by Google App Engine
This is Rietveld 408576698