OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "content/renderer/media/audio_input_message_filter.h" | 5 #include "content/renderer/media/audio_input_message_filter.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "content/common/child_process.h" | 10 #include "content/common/child_process.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 if (!channel_) { | 24 if (!channel_) { |
25 delete message; | 25 delete message; |
26 return false; | 26 return false; |
27 } | 27 } |
28 | 28 |
29 if (MessageLoop::current() != ChildProcess::current()->io_message_loop()) { | 29 if (MessageLoop::current() != ChildProcess::current()->io_message_loop()) { |
30 // Can only access the IPC::Channel on the IPC thread since it's not thread | 30 // Can only access the IPC::Channel on the IPC thread since it's not thread |
31 // safe. | 31 // safe. |
32 ChildProcess::current()->io_message_loop()->PostTask( | 32 ChildProcess::current()->io_message_loop()->PostTask( |
33 FROM_HERE, | 33 FROM_HERE, |
34 base::IgnoreReturn<bool>(base::Bind(&AudioInputMessageFilter::Send, | 34 base::Bind(base::IgnoreResult(&AudioInputMessageFilter::Send), this, |
35 this, message))); | 35 message)); |
36 return true; | 36 return true; |
37 } | 37 } |
38 | 38 |
39 return channel_->Send(message); | 39 return channel_->Send(message); |
40 } | 40 } |
41 | 41 |
42 bool AudioInputMessageFilter::OnMessageReceived(const IPC::Message& message) { | 42 bool AudioInputMessageFilter::OnMessageReceived(const IPC::Message& message) { |
43 bool handled = true; | 43 bool handled = true; |
44 IPC_BEGIN_MESSAGE_MAP(AudioInputMessageFilter, message) | 44 IPC_BEGIN_MESSAGE_MAP(AudioInputMessageFilter, message) |
45 IPC_MESSAGE_HANDLER(AudioInputMsg_NotifyLowLatencyStreamCreated, | 45 IPC_MESSAGE_HANDLER(AudioInputMsg_NotifyLowLatencyStreamCreated, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 } | 125 } |
126 | 126 |
127 int32 AudioInputMessageFilter::AddDelegate(Delegate* delegate) { | 127 int32 AudioInputMessageFilter::AddDelegate(Delegate* delegate) { |
128 return delegates_.Add(delegate); | 128 return delegates_.Add(delegate); |
129 } | 129 } |
130 | 130 |
131 void AudioInputMessageFilter::RemoveDelegate(int32 id) { | 131 void AudioInputMessageFilter::RemoveDelegate(int32 id) { |
132 VLOG(1) << "AudioInputMessageFilter::RemoveDelegate(id=" << id << ")"; | 132 VLOG(1) << "AudioInputMessageFilter::RemoveDelegate(id=" << id << ")"; |
133 delegates_.Remove(id); | 133 delegates_.Remove(id); |
134 } | 134 } |
OLD | NEW |