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()); | |
136 listener_ = NULL; | 135 listener_ = NULL; |
137 device_task_runner_ = NULL; | |
138 } | 136 } |
139 | 137 |
140 void VideoCaptureManager::EnumerateDevices(MediaStreamType stream_type) { | 138 void VideoCaptureManager::EnumerateDevices(MediaStreamType stream_type) { |
141 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 139 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
142 DVLOG(1) << "VideoCaptureManager::EnumerateDevices, type " << stream_type; | 140 DVLOG(1) << "VideoCaptureManager::EnumerateDevices, type " << stream_type; |
143 DCHECK(listener_); | 141 DCHECK(listener_); |
144 DCHECK_EQ(stream_type, MEDIA_DEVICE_VIDEO_CAPTURE); | 142 DCHECK_EQ(stream_type, MEDIA_DEVICE_VIDEO_CAPTURE); |
145 | 143 |
146 // Bind a callback to ConsolidateDevicesInfoOnDeviceThread() with an argument | 144 // Bind a callback to ConsolidateDevicesInfoOnDeviceThread() with an argument |
147 // for another callback to OnDevicesInfoEnumerated() to be run in the current | 145 // for another callback to OnDevicesInfoEnumerated() to be run in the current |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 gfx::NativeViewId window_id) { | 720 gfx::NativeViewId window_id) { |
723 DCHECK(IsOnDeviceThread()); | 721 DCHECK(IsOnDeviceThread()); |
724 DCHECK(notification_window_ids_.find(session_id) == | 722 DCHECK(notification_window_ids_.find(session_id) == |
725 notification_window_ids_.end()); | 723 notification_window_ids_.end()); |
726 notification_window_ids_[session_id] = window_id; | 724 notification_window_ids_[session_id] = window_id; |
727 VLOG(2) << "Screen capture notification window saved for session " | 725 VLOG(2) << "Screen capture notification window saved for session " |
728 << session_id << " on device thread."; | 726 << session_id << " on device thread."; |
729 } | 727 } |
730 | 728 |
731 } // namespace content | 729 } // namespace content |
OLD | NEW |