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 82af71e8717f3975770a556a79e2fe5ca80fa186..431be3657f29abbf7fa2954dcb4a5f0f11d1d214 100644 |
--- a/content/renderer/media/audio_input_message_filter.h |
+++ b/content/renderer/media/audio_input_message_filter.h |
@@ -6,6 +6,7 @@ |
#define CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_ |
#include "base/id_map.h" |
+#include "base/memory/scoped_ptr.h" |
#include "base/shared_memory.h" |
#include "base/sync_socket.h" |
#include "content/common/content_export.h" |
@@ -23,35 +24,27 @@ namespace content { |
// IO thread (secondary thread of render process), it intercepts audio messages |
// and process them on IO thread since these messages are time critical. |
class CONTENT_EXPORT AudioInputMessageFilter |
- : public IPC::ChannelProxy::MessageFilter, |
- public NON_EXPORTED_BASE(media::AudioInputIPC) { |
+ : public IPC::ChannelProxy::MessageFilter { |
public: |
explicit AudioInputMessageFilter( |
const scoped_refptr<base::MessageLoopProxy>& io_message_loop); |
- // Getter for the one AudioInputMessageFilter object. |
- static AudioInputMessageFilter* Get(); |
- |
- // Associates |render_view_id| as the destination of audio for a stream. |
- void AssociateStreamWithConsumer(int stream_id, int render_view_id); |
- |
- // Implementation of AudioInputIPC. All methods must be called on the |
- // provided |io_message_loop|. |
- virtual int AddDelegate( |
- media::AudioInputIPCDelegate* 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; |
+ // Create an AudioInputIPC to be owned by one delegate. |render_view_id| is |
+ // the render view containing the entity consuming the audio. |
+ // |
+ // The returned object is not thread-safe, and must be used on |
+ // |io_message_loop|. |
+ scoped_ptr<media::AudioInputIPC> CreateAudioInputIPC(int render_view_id); |
scoped_refptr<base::MessageLoopProxy> io_message_loop() const { |
return io_message_loop_; |
} |
private: |
+ // Implementation of media::AudioInputIPC which augments IPC calls with |
+ // stream_id and the destination render_view_id. |
+ class AudioInputIPCImpl; |
+ |
virtual ~AudioInputMessageFilter(); |
// Sends an IPC message using |channel_|. |
@@ -89,9 +82,6 @@ class CONTENT_EXPORT AudioInputMessageFilter |
// IPC channel for Send(), must only be accesed on |io_message_loop_|. |
IPC::Channel* channel_; |
- // The singleton instance for this filter. |
- static AudioInputMessageFilter* filter_; |
- |
// Message loop on which IPC calls are driven. |
const scoped_refptr<base::MessageLoopProxy> io_message_loop_; |