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_host.h" | 5 #include "content/browser/renderer_host/media/video_capture_host.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
12 #include "content/browser/browser_main_loop.h" | 12 #include "content/browser/browser_main_loop.h" |
13 #include "content/browser/renderer_host/media/media_stream_manager.h" | 13 #include "content/browser/renderer_host/media/media_stream_manager.h" |
14 #include "content/browser/renderer_host/media/video_capture_manager.h" | 14 #include "content/browser/renderer_host/media/video_capture_manager.h" |
15 #include "mojo/common/values_struct_traits.h" | 15 #include "mojo/common/values_struct_traits.h" |
16 #include "mojo/public/cpp/bindings/strong_binding.h" | 16 #include "mojo/public/cpp/bindings/strong_binding.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 VideoCaptureHost::VideoCaptureHost(MediaStreamManager* media_stream_manager) | 20 VideoCaptureHost::VideoCaptureHost(MediaStreamManager* media_stream_manager) |
21 : media_stream_manager_(media_stream_manager), | 21 : media_stream_manager_(media_stream_manager), |
22 weak_factory_(this) { | 22 weak_factory_(this) { |
23 DVLOG(1) << __func__; | 23 DVLOG(1) << __func__; |
24 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 24 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
25 } | 25 } |
26 | 26 |
27 // static | 27 // static |
28 void VideoCaptureHost::Create(MediaStreamManager* media_stream_manager, | 28 void VideoCaptureHost::Create( |
29 mojom::VideoCaptureHostRequest request) { | 29 MediaStreamManager* media_stream_manager, |
| 30 const service_manager::BindSourceInfo& source_info, |
| 31 mojom::VideoCaptureHostRequest request) { |
30 DVLOG(1) << __func__; | 32 DVLOG(1) << __func__; |
31 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 33 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
32 mojo::MakeStrongBinding( | 34 mojo::MakeStrongBinding( |
33 base::MakeUnique<VideoCaptureHost>(media_stream_manager), | 35 base::MakeUnique<VideoCaptureHost>(media_stream_manager), |
34 std::move(request)); | 36 std::move(request)); |
35 } | 37 } |
36 | 38 |
37 VideoCaptureHost::~VideoCaptureHost() { | 39 VideoCaptureHost::~VideoCaptureHost() { |
38 for (auto it = controllers_.begin(); it != controllers_.end(); ) { | 40 for (auto it = controllers_.begin(); it != controllers_.end(); ) { |
39 const base::WeakPtr<VideoCaptureController>& controller = it->second; | 41 const base::WeakPtr<VideoCaptureController>& controller = it->second; |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 const base::WeakPtr<VideoCaptureController> controller = it->second; | 327 const base::WeakPtr<VideoCaptureController> controller = it->second; |
326 controllers_.erase(it); | 328 controllers_.erase(it); |
327 if (!controller) | 329 if (!controller) |
328 return; | 330 return; |
329 | 331 |
330 media_stream_manager_->video_capture_manager()->DisconnectClient( | 332 media_stream_manager_->video_capture_manager()->DisconnectClient( |
331 controller.get(), controller_id, this, on_error); | 333 controller.get(), controller_id, this, on_error); |
332 } | 334 } |
333 | 335 |
334 } // namespace content | 336 } // namespace content |
OLD | NEW |