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

Unified Diff: content/browser/service_manager/service_manager_context.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 side-by-side diff with in-line comments
Download patch
Index: content/browser/service_manager/service_manager_context.cc
diff --git a/content/browser/service_manager/service_manager_context.cc b/content/browser/service_manager/service_manager_context.cc
index bc49cfb206dc8d3b829a2904a97a8efdceaa0304..caa9424c8852c6d7e8bc391525ef336d2b612546 100644
--- a/content/browser/service_manager/service_manager_context.cc
+++ b/content/browser/service_manager/service_manager_context.cc
@@ -19,6 +19,7 @@
#include "content/browser/child_process_launcher.h"
#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/service_manager/merge_dictionary.h"
+#include "content/browser/wake_lock/wake_lock_context_host.h"
#include "content/common/service_manager/service_manager_connection_impl.h"
#include "content/grit/content_resources.h"
#include "content/public/browser/browser_thread.h"
@@ -284,10 +285,20 @@ ServiceManagerContext::ServiceManagerContext() {
ServiceInfo device_info;
+#if defined(OS_ANDROID)
+ // See the comments on wake_lock_context_host.h for details on this
+ // callback.
+ device_info.factory =
+ base::Bind(&device::CreateDeviceService,
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
+ base::Bind(&WakeLockContextHost::GetNativeViewForContext));
+#else
device_info.factory =
base::Bind(&device::CreateDeviceService,
BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
+#endif
device_info.task_runner = base::ThreadTaskRunnerHandle::Get();
packaged_services_connection_->AddEmbeddedService(device::mojom::kServiceName,
device_info);
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/wake_lock/wake_lock_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698