Chromium Code Reviews| Index: content/renderer/media/audio_input_message_filter.h |
| diff --git a/content/renderer/media/audio_input_message_filter.h b/content/renderer/media/audio_input_message_filter.h |
| index ba5e9def33ee31d395488bf664933db518b8b263..97749968c7e81b135f34f7c052b6086c6cfe3fe6 100644 |
| --- a/content/renderer/media/audio_input_message_filter.h |
| +++ b/content/renderer/media/audio_input_message_filter.h |
| @@ -14,50 +14,33 @@ |
| #include "base/shared_memory.h" |
| #include "base/sync_socket.h" |
| #include "content/common/content_export.h" |
| -#include "content/common/media/audio_stream_state.h" |
| #include "ipc/ipc_channel_proxy.h" |
| #include "media/audio/audio_buffers_state.h" |
| +#include "media/audio/audio_input_device_ipc.h" |
| class CONTENT_EXPORT AudioInputMessageFilter |
| - : public IPC::ChannelProxy::MessageFilter { |
| + : public IPC::ChannelProxy::MessageFilter, |
| + public NON_EXPORTED_BASE(media::AudioInputDeviceIPC) { |
| public: |
| - class CONTENT_EXPORT Delegate { |
| - public: |
| - // Called when an audio input stream has been created in the browser |
| - // process. |
| - virtual void OnStreamCreated(base::SharedMemoryHandle handle, |
| - base::SyncSocket::Handle socket_handle, |
| - uint32 length) = 0; |
| - |
| - // Called when notification of input stream volume is received from the |
| - // browser process. |
| - virtual void OnVolume(double volume) = 0; |
| - |
| - // Called when state of an input stream has changed in the browser process. |
| - virtual void OnStateChanged(AudioStreamState state) = 0; |
| - |
| - // Called when the device referenced by the index has been started in |
| - // the browswer process. |
| - virtual void OnDeviceReady(const std::string& device_id) = 0; |
| - |
| - protected: |
| - virtual ~Delegate() {} |
| - }; |
| - |
| AudioInputMessageFilter(); |
| - // Add a delegate to the map and return id of the entry. |
| - int32 AddDelegate(Delegate* delegate); |
| + // Implementation of AudioInputDeviceIPC. |
| + virtual int AddDelegate( |
| + media::AudioInputDeviceIPCDelegate* delegate) OVERRIDE; |
| + virtual void RemoveDelegate(int id) OVERRIDE; |
| + virtual void CreateStream(int stream_id, const media::AudioParameters& params, |
| + const std::string& device_id, bool automatic_gain_control) OVERRIDE; |
| + virtual void StartDevice(int stream_id, int session_id) OVERRIDE; |
| + virtual void RecordStream(int stream_id) OVERRIDE; |
| + virtual void CloseStream(int stream_id) OVERRIDE; |
| + virtual void SetVolume(int stream_id, double volume) OVERRIDE; |
| - // Remove a delegate referenced by |id| from the map. |
| - void RemoveDelegate(int32 id); |
| + private: |
| + virtual ~AudioInputMessageFilter(); |
| // Sends an IPC message using |channel_|. |
| bool Send(IPC::Message* message); |
| - private: |
| - virtual ~AudioInputMessageFilter(); |
| - |
| // IPC::ChannelProxy::MessageFilter override. Called on IO thread. |
| virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; |
| @@ -78,13 +61,14 @@ class CONTENT_EXPORT AudioInputMessageFilter |
| // Received when internal state of browser process' audio input stream has |
| // changed. |
| - void OnStreamStateChanged(int stream_id, AudioStreamState state); |
| + void OnStreamStateChanged(int stream_id, |
|
scherkus (not reviewing)
2012/07/24 17:57:48
indent
tommi (sloooow) - chröme
2012/07/25 13:46:17
Done.
|
| + media::AudioInputDeviceIPCDelegate::State state); |
| // Notification of the opened device of an audio session. |
| void OnDeviceStarted(int stream_id, const std::string& device_id); |
| // A map of stream ids to delegates. |
| - IDMap<Delegate> delegates_; |
| + IDMap<media::AudioInputDeviceIPCDelegate> delegates_; |
| IPC::Channel* channel_; |