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

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

Issue 2734943003: Device Service: Decouple Wake Lock from //content (Closed)
Patch Set: Rebase Created 3 years, 9 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
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" 98 #include "device/generic_sensor/sensor_provider_impl.h"
99 #include "device/geolocation/geolocation_service_context.h" 99 #include "device/geolocation/geolocation_service_context.h"
100 #include "device/vr/features.h" 100 #include "device/vr/features.h"
101 #include "device/wake_lock/wake_lock_service_context.h" 101 #include "device/wake_lock/public/interfaces/wake_lock_context.mojom.h"
102 #include "device/wake_lock/public/interfaces/wake_lock_service.mojom.h"
102 #include "media/base/media_switches.h" 103 #include "media/base/media_switches.h"
103 #include "media/media_features.h" 104 #include "media/media_features.h"
104 #include "media/mojo/interfaces/media_service.mojom.h" 105 #include "media/mojo/interfaces/media_service.mojom.h"
105 #include "media/mojo/interfaces/remoting.mojom.h" 106 #include "media/mojo/interfaces/remoting.mojom.h"
106 #include "mojo/public/cpp/bindings/associated_interface_ptr.h" 107 #include "mojo/public/cpp/bindings/associated_interface_ptr.h"
107 #include "mojo/public/cpp/bindings/strong_binding.h" 108 #include "mojo/public/cpp/bindings/strong_binding.h"
108 #include "services/service_manager/public/cpp/connector.h" 109 #include "services/service_manager/public/cpp/connector.h"
109 #include "services/service_manager/public/cpp/interface_provider.h" 110 #include "services/service_manager/public/cpp/interface_provider.h"
110 #include "ui/accessibility/ax_tree.h" 111 #include "ui/accessibility/ax_tree.h"
111 #include "ui/accessibility/ax_tree_id_registry.h" 112 #include "ui/accessibility/ax_tree_id_registry.h"
(...skipping 2321 matching lines...) Expand 10 before | Expand all | Expand 10 after
2433 // this object and destruction of any GeolocationServicesImpls created via 2434 // this object and destruction of any GeolocationServicesImpls created via
2434 // the below service registry, the reason being that the destruction of the 2435 // the below service registry, the reason being that the destruction of the
2435 // latter is triggered by receiving a message that the pipe was closed from 2436 // latter is triggered by receiving a message that the pipe was closed from
2436 // the renderer side. Hence, supply the reference to this object as a weak 2437 // the renderer side. Hence, supply the reference to this object as a weak
2437 // pointer. 2438 // pointer.
2438 GetInterfaceRegistry()->AddInterface( 2439 GetInterfaceRegistry()->AddInterface(
2439 base::Bind(&device::GeolocationServiceContext::CreateService, 2440 base::Bind(&device::GeolocationServiceContext::CreateService,
2440 base::Unretained(geolocation_service_context))); 2441 base::Unretained(geolocation_service_context)));
2441 } 2442 }
2442 2443
2443 device::WakeLockServiceContext* wake_lock_service_context = 2444 device::mojom::WakeLockContext* wake_lock_service_context =
2444 delegate_ ? delegate_->GetWakeLockServiceContext() : nullptr; 2445 delegate_ ? delegate_->GetWakeLockServiceContext() : nullptr;
2445 if (wake_lock_service_context) { 2446 if (wake_lock_service_context) {
2446 // WakeLockServiceContext is owned by WebContentsImpl so it will outlive 2447 // WakeLockServiceContext is owned by WebContentsImpl so it will outlive
2447 // this RenderFrameHostImpl, hence a raw pointer can be bound to service 2448 // this RenderFrameHostImpl, hence a raw pointer can be bound to service
2448 // factory callback. 2449 // factory callback.
2449 GetInterfaceRegistry()->AddInterface<device::mojom::WakeLockService>( 2450 GetInterfaceRegistry()->AddInterface<device::mojom::WakeLockService>(
2450 base::Bind(&device::WakeLockServiceContext::CreateService, 2451 base::Bind(&device::mojom::WakeLockContext::GetWakeLock,
2451 base::Unretained(wake_lock_service_context))); 2452 base::Unretained(wake_lock_service_context)));
2452 } 2453 }
2453 2454
2454 if (!permission_service_context_) 2455 if (!permission_service_context_)
2455 permission_service_context_.reset(new PermissionServiceContext(this)); 2456 permission_service_context_.reset(new PermissionServiceContext(this));
2456 2457
2457 GetInterfaceRegistry()->AddInterface( 2458 GetInterfaceRegistry()->AddInterface(
2458 base::Bind(&PermissionServiceContext::CreateService, 2459 base::Bind(&PermissionServiceContext::CreateService,
2459 base::Unretained(permission_service_context_.get()))); 2460 base::Unretained(permission_service_context_.get())));
2460 2461
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
3627 service_manager::mojom::InterfaceProviderPtr provider; 3628 service_manager::mojom::InterfaceProviderPtr provider;
3628 BindInterfaceRegistryForRenderFrameHost(mojo::MakeRequest(&provider), this); 3629 BindInterfaceRegistryForRenderFrameHost(mojo::MakeRequest(&provider), this);
3629 java_interfaces_.reset(new service_manager::InterfaceProvider); 3630 java_interfaces_.reset(new service_manager::InterfaceProvider);
3630 java_interfaces_->Bind(std::move(provider)); 3631 java_interfaces_->Bind(std::move(provider));
3631 } 3632 }
3632 return java_interfaces_.get(); 3633 return java_interfaces_.get();
3633 } 3634 }
3634 #endif 3635 #endif
3635 3636
3636 } // namespace content 3637 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_delegate.cc ('k') | content/browser/service_manager/service_manager_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698