| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 #include "content/public/common/content_switches.h" | 97 #include "content/public/common/content_switches.h" |
| 98 #include "content/public/common/file_chooser_file_info.h" | 98 #include "content/public/common/file_chooser_file_info.h" |
| 99 #include "content/public/common/file_chooser_params.h" | 99 #include "content/public/common/file_chooser_params.h" |
| 100 #include "content/public/common/isolated_world_ids.h" | 100 #include "content/public/common/isolated_world_ids.h" |
| 101 #include "content/public/common/service_manager_connection.h" | 101 #include "content/public/common/service_manager_connection.h" |
| 102 #include "content/public/common/service_names.mojom.h" | 102 #include "content/public/common/service_names.mojom.h" |
| 103 #include "content/public/common/url_constants.h" | 103 #include "content/public/common/url_constants.h" |
| 104 #include "content/public/common/url_utils.h" | 104 #include "content/public/common/url_utils.h" |
| 105 #include "device/geolocation/geolocation_service_context.h" | 105 #include "device/geolocation/geolocation_service_context.h" |
| 106 #include "device/vr/features/features.h" | 106 #include "device/vr/features/features.h" |
| 107 #include "device/wake_lock/public/interfaces/wake_lock.mojom.h" |
| 107 #include "device/wake_lock/public/interfaces/wake_lock_context.mojom.h" | 108 #include "device/wake_lock/public/interfaces/wake_lock_context.mojom.h" |
| 108 #include "device/wake_lock/public/interfaces/wake_lock_service.mojom.h" | |
| 109 #include "media/base/media_switches.h" | 109 #include "media/base/media_switches.h" |
| 110 #include "media/media_features.h" | 110 #include "media/media_features.h" |
| 111 #include "media/mojo/interfaces/media_service.mojom.h" | 111 #include "media/mojo/interfaces/media_service.mojom.h" |
| 112 #include "media/mojo/interfaces/remoting.mojom.h" | 112 #include "media/mojo/interfaces/remoting.mojom.h" |
| 113 #include "media/mojo/services/media_interface_provider.h" | 113 #include "media/mojo/services/media_interface_provider.h" |
| 114 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" | 114 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" |
| 115 #include "mojo/public/cpp/bindings/strong_binding.h" | 115 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 116 #include "mojo/public/cpp/system/data_pipe.h" | 116 #include "mojo/public/cpp/system/data_pipe.h" |
| 117 #include "services/service_manager/public/cpp/connector.h" | 117 #include "services/service_manager/public/cpp/connector.h" |
| 118 #include "services/service_manager/public/cpp/interface_provider.h" | 118 #include "services/service_manager/public/cpp/interface_provider.h" |
| (...skipping 2651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2770 // this object and destruction of any GeolocationServicesImpls created via | 2770 // this object and destruction of any GeolocationServicesImpls created via |
| 2771 // the below service registry, the reason being that the destruction of the | 2771 // the below service registry, the reason being that the destruction of the |
| 2772 // latter is triggered by receiving a message that the pipe was closed from | 2772 // latter is triggered by receiving a message that the pipe was closed from |
| 2773 // the renderer side. Hence, supply the reference to this object as a weak | 2773 // the renderer side. Hence, supply the reference to this object as a weak |
| 2774 // pointer. | 2774 // pointer. |
| 2775 GetInterfaceRegistry()->AddInterface( | 2775 GetInterfaceRegistry()->AddInterface( |
| 2776 base::Bind(&device::GeolocationServiceContext::CreateService, | 2776 base::Bind(&device::GeolocationServiceContext::CreateService, |
| 2777 base::Unretained(geolocation_service_context))); | 2777 base::Unretained(geolocation_service_context))); |
| 2778 } | 2778 } |
| 2779 | 2779 |
| 2780 GetInterfaceRegistry()->AddInterface<device::mojom::WakeLockService>( | 2780 GetInterfaceRegistry()->AddInterface<device::mojom::WakeLock>(base::Bind( |
| 2781 base::Bind(&RenderFrameHostImpl::BindWakeLockServiceRequest, | 2781 &RenderFrameHostImpl::BindWakeLockRequest, base::Unretained(this))); |
| 2782 base::Unretained(this))); | |
| 2783 | 2782 |
| 2784 #if defined(OS_ANDROID) | 2783 #if defined(OS_ANDROID) |
| 2785 if (base::FeatureList::IsEnabled(features::kWebNfc)) { | 2784 if (base::FeatureList::IsEnabled(features::kWebNfc)) { |
| 2786 GetInterfaceRegistry()->AddInterface<device::mojom::NFC>(base::Bind( | 2785 GetInterfaceRegistry()->AddInterface<device::mojom::NFC>(base::Bind( |
| 2787 &RenderFrameHostImpl::BindNFCRequest, base::Unretained(this))); | 2786 &RenderFrameHostImpl::BindNFCRequest, base::Unretained(this))); |
| 2788 } | 2787 } |
| 2789 #endif | 2788 #endif |
| 2790 | 2789 |
| 2791 if (!permission_service_context_) | 2790 if (!permission_service_context_) |
| 2792 permission_service_context_.reset(new PermissionServiceContext(this)); | 2791 permission_service_context_.reset(new PermissionServiceContext(this)); |
| (...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3838 this, std::move(request), | 3837 this, std::move(request), |
| 3839 base::Bind(&RenderFrameHostImpl::OnMediaInterfaceFactoryConnectionError, | 3838 base::Bind(&RenderFrameHostImpl::OnMediaInterfaceFactoryConnectionError, |
| 3840 base::Unretained(this)))); | 3839 base::Unretained(this)))); |
| 3841 } | 3840 } |
| 3842 | 3841 |
| 3843 void RenderFrameHostImpl::OnMediaInterfaceFactoryConnectionError() { | 3842 void RenderFrameHostImpl::OnMediaInterfaceFactoryConnectionError() { |
| 3844 DCHECK(media_interface_proxy_); | 3843 DCHECK(media_interface_proxy_); |
| 3845 media_interface_proxy_.reset(); | 3844 media_interface_proxy_.reset(); |
| 3846 } | 3845 } |
| 3847 | 3846 |
| 3848 void RenderFrameHostImpl::BindWakeLockServiceRequest( | 3847 void RenderFrameHostImpl::BindWakeLockRequest( |
| 3849 const service_manager::BindSourceInfo& source_info, | 3848 const service_manager::BindSourceInfo& source_info, |
| 3850 device::mojom::WakeLockServiceRequest request) { | 3849 device::mojom::WakeLockRequest request) { |
| 3851 device::mojom::WakeLockService* renderer_wake_lock = | 3850 device::mojom::WakeLock* renderer_wake_lock = |
| 3852 delegate_ ? delegate_->GetRendererWakeLock() : nullptr; | 3851 delegate_ ? delegate_->GetRendererWakeLock() : nullptr; |
| 3853 if (renderer_wake_lock) | 3852 if (renderer_wake_lock) |
| 3854 renderer_wake_lock->AddClient(std::move(request)); | 3853 renderer_wake_lock->AddClient(std::move(request)); |
| 3855 } | 3854 } |
| 3856 | 3855 |
| 3857 #if defined(OS_ANDROID) | 3856 #if defined(OS_ANDROID) |
| 3858 void RenderFrameHostImpl::BindNFCRequest( | 3857 void RenderFrameHostImpl::BindNFCRequest( |
| 3859 const service_manager::BindSourceInfo& source_info, | 3858 const service_manager::BindSourceInfo& source_info, |
| 3860 device::mojom::NFCRequest request) { | 3859 device::mojom::NFCRequest request) { |
| 3861 if (delegate_) | 3860 if (delegate_) |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4066 } | 4065 } |
| 4067 | 4066 |
| 4068 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( | 4067 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( |
| 4069 const std::string& interface_name, | 4068 const std::string& interface_name, |
| 4070 mojo::ScopedMessagePipeHandle pipe) { | 4069 mojo::ScopedMessagePipeHandle pipe) { |
| 4071 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); | 4070 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); |
| 4072 } | 4071 } |
| 4073 #endif | 4072 #endif |
| 4074 | 4073 |
| 4075 } // namespace content | 4074 } // namespace content |
| OLD | NEW |