| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_RENDERER_AUDIO_MESSAGE_FILTER_H_ | 10 #ifndef CHROME_RENDERER_AUDIO_MESSAGE_FILTER_H_ |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // Called when state of an audio stream has changed in the browser process. | 26 // Called when state of an audio stream has changed in the browser process. |
| 27 virtual void OnStateChanged(ViewMsg_AudioStreamState state) = 0; | 27 virtual void OnStateChanged(ViewMsg_AudioStreamState state) = 0; |
| 28 | 28 |
| 29 // Called when an audio stream has been created in the browser process. | 29 // Called when an audio stream has been created in the browser process. |
| 30 virtual void OnCreated(base::SharedMemoryHandle handle, size_t length) = 0; | 30 virtual void OnCreated(base::SharedMemoryHandle handle, size_t length) = 0; |
| 31 | 31 |
| 32 // Called when notification of stream volume is received from the browser | 32 // Called when notification of stream volume is received from the browser |
| 33 // process. | 33 // process. |
| 34 virtual void OnVolume(double left, double right) = 0; | 34 virtual void OnVolume(double left, double right) = 0; |
| 35 | |
| 36 protected: | |
| 37 ~Delegate() {} | |
| 38 }; | 35 }; |
| 39 | 36 |
| 40 AudioMessageFilter(int32 route_id); | 37 AudioMessageFilter(int32 route_id); |
| 41 ~AudioMessageFilter(); | 38 ~AudioMessageFilter(); |
| 42 | 39 |
| 43 // Add a delegate to the map and return id of the entry. | 40 // Add a delegate to the map and return id of the entry. |
| 44 int32 AddDelegate(Delegate* delegate); | 41 int32 AddDelegate(Delegate* delegate); |
| 45 | 42 |
| 46 // Remove a delegate referenced by |id| from the map. | 43 // Remove a delegate referenced by |id| from the map. |
| 47 void RemoveDelegate(int32 id); | 44 void RemoveDelegate(int32 id); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 IPC::Channel* channel_; | 79 IPC::Channel* channel_; |
| 83 | 80 |
| 84 int32 route_id_; | 81 int32 route_id_; |
| 85 | 82 |
| 86 MessageLoop* message_loop_; | 83 MessageLoop* message_loop_; |
| 87 | 84 |
| 88 DISALLOW_COPY_AND_ASSIGN(AudioMessageFilter); | 85 DISALLOW_COPY_AND_ASSIGN(AudioMessageFilter); |
| 89 }; | 86 }; |
| 90 | 87 |
| 91 #endif // CHROME_RENDERER_AUDIO_MESSAGE_FITLER_H_ | 88 #endif // CHROME_RENDERER_AUDIO_MESSAGE_FITLER_H_ |
| OLD | NEW |