| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 #include "content/public/common/content_constants.h" | 88 #include "content/public/common/content_constants.h" |
| 89 #include "content/public/common/content_features.h" | 89 #include "content/public/common/content_features.h" |
| 90 #include "content/public/common/content_switches.h" | 90 #include "content/public/common/content_switches.h" |
| 91 #include "content/public/common/file_chooser_file_info.h" | 91 #include "content/public/common/file_chooser_file_info.h" |
| 92 #include "content/public/common/file_chooser_params.h" | 92 #include "content/public/common/file_chooser_params.h" |
| 93 #include "content/public/common/isolated_world_ids.h" | 93 #include "content/public/common/isolated_world_ids.h" |
| 94 #include "content/public/common/service_manager_connection.h" | 94 #include "content/public/common/service_manager_connection.h" |
| 95 #include "content/public/common/service_names.mojom.h" | 95 #include "content/public/common/service_names.mojom.h" |
| 96 #include "content/public/common/url_constants.h" | 96 #include "content/public/common/url_constants.h" |
| 97 #include "content/public/common/url_utils.h" | 97 #include "content/public/common/url_utils.h" |
| 98 #include "device/generic_sensor/sensor_provider_impl.h" | |
| 99 #include "device/geolocation/geolocation_service_context.h" | 98 #include "device/geolocation/geolocation_service_context.h" |
| 100 #include "device/vr/features.h" | 99 #include "device/vr/features.h" |
| 101 #include "device/wake_lock/public/interfaces/wake_lock_context.mojom.h" | 100 #include "device/wake_lock/public/interfaces/wake_lock_context.mojom.h" |
| 102 #include "device/wake_lock/public/interfaces/wake_lock_service.mojom.h" | 101 #include "device/wake_lock/public/interfaces/wake_lock_service.mojom.h" |
| 103 #include "media/base/media_switches.h" | 102 #include "media/base/media_switches.h" |
| 104 #include "media/media_features.h" | 103 #include "media/media_features.h" |
| 105 #include "media/mojo/interfaces/media_service.mojom.h" | 104 #include "media/mojo/interfaces/media_service.mojom.h" |
| 106 #include "media/mojo/interfaces/remoting.mojom.h" | 105 #include "media/mojo/interfaces/remoting.mojom.h" |
| 107 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" | 106 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" |
| 108 #include "mojo/public/cpp/bindings/strong_binding.h" | 107 #include "mojo/public/cpp/bindings/strong_binding.h" |
| (...skipping 2397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2506 routing_id_)); | 2505 routing_id_)); |
| 2507 | 2506 |
| 2508 #if BUILDFLAG(ENABLE_VR) | 2507 #if BUILDFLAG(ENABLE_VR) |
| 2509 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( | 2508 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( |
| 2510 base::Bind(&device::VRServiceImpl::Create)); | 2509 base::Bind(&device::VRServiceImpl::Create)); |
| 2511 #else | 2510 #else |
| 2512 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( | 2511 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( |
| 2513 base::Bind(&IgnoreInterfaceRequest<device::mojom::VRService>)); | 2512 base::Bind(&IgnoreInterfaceRequest<device::mojom::VRService>)); |
| 2514 #endif | 2513 #endif |
| 2515 | 2514 |
| 2516 if (base::FeatureList::IsEnabled(features::kGenericSensor)) { | |
| 2517 GetInterfaceRegistry()->AddInterface( | |
| 2518 base::Bind(&device::SensorProviderImpl::Create, | |
| 2519 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)), | |
| 2520 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | |
| 2521 } | |
| 2522 | |
| 2523 #if BUILDFLAG(ENABLE_WEBRTC) | 2515 #if BUILDFLAG(ENABLE_WEBRTC) |
| 2524 // BrowserMainLoop::GetInstance() may be null on unit tests. | 2516 // BrowserMainLoop::GetInstance() may be null on unit tests. |
| 2525 if (BrowserMainLoop::GetInstance()) { | 2517 if (BrowserMainLoop::GetInstance()) { |
| 2526 // BrowserMainLoop, which owns MediaStreamManager, is alive for the lifetime | 2518 // BrowserMainLoop, which owns MediaStreamManager, is alive for the lifetime |
| 2527 // of Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(), | 2519 // of Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(), |
| 2528 // which shuts down Mojo). Hence, passing that MediaStreamManager instance | 2520 // which shuts down Mojo). Hence, passing that MediaStreamManager instance |
| 2529 // as a raw pointer here is safe. | 2521 // as a raw pointer here is safe. |
| 2530 MediaStreamManager* media_stream_manager = | 2522 MediaStreamManager* media_stream_manager = |
| 2531 BrowserMainLoop::GetInstance()->media_stream_manager(); | 2523 BrowserMainLoop::GetInstance()->media_stream_manager(); |
| 2532 GetInterfaceRegistry()->AddInterface( | 2524 GetInterfaceRegistry()->AddInterface( |
| (...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3662 } | 3654 } |
| 3663 | 3655 |
| 3664 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( | 3656 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( |
| 3665 const std::string& interface_name, | 3657 const std::string& interface_name, |
| 3666 mojo::ScopedMessagePipeHandle pipe) { | 3658 mojo::ScopedMessagePipeHandle pipe) { |
| 3667 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); | 3659 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); |
| 3668 } | 3660 } |
| 3669 #endif | 3661 #endif |
| 3670 | 3662 |
| 3671 } // namespace content | 3663 } // namespace content |
| OLD | NEW |