| 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 bd6a0e12623c4103e475c7897ed5a2c95089046a..fcba0a78849fa1e638ef4452e9c00a3036caa7d1 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,8 +24,7 @@ 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);
|
| @@ -32,29 +32,22 @@ class CONTENT_EXPORT AudioInputMessageFilter
|
| // 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,
|
| - int session_id,
|
| - const media::AudioParameters& params,
|
| - bool automatic_gain_control,
|
| - uint32 total_segments) 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_|.
|
| @@ -91,12 +84,12 @@ 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_;
|
|
|
| + // The singleton instance for this filter.
|
| + static AudioInputMessageFilter* g_filter;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(AudioInputMessageFilter);
|
| };
|
|
|
|
|