| 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_ |
| 11 #define CONTENT_RENDERER_AUDIO_MESSAGE_FILTER_H_ | 11 #define CONTENT_RENDERER_AUDIO_MESSAGE_FILTER_H_ |
| 12 #pragma once | 12 #pragma once |
| 13 | 13 |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/id_map.h" | 15 #include "base/id_map.h" |
| 16 #include "base/shared_memory.h" | 16 #include "base/shared_memory.h" |
| 17 #include "base/sync_socket.h" | 17 #include "base/sync_socket.h" |
| 18 #include "content/common/audio_stream_state.h" | 18 #include "content/common/audio_stream_state.h" |
| 19 #include "ipc/ipc_channel_proxy.h" | 19 #include "ipc/ipc_channel_proxy.h" |
| 20 #include "media/audio/audio_buffers_state.h" | 20 #include "media/audio/audio_buffers_state.h" |
| 21 | 21 |
| 22 class MessageLoop; |
| 23 |
| 22 namespace base { | 24 namespace base { |
| 23 class Time; | 25 class Time; |
| 24 } | 26 } |
| 25 | 27 |
| 26 class AudioMessageFilter : public IPC::ChannelProxy::MessageFilter { | 28 class AudioMessageFilter : public IPC::ChannelProxy::MessageFilter { |
| 27 public: | 29 public: |
| 28 class Delegate { | 30 class Delegate { |
| 29 public: | 31 public: |
| 30 // Called when an audio packet is requested from the browser process. | 32 // Called when an audio packet is requested from the browser process. |
| 31 virtual void OnRequestPacket(AudioBuffersState buffers_state) = 0; | 33 virtual void OnRequestPacket(AudioBuffersState buffers_state) = 0; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 IPC::Channel* channel_; | 111 IPC::Channel* channel_; |
| 110 | 112 |
| 111 int32 route_id_; | 113 int32 route_id_; |
| 112 | 114 |
| 113 MessageLoop* message_loop_; | 115 MessageLoop* message_loop_; |
| 114 | 116 |
| 115 DISALLOW_COPY_AND_ASSIGN(AudioMessageFilter); | 117 DISALLOW_COPY_AND_ASSIGN(AudioMessageFilter); |
| 116 }; | 118 }; |
| 117 | 119 |
| 118 #endif // CONTENT_RENDERER_AUDIO_MESSAGE_FILTER_H_ | 120 #endif // CONTENT_RENDERER_AUDIO_MESSAGE_FILTER_H_ |
| OLD | NEW |