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/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "content/public/common/media_stream_request.h" | 10 #include "content/public/common/media_stream_request.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 return NULL; | 42 return NULL; |
43 | 43 |
44 return &(*device); | 44 return &(*device); |
45 } | 45 } |
46 | 46 |
47 void AudioInputDeviceManager::Register( | 47 void AudioInputDeviceManager::Register( |
48 MediaStreamProviderListener* listener, | 48 MediaStreamProviderListener* listener, |
49 base::MessageLoopProxy* device_thread_loop) { | 49 base::MessageLoopProxy* device_thread_loop) { |
50 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 50 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
51 DCHECK(!listener_); | 51 DCHECK(!listener_); |
52 DCHECK(!device_loop_); | 52 DCHECK(!device_loop_.get()); |
53 listener_ = listener; | 53 listener_ = listener; |
54 device_loop_ = device_thread_loop; | 54 device_loop_ = device_thread_loop; |
55 } | 55 } |
56 | 56 |
57 void AudioInputDeviceManager::Unregister() { | 57 void AudioInputDeviceManager::Unregister() { |
58 DCHECK(listener_); | 58 DCHECK(listener_); |
59 listener_ = NULL; | 59 listener_ = NULL; |
60 } | 60 } |
61 | 61 |
62 void AudioInputDeviceManager::EnumerateDevices(MediaStreamType stream_type) { | 62 void AudioInputDeviceManager::EnumerateDevices(MediaStreamType stream_type) { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 for (StreamDeviceList::iterator i(devices_.begin()); i != devices_.end(); | 200 for (StreamDeviceList::iterator i(devices_.begin()); i != devices_.end(); |
201 ++i) { | 201 ++i) { |
202 if (i->session_id == session_id) | 202 if (i->session_id == session_id) |
203 return i; | 203 return i; |
204 } | 204 } |
205 | 205 |
206 return devices_.end(); | 206 return devices_.end(); |
207 } | 207 } |
208 | 208 |
209 } // namespace content | 209 } // namespace content |
OLD | NEW |