Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 2921823002: Rationalize WakeLock naming conventions (Closed)
Patch Set: rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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/resource_coordinator/public/cpp/resource_coordinator_interfac e.h" 117 #include "services/resource_coordinator/public/cpp/resource_coordinator_interfac e.h"
118 #include "services/service_manager/public/cpp/connector.h" 118 #include "services/service_manager/public/cpp/connector.h"
(...skipping 2660 matching lines...) Expand 10 before | Expand all | Expand 10 after
2779 // this object and destruction of any GeolocationServicesImpls created via 2779 // this object and destruction of any GeolocationServicesImpls created via
2780 // the below service registry, the reason being that the destruction of the 2780 // the below service registry, the reason being that the destruction of the
2781 // latter is triggered by receiving a message that the pipe was closed from 2781 // latter is triggered by receiving a message that the pipe was closed from
2782 // the renderer side. Hence, supply the reference to this object as a weak 2782 // the renderer side. Hence, supply the reference to this object as a weak
2783 // pointer. 2783 // pointer.
2784 GetInterfaceRegistry()->AddInterface( 2784 GetInterfaceRegistry()->AddInterface(
2785 base::Bind(&device::GeolocationServiceContext::CreateService, 2785 base::Bind(&device::GeolocationServiceContext::CreateService,
2786 base::Unretained(geolocation_service_context))); 2786 base::Unretained(geolocation_service_context)));
2787 } 2787 }
2788 2788
2789 GetInterfaceRegistry()->AddInterface<device::mojom::WakeLockService>( 2789 GetInterfaceRegistry()->AddInterface<device::mojom::WakeLock>(base::Bind(
2790 base::Bind(&RenderFrameHostImpl::BindWakeLockServiceRequest, 2790 &RenderFrameHostImpl::BindWakeLockRequest, base::Unretained(this)));
2791 base::Unretained(this)));
2792 2791
2793 #if defined(OS_ANDROID) 2792 #if defined(OS_ANDROID)
2794 if (base::FeatureList::IsEnabled(features::kWebNfc)) { 2793 if (base::FeatureList::IsEnabled(features::kWebNfc)) {
2795 GetInterfaceRegistry()->AddInterface<device::mojom::NFC>(base::Bind( 2794 GetInterfaceRegistry()->AddInterface<device::mojom::NFC>(base::Bind(
2796 &RenderFrameHostImpl::BindNFCRequest, base::Unretained(this))); 2795 &RenderFrameHostImpl::BindNFCRequest, base::Unretained(this)));
2797 } 2796 }
2798 #endif 2797 #endif
2799 2798
2800 if (!permission_service_context_) 2799 if (!permission_service_context_)
2801 permission_service_context_.reset(new PermissionServiceContext(this)); 2800 permission_service_context_.reset(new PermissionServiceContext(this));
(...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after
3880 this, std::move(request), 3879 this, std::move(request),
3881 base::Bind(&RenderFrameHostImpl::OnMediaInterfaceFactoryConnectionError, 3880 base::Bind(&RenderFrameHostImpl::OnMediaInterfaceFactoryConnectionError,
3882 base::Unretained(this)))); 3881 base::Unretained(this))));
3883 } 3882 }
3884 3883
3885 void RenderFrameHostImpl::OnMediaInterfaceFactoryConnectionError() { 3884 void RenderFrameHostImpl::OnMediaInterfaceFactoryConnectionError() {
3886 DCHECK(media_interface_proxy_); 3885 DCHECK(media_interface_proxy_);
3887 media_interface_proxy_.reset(); 3886 media_interface_proxy_.reset();
3888 } 3887 }
3889 3888
3890 void RenderFrameHostImpl::BindWakeLockServiceRequest( 3889 void RenderFrameHostImpl::BindWakeLockRequest(
3891 const service_manager::BindSourceInfo& source_info, 3890 const service_manager::BindSourceInfo& source_info,
3892 device::mojom::WakeLockServiceRequest request) { 3891 device::mojom::WakeLockRequest request) {
3893 device::mojom::WakeLockService* renderer_wake_lock = 3892 device::mojom::WakeLock* renderer_wake_lock =
3894 delegate_ ? delegate_->GetRendererWakeLock() : nullptr; 3893 delegate_ ? delegate_->GetRendererWakeLock() : nullptr;
3895 if (renderer_wake_lock) 3894 if (renderer_wake_lock)
3896 renderer_wake_lock->AddClient(std::move(request)); 3895 renderer_wake_lock->AddClient(std::move(request));
3897 } 3896 }
3898 3897
3899 #if defined(OS_ANDROID) 3898 #if defined(OS_ANDROID)
3900 void RenderFrameHostImpl::BindNFCRequest( 3899 void RenderFrameHostImpl::BindNFCRequest(
3901 const service_manager::BindSourceInfo& source_info, 3900 const service_manager::BindSourceInfo& source_info,
3902 device::mojom::NFCRequest request) { 3901 device::mojom::NFCRequest request) {
3903 if (delegate_) 3902 if (delegate_)
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
4108 } 4107 }
4109 4108
4110 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( 4109 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame(
4111 const std::string& interface_name, 4110 const std::string& interface_name,
4112 mojo::ScopedMessagePipeHandle pipe) { 4111 mojo::ScopedMessagePipeHandle pipe) {
4113 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); 4112 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe));
4114 } 4113 }
4115 #endif 4114 #endif
4116 4115
4117 } // namespace content 4116 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.h ('k') | content/browser/loader/wake_lock_resource_throttle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698