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

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

Issue 2378033002: Decouple WakeLock from direct //content dependencies (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | content/browser/wake_lock/wake_lock_service_context.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2124 matching lines...) Expand 10 before | Expand all | Expand 10 after
2135 } 2135 }
2136 2136
2137 WakeLockServiceContext* wake_lock_service_context = 2137 WakeLockServiceContext* wake_lock_service_context =
2138 delegate_ ? delegate_->GetWakeLockServiceContext() : nullptr; 2138 delegate_ ? delegate_->GetWakeLockServiceContext() : nullptr;
2139 if (wake_lock_service_context) { 2139 if (wake_lock_service_context) {
2140 // WakeLockServiceContext is owned by WebContentsImpl so it will outlive 2140 // WakeLockServiceContext is owned by WebContentsImpl so it will outlive
2141 // this RenderFrameHostImpl, hence a raw pointer can be bound to service 2141 // this RenderFrameHostImpl, hence a raw pointer can be bound to service
2142 // factory callback. 2142 // factory callback.
2143 GetInterfaceRegistry()->AddInterface<blink::mojom::WakeLockService>( 2143 GetInterfaceRegistry()->AddInterface<blink::mojom::WakeLockService>(
2144 base::Bind(&WakeLockServiceContext::CreateService, 2144 base::Bind(&WakeLockServiceContext::CreateService,
2145 base::Unretained(wake_lock_service_context), 2145 base::Unretained(wake_lock_service_context)));
2146 GetProcess()->GetID(), GetRoutingID()));
2147 } 2146 }
2148 2147
2149 if (!permission_service_context_) 2148 if (!permission_service_context_)
2150 permission_service_context_.reset(new PermissionServiceContext(this)); 2149 permission_service_context_.reset(new PermissionServiceContext(this));
2151 2150
2152 GetInterfaceRegistry()->AddInterface( 2151 GetInterfaceRegistry()->AddInterface(
2153 base::Bind(&PermissionServiceContext::CreateService, 2152 base::Bind(&PermissionServiceContext::CreateService,
2154 base::Unretained(permission_service_context_.get()))); 2153 base::Unretained(permission_service_context_.get())));
2155 2154
2156 GetInterfaceRegistry()->AddInterface(base::Bind( 2155 GetInterfaceRegistry()->AddInterface(base::Bind(
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
3099 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind( 3098 web_bluetooth_service_->SetClientConnectionErrorHandler(base::Bind(
3100 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this))); 3099 &RenderFrameHostImpl::DeleteWebBluetoothService, base::Unretained(this)));
3101 return web_bluetooth_service_.get(); 3100 return web_bluetooth_service_.get();
3102 } 3101 }
3103 3102
3104 void RenderFrameHostImpl::DeleteWebBluetoothService() { 3103 void RenderFrameHostImpl::DeleteWebBluetoothService() {
3105 web_bluetooth_service_.reset(); 3104 web_bluetooth_service_.reset();
3106 } 3105 }
3107 3106
3108 } // namespace content 3107 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/wake_lock/wake_lock_service_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698