OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // MessageFilter that handles audio messages and delegates them to audio | 5 // MessageFilter that handles audio messages and delegates them to audio |
6 // renderers. Created on render thread, AudioMessageFilter is operated on | 6 // renderers. Created on render thread, AudioMessageFilter is operated on |
7 // IO thread (main thread of render process), it intercepts audio messages | 7 // IO thread (main thread of render process), it intercepts audio messages |
8 // and process them on IO thread since these messages are time critical. | 8 // and process them on IO thread since these messages are time critical. |
9 | 9 |
10 #ifndef CONTENT_RENDERER_AUDIO_MESSAGE_FILTER_H_ | 10 #ifndef CONTENT_RENDERER_AUDIO_MESSAGE_FILTER_H_ |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 // Called when notification of stream volume is received from the browser | 47 // Called when notification of stream volume is received from the browser |
48 // process. | 48 // process. |
49 virtual void OnVolume(double volume) = 0; | 49 virtual void OnVolume(double volume) = 0; |
50 | 50 |
51 protected: | 51 protected: |
52 virtual ~Delegate() {} | 52 virtual ~Delegate() {} |
53 }; | 53 }; |
54 | 54 |
55 explicit AudioMessageFilter(int32 route_id); | 55 explicit AudioMessageFilter(int32 route_id); |
56 ~AudioMessageFilter(); | 56 virtual ~AudioMessageFilter(); |
57 | 57 |
58 // Add a delegate to the map and return id of the entry. | 58 // Add a delegate to the map and return id of the entry. |
59 int32 AddDelegate(Delegate* delegate); | 59 int32 AddDelegate(Delegate* delegate); |
60 | 60 |
61 // Remove a delegate referenced by |id| from the map. | 61 // Remove a delegate referenced by |id| from the map. |
62 void RemoveDelegate(int32 id); | 62 void RemoveDelegate(int32 id); |
63 | 63 |
64 // Sends an IPC message using |channel_|. | 64 // Sends an IPC message using |channel_|. |
65 bool Send(IPC::Message* message); | 65 bool Send(IPC::Message* message); |
66 | 66 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 IPC::Channel* channel_; | 111 IPC::Channel* channel_; |
112 | 112 |
113 int32 route_id_; | 113 int32 route_id_; |
114 | 114 |
115 MessageLoop* message_loop_; | 115 MessageLoop* message_loop_; |
116 | 116 |
117 DISALLOW_COPY_AND_ASSIGN(AudioMessageFilter); | 117 DISALLOW_COPY_AND_ASSIGN(AudioMessageFilter); |
118 }; | 118 }; |
119 | 119 |
120 #endif // CONTENT_RENDERER_AUDIO_MESSAGE_FILTER_H_ | 120 #endif // CONTENT_RENDERER_AUDIO_MESSAGE_FILTER_H_ |
OLD | NEW |