OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/media_devices_dispatcher_host.h" | 5 #include "content/browser/renderer_host/media/media_devices_dispatcher_host.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "content/browser/bad_message.h" | 14 #include "content/browser/bad_message.h" |
15 #include "content/browser/media/media_devices_util.h" | 15 #include "content/browser/media/media_devices_util.h" |
16 #include "content/browser/renderer_host/media/media_stream_manager.h" | 16 #include "content/browser/renderer_host/media/media_stream_manager.h" |
17 #include "content/browser/renderer_host/media/video_capture_manager.h" | 17 #include "content/browser/renderer_host/media/video_capture_manager.h" |
18 #include "content/common/media/media_devices.h" | 18 #include "content/common/media/media_devices.h" |
| 19 #include "content/public/browser/browser_context.h" |
19 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
20 #include "content/public/browser/media_device_id.h" | 21 #include "content/public/browser/media_device_id.h" |
21 #include "content/public/browser/render_frame_host.h" | 22 #include "content/public/browser/render_frame_host.h" |
22 #include "content/public/browser/resource_context.h" | |
23 #include "content/public/common/media_stream_request.h" | 23 #include "content/public/common/media_stream_request.h" |
24 #include "media/base/video_facing.h" | 24 #include "media/base/video_facing.h" |
25 #include "mojo/public/cpp/bindings/strong_binding.h" | 25 #include "mojo/public/cpp/bindings/strong_binding.h" |
26 #include "services/service_manager/public/cpp/interface_provider.h" | 26 #include "services/service_manager/public/cpp/interface_provider.h" |
27 #include "url/origin.h" | 27 #include "url/origin.h" |
28 | 28 |
29 namespace content { | 29 namespace content { |
30 | 30 |
31 namespace { | 31 namespace { |
32 | 32 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 107 } |
108 | 108 |
109 MediaDevicesDispatcherHost::MediaDevicesDispatcherHost( | 109 MediaDevicesDispatcherHost::MediaDevicesDispatcherHost( |
110 int render_process_id, | 110 int render_process_id, |
111 int render_frame_id, | 111 int render_frame_id, |
112 const std::string& device_id_salt, | 112 const std::string& device_id_salt, |
113 MediaStreamManager* media_stream_manager) | 113 MediaStreamManager* media_stream_manager) |
114 : render_process_id_(render_process_id), | 114 : render_process_id_(render_process_id), |
115 render_frame_id_(render_frame_id), | 115 render_frame_id_(render_frame_id), |
116 device_id_salt_(device_id_salt), | 116 device_id_salt_(device_id_salt), |
117 group_id_salt_(ResourceContext::CreateRandomMediaDeviceIDSalt()), | 117 group_id_salt_(BrowserContext::CreateRandomMediaDeviceIDSalt()), |
118 media_stream_manager_(media_stream_manager), | 118 media_stream_manager_(media_stream_manager), |
119 permission_checker_(base::MakeUnique<MediaDevicesPermissionChecker>()), | 119 permission_checker_(base::MakeUnique<MediaDevicesPermissionChecker>()), |
120 weak_factory_(this) { | 120 weak_factory_(this) { |
121 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 121 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
122 } | 122 } |
123 | 123 |
124 MediaDevicesDispatcherHost::~MediaDevicesDispatcherHost() { | 124 MediaDevicesDispatcherHost::~MediaDevicesDispatcherHost() { |
125 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 125 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
126 // It may happen that media_devices_manager() is destroyed before MDDH on some | 126 // It may happen that media_devices_manager() is destroyed before MDDH on some |
127 // shutdown scenarios. | 127 // shutdown scenarios. |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 formats.push_back(format.value()); | 414 formats.push_back(format.value()); |
415 return formats; | 415 return formats; |
416 } | 416 } |
417 | 417 |
418 media_stream_manager_->video_capture_manager()->GetDeviceSupportedFormats( | 418 media_stream_manager_->video_capture_manager()->GetDeviceSupportedFormats( |
419 device_id, &formats); | 419 device_id, &formats); |
420 return formats; | 420 return formats; |
421 } | 421 } |
422 | 422 |
423 } // namespace content | 423 } // namespace content |
OLD | NEW |