Chromium Code Reviews| 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 fe9651229ad9bd52feadcd44ad6f4d7d5ed3f710..22c0643b687deafda233c47c5fb0210094eb2ee3 100644 |
| --- a/content/browser/service_manager/service_manager_context.cc |
| +++ b/content/browser/service_manager/service_manager_context.cc |
| @@ -30,6 +30,8 @@ |
| #include "services/catalog/manifest_provider.h" |
| #include "services/catalog/public/interfaces/constants.mojom.h" |
| #include "services/catalog/store.h" |
| +#include "services/device/device_service.h" |
| +#include "services/device/public/interfaces/constants.mojom.h" |
| #include "services/file/public/interfaces/constants.mojom.h" |
| #include "services/service_manager/connect_params.h" |
| #include "services/service_manager/public/cpp/connector.h" |
| @@ -274,6 +276,15 @@ ServiceManagerContext::ServiceManagerContext() { |
| std::move(request), |
| BrowserThread::GetTaskRunnerForThread(BrowserThread::IO))); |
| + // Registers the singletion device service to be embedded by browser service |
| + // for now. |
| + ServiceInfo device_info; |
| + device_info.factory = |
| + base::Bind(&device::CreateDeviceService, |
| + BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)); |
| + ServiceManagerConnection::GetForProcess()->AddEmbeddedService( |
| + device::mojom::kServiceName, device_info); |
| + |
| ContentBrowserClient::StaticServiceMap services; |
| GetContentClient()->browser()->RegisterInProcessServices(&services); |
| for (const auto& entry : services) { |
| @@ -315,6 +326,11 @@ ServiceManagerContext::ServiceManagerContext() { |
| ServiceManagerConnection::GetForProcess()->AddServiceRequestHandler( |
| "media", base::Bind(&StartServiceInGpuProcess, "media")); |
| #endif |
| + |
| + // Initialiates the connection to device service to create singleton instance. |
| + std::unique_ptr<service_manager::Connection> device_connection_ = |
|
blundell
2017/01/05 16:27:08
You're aliasing the ivar here. This brings up a di
leonhsl(Using Gerrit)
2017/01/06 05:26:03
Ah.. Done and thanks!
|
| + ServiceManagerConnection::GetForProcess()->GetConnector()->Connect( |
| + device::mojom::kServiceName); |
| } |
| ServiceManagerContext::~ServiceManagerContext() { |