Chromium Code Reviews| Index: content/renderer/media/media_stream_dispatcher.h |
| =================================================================== |
| --- content/renderer/media/media_stream_dispatcher.h (revision 148913) |
| +++ content/renderer/media/media_stream_dispatcher.h (working copy) |
| @@ -52,6 +52,11 @@ |
| media_stream::MediaStreamType type, |
| const GURL& security_origin); |
| + // Request to stop enumerating devices. |
| + void StopEnumerateDevices( |
| + int request_id, |
| + const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler); |
| + |
| // Request to open a device. |
| void OpenDevice( |
| int request_id, |
| @@ -83,6 +88,29 @@ |
| // opened it. |
| struct Stream; |
| + struct EnumerationRequest { |
| + EnumerationRequest( |
| + const base::WeakPtr<MediaStreamDispatcherEventHandler>& handler, |
| + int request_id); |
| + |
| + base::WeakPtr<MediaStreamDispatcherEventHandler> handler; |
| + int request_id; |
| + }; |
| + |
| + // List of requests made to EnumerateDevices. |
| + typedef std::list<EnumerationRequest> EnumerationRequestList; |
| + |
| + struct EnumerationState { |
| + EnumerationState(); |
| + |
| + bool started; |
| + int ipc_id; |
| + std::string label; |
| + bool cache_valid; |
| + media_stream::StreamDeviceInfoArray cached_device; |
| + EnumerationRequestList requests; |
| + }; |
| + |
| // Messages from the browser. |
| virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| void OnStreamGenerated( |
| @@ -95,6 +123,7 @@ |
| void OnAudioDeviceFailed(const std::string& label, int index); |
| void OnDevicesEnumerated( |
| int request_id, |
| + const std::string& label, |
| const media_stream::StreamDeviceInfoArray& device_array); |
| void OnDevicesEnumerationFailed(int request_id); |
| void OnDeviceOpened( |
| @@ -103,10 +132,21 @@ |
| const media_stream::StreamDeviceInfo& device_info); |
| void OnDeviceOpenFailed(int request_id); |
| + bool RemoveEnumerationRequest( |
| + int request_id, |
| + const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler, |
| + EnumerationState* state); |
| + |
| + // Used for DCHECKs so methods calls won't execute in the wrong thread. |
| + MessageLoop* main_loop_; |
|
tommi (sloooow) - chröme
2012/08/01 10:21:38
Remember John's comment on MessageLoop pointers.
wjia(left Chromium)
2012/08/01 14:24:03
Right. Changed to MLP.
|
| + |
| int next_ipc_id_; |
| typedef std::map<std::string, Stream> LabelStreamMap; |
| LabelStreamMap label_stream_map_; |
| + EnumerationState audio_enumeration_state_; |
| + EnumerationState video_enumeration_state_; |
| + |
| // List of calls made to GenerateStream that has not yet completed. |
| typedef std::list<Request> RequestList; |
| RequestList requests_; |