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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 OnChannelClosing(); | 169 OnChannelClosing(); |
170 } | 170 } |
171 | 171 |
172 void AudioMessageFilter::OnChannelClosing() { | 172 void AudioMessageFilter::OnChannelClosing() { |
173 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 173 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
174 sender_ = NULL; | 174 sender_ = NULL; |
175 | 175 |
176 DLOG_IF(WARNING, !delegates_.IsEmpty()) | 176 DLOG_IF(WARNING, !delegates_.IsEmpty()) |
177 << "Not all audio devices have been closed."; | 177 << "Not all audio devices have been closed."; |
178 | 178 |
179 IDMap<media::AudioOutputIPCDelegate>::iterator it(&delegates_); | 179 IDMap<media::AudioOutputIPCDelegate*>::iterator it(&delegates_); |
180 while (!it.IsAtEnd()) { | 180 while (!it.IsAtEnd()) { |
181 it.GetCurrentValue()->OnIPCClosed(); | 181 it.GetCurrentValue()->OnIPCClosed(); |
182 delegates_.Remove(it.GetCurrentKey()); | 182 delegates_.Remove(it.GetCurrentKey()); |
183 it.Advance(); | 183 it.Advance(); |
184 } | 184 } |
185 } | 185 } |
186 | 186 |
187 void AudioMessageFilter::OnDeviceAuthorized( | 187 void AudioMessageFilter::OnDeviceAuthorized( |
188 int stream_id, | 188 int stream_id, |
189 media::OutputDeviceStatus device_status, | 189 media::OutputDeviceStatus device_status, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 media::AudioOutputIPCDelegate* delegate = delegates_.Lookup(stream_id); | 227 media::AudioOutputIPCDelegate* delegate = delegates_.Lookup(stream_id); |
228 if (!delegate) { | 228 if (!delegate) { |
229 DLOG(WARNING) << "Got OnStreamError() event for a non-existent or" | 229 DLOG(WARNING) << "Got OnStreamError() event for a non-existent or" |
230 << " removed audio renderer."; | 230 << " removed audio renderer."; |
231 return; | 231 return; |
232 } | 232 } |
233 delegate->OnError(); | 233 delegate->OnError(); |
234 } | 234 } |
235 | 235 |
236 } // namespace content | 236 } // namespace content |
OLD | NEW |