| 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 2380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2489 routing_id_)); | 2488 routing_id_)); |
| 2490 | 2489 |
| 2491 #if BUILDFLAG(ENABLE_VR) | 2490 #if BUILDFLAG(ENABLE_VR) |
| 2492 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( | 2491 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( |
| 2493 base::Bind(&device::VRServiceImpl::Create)); | 2492 base::Bind(&device::VRServiceImpl::Create)); |
| 2494 #else | 2493 #else |
| 2495 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( | 2494 GetInterfaceRegistry()->AddInterface<device::mojom::VRService>( |
| 2496 base::Bind(&IgnoreInterfaceRequest<device::mojom::VRService>)); | 2495 base::Bind(&IgnoreInterfaceRequest<device::mojom::VRService>)); |
| 2497 #endif | 2496 #endif |
| 2498 | 2497 |
| 2499 if (base::FeatureList::IsEnabled(features::kGenericSensor)) { | |
| 2500 GetInterfaceRegistry()->AddInterface( | |
| 2501 base::Bind(&device::SensorProviderImpl::Create, | |
| 2502 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)), | |
| 2503 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | |
| 2504 } | |
| 2505 | |
| 2506 #if BUILDFLAG(ENABLE_WEBRTC) | 2498 #if BUILDFLAG(ENABLE_WEBRTC) |
| 2507 // BrowserMainLoop::GetInstance() may be null on unit tests. | 2499 // BrowserMainLoop::GetInstance() may be null on unit tests. |
| 2508 if (BrowserMainLoop::GetInstance()) { | 2500 if (BrowserMainLoop::GetInstance()) { |
| 2509 // BrowserMainLoop, which owns MediaStreamManager, is alive for the lifetime | 2501 // BrowserMainLoop, which owns MediaStreamManager, is alive for the lifetime |
| 2510 // of Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(), | 2502 // of Mojo communication (see BrowserMainLoop::ShutdownThreadsAndCleanUp(), |
| 2511 // which shuts down Mojo). Hence, passing that MediaStreamManager instance | 2503 // which shuts down Mojo). Hence, passing that MediaStreamManager instance |
| 2512 // as a raw pointer here is safe. | 2504 // as a raw pointer here is safe. |
| 2513 MediaStreamManager* media_stream_manager = | 2505 MediaStreamManager* media_stream_manager = |
| 2514 BrowserMainLoop::GetInstance()->media_stream_manager(); | 2506 BrowserMainLoop::GetInstance()->media_stream_manager(); |
| 2515 GetInterfaceRegistry()->AddInterface( | 2507 GetInterfaceRegistry()->AddInterface( |
| (...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3631 service_manager::mojom::InterfaceProviderPtr provider; | 3623 service_manager::mojom::InterfaceProviderPtr provider; |
| 3632 BindInterfaceRegistryForRenderFrameHost(mojo::MakeRequest(&provider), this); | 3624 BindInterfaceRegistryForRenderFrameHost(mojo::MakeRequest(&provider), this); |
| 3633 java_interfaces_.reset(new service_manager::InterfaceProvider); | 3625 java_interfaces_.reset(new service_manager::InterfaceProvider); |
| 3634 java_interfaces_->Bind(std::move(provider)); | 3626 java_interfaces_->Bind(std::move(provider)); |
| 3635 } | 3627 } |
| 3636 return java_interfaces_.get(); | 3628 return java_interfaces_.get(); |
| 3637 } | 3629 } |
| 3638 #endif | 3630 #endif |
| 3639 | 3631 |
| 3640 } // namespace content | 3632 } // namespace content |
| OLD | NEW |