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/browser/renderer_host/media/audio_input_device_manager.h" | 5 #include "content/browser/renderer_host/media/audio_input_device_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "content/browser/renderer_host/media/audio_input_device_manager_event_h
andler.h" | 9 #include "content/browser/renderer_host/media/audio_input_device_manager_event_h
andler.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 AudioInputDeviceManager::~AudioInputDeviceManager() { | 32 AudioInputDeviceManager::~AudioInputDeviceManager() { |
33 } | 33 } |
34 | 34 |
35 void AudioInputDeviceManager::Register( | 35 void AudioInputDeviceManager::Register( |
36 MediaStreamProviderListener* listener, | 36 MediaStreamProviderListener* listener, |
37 base::MessageLoopProxy* device_thread_loop) { | 37 base::MessageLoopProxy* device_thread_loop) { |
38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
39 DCHECK(!listener_); | 39 DCHECK(!listener_); |
40 DCHECK(!device_loop_); | 40 DCHECK(!device_loop_.get()); |
41 listener_ = listener; | 41 listener_ = listener; |
42 device_loop_ = device_thread_loop; | 42 device_loop_ = device_thread_loop; |
43 } | 43 } |
44 | 44 |
45 void AudioInputDeviceManager::Unregister() { | 45 void AudioInputDeviceManager::Unregister() { |
46 DCHECK(listener_); | 46 DCHECK(listener_); |
47 listener_ = NULL; | 47 listener_ = NULL; |
48 } | 48 } |
49 | 49 |
50 void AudioInputDeviceManager::EnumerateDevices() { | 50 void AudioInputDeviceManager::EnumerateDevices() { |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 208 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
209 if (listener_) | 209 if (listener_) |
210 listener_->Closed(stream_type, session_id); | 210 listener_->Closed(stream_type, session_id); |
211 } | 211 } |
212 | 212 |
213 bool AudioInputDeviceManager::IsOnDeviceThread() const { | 213 bool AudioInputDeviceManager::IsOnDeviceThread() const { |
214 return device_loop_->BelongsToCurrentThread(); | 214 return device_loop_->BelongsToCurrentThread(); |
215 } | 215 } |
216 | 216 |
217 } // namespace content | 217 } // namespace content |
OLD | NEW |