Chromium Code Reviews| Index: content/renderer/media/audio_message_filter.h |
| diff --git a/content/renderer/media/audio_message_filter.h b/content/renderer/media/audio_message_filter.h |
| index 47a5ed8c8da4ee75c2cb5133bd387bf078908e6c..ecef3fbb37d67dc7cdd1df7bfe170ba9dedf321e 100644 |
| --- a/content/renderer/media/audio_message_filter.h |
| +++ b/content/renderer/media/audio_message_filter.h |
| @@ -19,6 +19,8 @@ |
| #include "ipc/message_filter.h" |
| #include "media/audio/audio_output_ipc.h" |
| #include "media/base/audio_hardware_config.h" |
| +#include "media/mojo/interfaces/audio_output.mojom.h" |
| +#include "content/renderer/media/audio_output_client.h" |
| namespace base { |
| class SingleThreadTaskRunner; |
| @@ -46,11 +48,32 @@ class CONTENT_EXPORT AudioMessageFilter : public IPC::MessageFilter { |
| std::unique_ptr<media::AudioOutputIPC> CreateAudioOutputIPC( |
| int render_frame_id); |
| + virtual void CloseStream(int stream_id); |
|
Henrik Grunell
2016/05/20 13:35:40
Add comment describing the function.
|
| + |
| // IO task runner associated with this message filter. |
| base::SingleThreadTaskRunner* io_task_runner() const { |
| return io_task_runner_.get(); |
| } |
| + // Setter for |audio_output_client_|. |
|
Henrik Grunell
2016/05/20 13:35:40
This is a registration, i.e. multiple clients can
rchtara
2016/05/27 15:24:38
we dont , there owned by the AMF so they are going
|
| + void set_audio_output_client( |
| + int id, |
| + scoped_refptr<content::AudioOutputClient> audio_output_client) { |
| + audio_output_clients_.insert(std::make_pair(id, audio_output_client)); |
|
Henrik Grunell
2016/05/20 13:35:41
Remove make_pair.
|
| + } |
| + |
| + // Received when browser process has created an audio output stream. |
| + virtual void OnStreamCreated( |
|
Henrik Grunell
2016/05/20 13:35:41
They are public because called by a AudioOutputCli
rchtara
2016/05/27 15:24:38
Done.
|
| + int stream_id, |
| + base::SharedMemoryHandle handle, |
| + base::SyncSocket::TransitDescriptor socket_descriptor, |
| + uint32_t length); |
| + |
| + // Received when internal state of browser process' audio output device has |
| + // changed. |
| + virtual void OnStreamStateChanged(int stream_id, |
|
Henrik Grunell
2016/05/20 13:35:40
Leave the OnStreamStateChanged as private. Add a p
rchtara
2016/05/27 15:24:38
Done.
|
| + media::AudioOutputIPCDelegateState state); |
| + |
| protected: |
| ~AudioMessageFilter() override; |
| @@ -78,23 +101,14 @@ class CONTENT_EXPORT AudioMessageFilter : public IPC::MessageFilter { |
| const media::AudioParameters& output_params, |
| const std::string& matched_device_id); |
| - // Received when browser process has created an audio output stream. |
| - void OnStreamCreated(int stream_id, |
| - base::SharedMemoryHandle handle, |
| - base::SyncSocket::TransitDescriptor socket_descriptor, |
| - uint32_t length); |
| - |
| - // Received when internal state of browser process' audio output device has |
| - // changed. |
| - void OnStreamStateChanged(int stream_id, |
| - media::AudioOutputIPCDelegateState state); |
| - |
| // IPC sender for Send(); must only be accessed on |io_task_runner_|. |
| IPC::Sender* sender_; |
| // A map of stream ids to delegates; must only be accessed on |
| // |io_task_runner_|. |
| IDMap<media::AudioOutputIPCDelegate> delegates_; |
| + std::map<int, scoped_refptr<content::AudioOutputClient>> |
| + audio_output_clients_; |
| // Task runner on which IPC calls are executed. |
| const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |