| 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 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 #include <algorithm> | 27 #include <algorithm> |
| 28 | 28 |
| 29 #include "base/bind.h" | 29 #include "base/bind.h" |
| 30 #include "base/bind_helpers.h" | 30 #include "base/bind_helpers.h" |
| 31 #include "base/location.h" | 31 #include "base/location.h" |
| 32 #include "base/threading/thread_task_runner_handle.h" | 32 #include "base/threading/thread_task_runner_handle.h" |
| 33 #include "content/child/child_process.h" | 33 #include "content/child/child_process.h" |
| 34 #include "content/renderer/media/video_capture_impl.h" | 34 #include "content/renderer/media/video_capture_impl.h" |
| 35 #include "content/renderer/media/video_capture_message_filter.h" | 35 #include "content/renderer/media/video_capture_message_filter.h" |
| 36 #include "media/base/bind_to_current_loop.h" | |
| 37 | 36 |
| 38 namespace content { | 37 namespace content { |
| 39 | 38 |
| 40 struct VideoCaptureImplManager::DeviceEntry { | 39 struct VideoCaptureImplManager::DeviceEntry { |
| 41 media::VideoCaptureSessionId session_id; | 40 media::VideoCaptureSessionId session_id; |
| 42 | 41 |
| 43 // To be used and destroyed only on the IO thread. | 42 // To be used and destroyed only on the IO thread. |
| 44 std::unique_ptr<VideoCaptureImpl> impl; | 43 std::unique_ptr<VideoCaptureImpl> impl; |
| 45 | 44 |
| 46 // Number of clients using |impl|. | 45 // Number of clients using |impl|. |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 for (auto& entry : devices_) { | 246 for (auto& entry : devices_) { |
| 248 if (entry.is_individually_suspended) | 247 if (entry.is_individually_suspended) |
| 249 continue; // Either: 1) Already suspended; or 2) Should not be resumed. | 248 continue; // Either: 1) Already suspended; or 2) Should not be resumed. |
| 250 ChildProcess::current()->io_task_runner()->PostTask( | 249 ChildProcess::current()->io_task_runner()->PostTask( |
| 251 FROM_HERE, base::Bind(&VideoCaptureImpl::SuspendCapture, | 250 FROM_HERE, base::Bind(&VideoCaptureImpl::SuspendCapture, |
| 252 base::Unretained(entry.impl.get()), suspend)); | 251 base::Unretained(entry.impl.get()), suspend)); |
| 253 } | 252 } |
| 254 } | 253 } |
| 255 | 254 |
| 256 } // namespace content | 255 } // namespace content |
| OLD | NEW |