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 efc80a7692eb099d651bf0c9cac7968084f1efbf..396b415380cdaa1eee4eee88eb02c586654f297c 100644 |
--- a/content/renderer/media/audio_message_filter.h |
+++ b/content/renderer/media/audio_message_filter.h |
@@ -14,41 +14,38 @@ |
#include "base/id_map.h" |
#include "base/shared_memory.h" |
#include "base/sync_socket.h" |
-#include "content/common/media/audio_stream_state.h" |
#include "content/common/content_export.h" |
#include "ipc/ipc_channel_proxy.h" |
#include "media/audio/audio_buffers_state.h" |
+#include "media/audio/audio_device_ipc.h" |
class CONTENT_EXPORT AudioMessageFilter |
- : public IPC::ChannelProxy::MessageFilter { |
+ : public IPC::ChannelProxy::MessageFilter, |
+ public NON_EXPORTED_BASE(media::AudioDeviceIPC) { |
public: |
- class CONTENT_EXPORT Delegate { |
- public: |
- // Called when state of an audio stream has changed in the browser process. |
- virtual void OnStateChanged(AudioStreamState state) = 0; |
- |
- // Called when an audio stream has been created in the browser process. |
- virtual void OnStreamCreated(base::SharedMemoryHandle handle, |
- base::SyncSocket::Handle socket_handle, |
- uint32 length) = 0; |
- |
- protected: |
- virtual ~Delegate() {} |
- }; |
- |
AudioMessageFilter(); |
// Getter for the one AudioMessageFilter object. |
static AudioMessageFilter* Get(); |
// Add a delegate to the map and return id of the entry. |
scherkus (not reviewing)
2012/07/23 22:57:51
replace this comment + one below with "media::Audi
tommi (sloooow) - chröme
2012/07/24 09:49:44
Done.
|
- int32 AddDelegate(Delegate* delegate); |
+ virtual int AddDelegate(media::AudioDeviceIPCDelegate* delegate) OVERRIDE; |
// Remove a delegate referenced by |id| from the map. |
- void RemoveDelegate(int32 id); |
+ virtual void RemoveDelegate(int id) OVERRIDE; |
+ |
+ virtual void CreateStream(int stream_id, |
+ const media::AudioParameters& params) OVERRIDE; |
+ virtual void PlayStream(int stream_id) OVERRIDE; |
+ virtual void PauseStream(int stream_id) OVERRIDE; |
+ virtual void FlushStream(int stream_id) OVERRIDE; |
+ virtual void CloseStream(int stream_id) OVERRIDE; |
+ virtual void SetVolume(int stream_id, double volume) OVERRIDE; |
// Sends an IPC message using |channel_|. |
// This method is virtual so that it can be overridden in tests. |
+ // TODO(tommi): Make this method non-virtual when we don't need to override |
+ // it in tests or possibly just remove it. |
virtual bool Send(IPC::Message* message); |
// IPC::ChannelProxy::MessageFilter override. Called on IO thread. |
@@ -73,16 +70,15 @@ class CONTENT_EXPORT AudioMessageFilter |
#endif |
uint32 length); |
- |
// Received when internal state of browser process' audio output device has |
// changed. |
- void OnStreamStateChanged(int stream_id, AudioStreamState state); |
+ void OnStreamStateChanged(int stream_id, media::AudioStreamState state); |
// The singleton instance for this filter. |
static AudioMessageFilter* filter_; |
// A map of stream ids to delegates. |
- IDMap<Delegate> delegates_; |
+ IDMap<media::AudioDeviceIPCDelegate> delegates_; |
IPC::Channel* channel_; |