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 #include "content/renderer/media/audio_message_filter.h" | 5 #include "content/renderer/media/audio_message_filter.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 bool handled = true; | 149 bool handled = true; |
150 IPC_BEGIN_MESSAGE_MAP(AudioMessageFilter, message) | 150 IPC_BEGIN_MESSAGE_MAP(AudioMessageFilter, message) |
151 IPC_MESSAGE_HANDLER(AudioMsg_NotifyDeviceAuthorized, OnDeviceAuthorized) | 151 IPC_MESSAGE_HANDLER(AudioMsg_NotifyDeviceAuthorized, OnDeviceAuthorized) |
152 IPC_MESSAGE_HANDLER(AudioMsg_NotifyStreamCreated, OnStreamCreated) | 152 IPC_MESSAGE_HANDLER(AudioMsg_NotifyStreamCreated, OnStreamCreated) |
153 IPC_MESSAGE_HANDLER(AudioMsg_NotifyStreamStateChanged, OnStreamStateChanged) | 153 IPC_MESSAGE_HANDLER(AudioMsg_NotifyStreamStateChanged, OnStreamStateChanged) |
154 IPC_MESSAGE_UNHANDLED(handled = false) | 154 IPC_MESSAGE_UNHANDLED(handled = false) |
155 IPC_END_MESSAGE_MAP() | 155 IPC_END_MESSAGE_MAP() |
156 return handled; | 156 return handled; |
157 } | 157 } |
158 | 158 |
159 void AudioMessageFilter::OnFilterAdded(IPC::Sender* sender) { | 159 void AudioMessageFilter::OnFilterAdded(IPC::Channel* channel) { |
160 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 160 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
161 sender_ = sender; | 161 sender_ = channel; |
162 } | 162 } |
163 | 163 |
164 void AudioMessageFilter::OnFilterRemoved() { | 164 void AudioMessageFilter::OnFilterRemoved() { |
165 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 165 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
166 | 166 |
167 // Once removed, a filter will not be used again. At this time all | 167 // Once removed, a filter will not be used again. At this time all |
168 // delegates must be notified so they release their reference. | 168 // delegates must be notified so they release their reference. |
169 OnChannelClosing(); | 169 OnChannelClosing(); |
170 } | 170 } |
171 | 171 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 media::AudioOutputIPCDelegate* delegate = delegates_.Lookup(stream_id); | 228 media::AudioOutputIPCDelegate* delegate = delegates_.Lookup(stream_id); |
229 if (!delegate) { | 229 if (!delegate) { |
230 DLOG(WARNING) << "Got OnStreamStateChanged() event for a non-existent or" | 230 DLOG(WARNING) << "Got OnStreamStateChanged() event for a non-existent or" |
231 << " removed audio renderer. State: " << state; | 231 << " removed audio renderer. State: " << state; |
232 return; | 232 return; |
233 } | 233 } |
234 delegate->OnStateChanged(state); | 234 delegate->OnStateChanged(state); |
235 } | 235 } |
236 | 236 |
237 } // namespace content | 237 } // namespace content |
OLD | NEW |