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); |