OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_ |
6 #define CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_ | 6 #define CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_ |
7 | 7 |
8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // stream_id and the destination render_view_id. | 47 // stream_id and the destination render_view_id. |
48 class AudioInputIPCImpl; | 48 class AudioInputIPCImpl; |
49 | 49 |
50 virtual ~AudioInputMessageFilter(); | 50 virtual ~AudioInputMessageFilter(); |
51 | 51 |
52 // Sends an IPC message using |channel_|. | 52 // Sends an IPC message using |channel_|. |
53 void Send(IPC::Message* message); | 53 void Send(IPC::Message* message); |
54 | 54 |
55 // IPC::MessageFilter override. Called on |io_message_loop_|. | 55 // IPC::MessageFilter override. Called on |io_message_loop_|. |
56 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 56 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
57 virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE; | 57 virtual void OnFilterAdded(IPC::Sender* sender) OVERRIDE; |
58 virtual void OnFilterRemoved() OVERRIDE; | 58 virtual void OnFilterRemoved() OVERRIDE; |
59 virtual void OnChannelClosing() OVERRIDE; | 59 virtual void OnChannelClosing() OVERRIDE; |
60 | 60 |
61 // Received when browser process has created an audio input stream. | 61 // Received when browser process has created an audio input stream. |
62 void OnStreamCreated(int stream_id, | 62 void OnStreamCreated(int stream_id, |
63 base::SharedMemoryHandle handle, | 63 base::SharedMemoryHandle handle, |
64 #if defined(OS_WIN) | 64 #if defined(OS_WIN) |
65 base::SyncSocket::Handle socket_handle, | 65 base::SyncSocket::Handle socket_handle, |
66 #else | 66 #else |
67 base::FileDescriptor socket_descriptor, | 67 base::FileDescriptor socket_descriptor, |
68 #endif | 68 #endif |
69 uint32 length, | 69 uint32 length, |
70 uint32 total_segments); | 70 uint32 total_segments); |
71 | 71 |
72 // Notification of volume property of an audio input stream. | 72 // Notification of volume property of an audio input stream. |
73 void OnStreamVolume(int stream_id, double volume); | 73 void OnStreamVolume(int stream_id, double volume); |
74 | 74 |
75 // Received when internal state of browser process' audio input stream has | 75 // Received when internal state of browser process' audio input stream has |
76 // changed. | 76 // changed. |
77 void OnStreamStateChanged(int stream_id, | 77 void OnStreamStateChanged(int stream_id, |
78 media::AudioInputIPCDelegate::State state); | 78 media::AudioInputIPCDelegate::State state); |
79 | 79 |
80 // A map of stream ids to delegates. | 80 // A map of stream ids to delegates. |
81 IDMap<media::AudioInputIPCDelegate> delegates_; | 81 IDMap<media::AudioInputIPCDelegate> delegates_; |
82 | 82 |
83 // IPC channel for Send(), must only be accesed on |io_message_loop_|. | 83 // IPC sender for Send(), must only be accesed on |io_message_loop_|. |
84 IPC::Channel* channel_; | 84 IPC::Sender* sender_; |
85 | 85 |
86 // Message loop on which IPC calls are driven. | 86 // Message loop on which IPC calls are driven. |
87 const scoped_refptr<base::MessageLoopProxy> io_message_loop_; | 87 const scoped_refptr<base::MessageLoopProxy> io_message_loop_; |
88 | 88 |
89 // The singleton instance for this filter. | 89 // The singleton instance for this filter. |
90 static AudioInputMessageFilter* g_filter; | 90 static AudioInputMessageFilter* g_filter; |
91 | 91 |
92 DISALLOW_COPY_AND_ASSIGN(AudioInputMessageFilter); | 92 DISALLOW_COPY_AND_ASSIGN(AudioInputMessageFilter); |
93 }; | 93 }; |
94 | 94 |
95 } // namespace content | 95 } // namespace content |
96 | 96 |
97 #endif // CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_ | 97 #endif // CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_ |
OLD | NEW |