| 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/video_capture_manager.h" | 5 #include "content/browser/renderer_host/media/video_capture_manager.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 const scoped_refptr<base::SingleThreadTaskRunner>& device_task_runner) { | 125 const scoped_refptr<base::SingleThreadTaskRunner>& device_task_runner) { |
| 126 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 126 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 127 DCHECK(!listener_); | 127 DCHECK(!listener_); |
| 128 DCHECK(!device_task_runner_.get()); | 128 DCHECK(!device_task_runner_.get()); |
| 129 listener_ = listener; | 129 listener_ = listener; |
| 130 device_task_runner_ = device_task_runner; | 130 device_task_runner_ = device_task_runner; |
| 131 } | 131 } |
| 132 | 132 |
| 133 void VideoCaptureManager::Unregister() { | 133 void VideoCaptureManager::Unregister() { |
| 134 DCHECK(listener_); | 134 DCHECK(listener_); |
| 135 DCHECK(device_task_runner_.get()); |
| 135 listener_ = NULL; | 136 listener_ = NULL; |
| 137 device_task_runner_ = NULL; |
| 136 } | 138 } |
| 137 | 139 |
| 138 void VideoCaptureManager::EnumerateDevices(MediaStreamType stream_type) { | 140 void VideoCaptureManager::EnumerateDevices(MediaStreamType stream_type) { |
| 139 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 141 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 140 DVLOG(1) << "VideoCaptureManager::EnumerateDevices, type " << stream_type; | 142 DVLOG(1) << "VideoCaptureManager::EnumerateDevices, type " << stream_type; |
| 141 DCHECK(listener_); | 143 DCHECK(listener_); |
| 142 DCHECK_EQ(stream_type, MEDIA_DEVICE_VIDEO_CAPTURE); | 144 DCHECK_EQ(stream_type, MEDIA_DEVICE_VIDEO_CAPTURE); |
| 143 | 145 |
| 144 // Bind a callback to ConsolidateDevicesInfoOnDeviceThread() with an argument | 146 // Bind a callback to ConsolidateDevicesInfoOnDeviceThread() with an argument |
| 145 // for another callback to OnDevicesInfoEnumerated() to be run in the current | 147 // for another callback to OnDevicesInfoEnumerated() to be run in the current |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 gfx::NativeViewId window_id) { | 722 gfx::NativeViewId window_id) { |
| 721 DCHECK(IsOnDeviceThread()); | 723 DCHECK(IsOnDeviceThread()); |
| 722 DCHECK(notification_window_ids_.find(session_id) == | 724 DCHECK(notification_window_ids_.find(session_id) == |
| 723 notification_window_ids_.end()); | 725 notification_window_ids_.end()); |
| 724 notification_window_ids_[session_id] = window_id; | 726 notification_window_ids_[session_id] = window_id; |
| 725 VLOG(2) << "Screen capture notification window saved for session " | 727 VLOG(2) << "Screen capture notification window saved for session " |
| 726 << session_id << " on device thread."; | 728 << session_id << " on device thread."; |
| 727 } | 729 } |
| 728 | 730 |
| 729 } // namespace content | 731 } // namespace content |
| OLD | NEW |