| 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/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 const int render_view_id_; | 49 const int render_view_id_; |
| 50 int stream_id_; | 50 int stream_id_; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 AudioInputMessageFilter* AudioInputMessageFilter::g_filter = NULL; | 53 AudioInputMessageFilter* AudioInputMessageFilter::g_filter = NULL; |
| 54 | 54 |
| 55 AudioInputMessageFilter::AudioInputMessageFilter( | 55 AudioInputMessageFilter::AudioInputMessageFilter( |
| 56 const scoped_refptr<base::MessageLoopProxy>& io_message_loop) | 56 const scoped_refptr<base::MessageLoopProxy>& io_message_loop) |
| 57 : sender_(NULL), | 57 : sender_(NULL), |
| 58 io_message_loop_(io_message_loop) { | 58 io_message_loop_(io_message_loop) { |
| 59 DCHECK(!g_filter); | |
| 60 g_filter = this; | 59 g_filter = this; |
| 61 } | 60 } |
| 62 | 61 |
| 63 AudioInputMessageFilter::~AudioInputMessageFilter() { | 62 AudioInputMessageFilter::~AudioInputMessageFilter() { |
| 64 DCHECK_EQ(g_filter, this); | 63 DCHECK_EQ(g_filter, this); |
| 65 g_filter = NULL; | 64 g_filter = NULL; |
| 66 } | 65 } |
| 67 | 66 |
| 68 // static | 67 // static |
| 69 AudioInputMessageFilter* AudioInputMessageFilter::Get() { | 68 AudioInputMessageFilter* AudioInputMessageFilter::Get() { |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 void AudioInputMessageFilter::AudioInputIPCImpl::CloseStream() { | 219 void AudioInputMessageFilter::AudioInputIPCImpl::CloseStream() { |
| 221 DCHECK(filter_->io_message_loop_->BelongsToCurrentThread()); | 220 DCHECK(filter_->io_message_loop_->BelongsToCurrentThread()); |
| 222 DCHECK_NE(stream_id_, kStreamIDNotSet); | 221 DCHECK_NE(stream_id_, kStreamIDNotSet); |
| 223 LogMessage(stream_id_, "CloseStream"); | 222 LogMessage(stream_id_, "CloseStream"); |
| 224 filter_->Send(new AudioInputHostMsg_CloseStream(stream_id_)); | 223 filter_->Send(new AudioInputHostMsg_CloseStream(stream_id_)); |
| 225 filter_->delegates_.Remove(stream_id_); | 224 filter_->delegates_.Remove(stream_id_); |
| 226 stream_id_ = kStreamIDNotSet; | 225 stream_id_ = kStreamIDNotSet; |
| 227 } | 226 } |
| 228 | 227 |
| 229 } // namespace content | 228 } // namespace content |
| OLD | NEW |