| 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_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/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "content/common/media/audio_messages.h" | 10 #include "content/common/media/audio_messages.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 OnChannelClosing(); | 107 OnChannelClosing(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 void AudioInputMessageFilter::OnChannelClosing() { | 110 void AudioInputMessageFilter::OnChannelClosing() { |
| 111 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 111 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| 112 sender_ = NULL; | 112 sender_ = NULL; |
| 113 | 113 |
| 114 DLOG_IF(WARNING, !delegates_.IsEmpty()) | 114 DLOG_IF(WARNING, !delegates_.IsEmpty()) |
| 115 << "Not all audio devices have been closed."; | 115 << "Not all audio devices have been closed."; |
| 116 | 116 |
| 117 IDMap<media::AudioInputIPCDelegate>::iterator it(&delegates_); | 117 IDMap<media::AudioInputIPCDelegate*>::iterator it(&delegates_); |
| 118 while (!it.IsAtEnd()) { | 118 while (!it.IsAtEnd()) { |
| 119 it.GetCurrentValue()->OnIPCClosed(); | 119 it.GetCurrentValue()->OnIPCClosed(); |
| 120 delegates_.Remove(it.GetCurrentKey()); | 120 delegates_.Remove(it.GetCurrentKey()); |
| 121 it.Advance(); | 121 it.Advance(); |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 | 124 |
| 125 void AudioInputMessageFilter::OnStreamCreated( | 125 void AudioInputMessageFilter::OnStreamCreated( |
| 126 int stream_id, | 126 int stream_id, |
| 127 base::SharedMemoryHandle handle, | 127 base::SharedMemoryHandle handle, |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 void AudioInputMessageFilter::AudioInputIPCImpl::CloseStream() { | 221 void AudioInputMessageFilter::AudioInputIPCImpl::CloseStream() { |
| 222 DCHECK(filter_->io_task_runner_->BelongsToCurrentThread()); | 222 DCHECK(filter_->io_task_runner_->BelongsToCurrentThread()); |
| 223 DCHECK_NE(stream_id_, kStreamIDNotSet); | 223 DCHECK_NE(stream_id_, kStreamIDNotSet); |
| 224 LogMessage(stream_id_, "CloseStream"); | 224 LogMessage(stream_id_, "CloseStream"); |
| 225 filter_->Send(new AudioInputHostMsg_CloseStream(stream_id_)); | 225 filter_->Send(new AudioInputHostMsg_CloseStream(stream_id_)); |
| 226 filter_->delegates_.Remove(stream_id_); | 226 filter_->delegates_.Remove(stream_id_); |
| 227 stream_id_ = kStreamIDNotSet; | 227 stream_id_ = kStreamIDNotSet; |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace content | 230 } // namespace content |
| OLD | NEW |