| 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 // Implementation notes about interactions with VideoCaptureImpl. | 5 // Implementation notes about interactions with VideoCaptureImpl. |
| 6 // | 6 // |
| 7 // How is VideoCaptureImpl used: | 7 // How is VideoCaptureImpl used: |
| 8 // | 8 // |
| 9 // VideoCaptureImpl is an IO thread object while VideoCaptureImplManager | 9 // VideoCaptureImpl is an IO thread object while VideoCaptureImplManager |
| 10 // lives only on the render thread. It is only possible to access an | 10 // lives only on the render thread. It is only possible to access an |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // We make sure deletion is the last task on the IO thread for a | 22 // We make sure deletion is the last task on the IO thread for a |
| 23 // VideoCaptureImpl object. This allows the use of Unretained() binding. | 23 // VideoCaptureImpl object. This allows the use of Unretained() binding. |
| 24 | 24 |
| 25 #include "content/renderer/media/video_capture_impl_manager.h" | 25 #include "content/renderer/media/video_capture_impl_manager.h" |
| 26 | 26 |
| 27 #include "base/bind.h" | 27 #include "base/bind.h" |
| 28 #include "base/bind_helpers.h" | 28 #include "base/bind_helpers.h" |
| 29 #include "content/child/child_process.h" | 29 #include "content/child/child_process.h" |
| 30 #include "content/renderer/media/video_capture_impl.h" | 30 #include "content/renderer/media/video_capture_impl.h" |
| 31 #include "content/renderer/media/video_capture_message_filter.h" | 31 #include "content/renderer/media/video_capture_message_filter.h" |
| 32 #include "media/base/bind_to_current_loop.h" | |
| 33 | 32 |
| 34 namespace content { | 33 namespace content { |
| 35 | 34 |
| 36 VideoCaptureImplManager::VideoCaptureImplManager() | 35 VideoCaptureImplManager::VideoCaptureImplManager() |
| 37 : next_client_id_(0), | 36 : next_client_id_(0), |
| 38 filter_(new VideoCaptureMessageFilter()), | 37 filter_(new VideoCaptureMessageFilter()), |
| 39 render_main_message_loop_(base::MessageLoopProxy::current()), | 38 render_main_message_loop_(base::MessageLoopProxy::current()), |
| 40 weak_factory_(this) { | 39 weak_factory_(this) { |
| 41 } | 40 } |
| 42 | 41 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 DCHECK(render_main_message_loop_->BelongsToCurrentThread()); | 174 DCHECK(render_main_message_loop_->BelongsToCurrentThread()); |
| 176 for (const auto& device : devices_) { | 175 for (const auto& device : devices_) { |
| 177 VideoCaptureImpl* const impl = device.second.second; | 176 VideoCaptureImpl* const impl = device.second.second; |
| 178 ChildProcess::current()->io_message_loop_proxy()->PostTask( | 177 ChildProcess::current()->io_message_loop_proxy()->PostTask( |
| 179 FROM_HERE, base::Bind(&VideoCaptureImpl::SuspendCapture, | 178 FROM_HERE, base::Bind(&VideoCaptureImpl::SuspendCapture, |
| 180 base::Unretained(impl), suspend)); | 179 base::Unretained(impl), suspend)); |
| 181 } | 180 } |
| 182 } | 181 } |
| 183 | 182 |
| 184 } // namespace content | 183 } // namespace content |
| OLD | NEW |