OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/service_manager/service_manager_context.h" | 5 #include "content/browser/service_manager/service_manager_context.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "content/public/common/service_manager_connection.h" | 29 #include "content/public/common/service_manager_connection.h" |
30 #include "content/public/common/service_names.mojom.h" | 30 #include "content/public/common/service_names.mojom.h" |
31 #include "mojo/edk/embedder/embedder.h" | 31 #include "mojo/edk/embedder/embedder.h" |
32 #include "services/catalog/catalog.h" | 32 #include "services/catalog/catalog.h" |
33 #include "services/catalog/manifest_provider.h" | 33 #include "services/catalog/manifest_provider.h" |
34 #include "services/catalog/public/cpp/manifest_parsing_util.h" | 34 #include "services/catalog/public/cpp/manifest_parsing_util.h" |
35 #include "services/catalog/public/interfaces/constants.mojom.h" | 35 #include "services/catalog/public/interfaces/constants.mojom.h" |
36 #include "services/catalog/store.h" | 36 #include "services/catalog/store.h" |
37 #include "services/device/device_service.h" | 37 #include "services/device/device_service.h" |
38 #include "services/device/public/interfaces/constants.mojom.h" | 38 #include "services/device/public/interfaces/constants.mojom.h" |
| 39 #include "services/resource_coordinator/public/interfaces/constants.mojom.h" |
| 40 #include "services/resource_coordinator/resource_coordinator_service.h" |
39 #include "services/service_manager/connect_params.h" | 41 #include "services/service_manager/connect_params.h" |
40 #include "services/service_manager/public/cpp/connector.h" | 42 #include "services/service_manager/public/cpp/connector.h" |
41 #include "services/service_manager/public/cpp/service.h" | 43 #include "services/service_manager/public/cpp/service.h" |
42 #include "services/service_manager/public/interfaces/service.mojom.h" | 44 #include "services/service_manager/public/interfaces/service.mojom.h" |
43 #include "services/service_manager/runner/common/client_util.h" | 45 #include "services/service_manager/runner/common/client_util.h" |
44 #include "services/service_manager/service_manager.h" | 46 #include "services/service_manager/service_manager.h" |
45 #include "services/shape_detection/public/interfaces/constants.mojom.h" | 47 #include "services/shape_detection/public/interfaces/constants.mojom.h" |
46 | 48 |
47 namespace content { | 49 namespace content { |
48 | 50 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 289 |
288 | 290 |
289 ServiceInfo device_info; | 291 ServiceInfo device_info; |
290 device_info.factory = | 292 device_info.factory = |
291 base::Bind(&device::CreateDeviceService, | 293 base::Bind(&device::CreateDeviceService, |
292 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)); | 294 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)); |
293 device_info.task_runner = base::ThreadTaskRunnerHandle::Get(); | 295 device_info.task_runner = base::ThreadTaskRunnerHandle::Get(); |
294 packaged_services_connection_->AddEmbeddedService(device::mojom::kServiceName, | 296 packaged_services_connection_->AddEmbeddedService(device::mojom::kServiceName, |
295 device_info); | 297 device_info); |
296 | 298 |
| 299 ServiceInfo resource_coordinator_info; |
| 300 resource_coordinator_info.factory = |
| 301 base::Bind(&resource_coordinator::ResourceCoordinatorService::Create); |
| 302 packaged_services_connection_->AddEmbeddedService( |
| 303 resource_coordinator::mojom::kServiceName, resource_coordinator_info); |
| 304 |
297 ContentBrowserClient::StaticServiceMap services; | 305 ContentBrowserClient::StaticServiceMap services; |
298 GetContentClient()->browser()->RegisterInProcessServices(&services); | 306 GetContentClient()->browser()->RegisterInProcessServices(&services); |
299 for (const auto& entry : services) { | 307 for (const auto& entry : services) { |
300 packaged_services_connection_->AddEmbeddedService(entry.first, | 308 packaged_services_connection_->AddEmbeddedService(entry.first, |
301 entry.second); | 309 entry.second); |
302 } | 310 } |
303 | 311 |
304 // This is safe to assign directly from any thread, because | 312 // This is safe to assign directly from any thread, because |
305 // ServiceManagerContext must be constructed before anyone can call | 313 // ServiceManagerContext must be constructed before anyone can call |
306 // GetConnectorForIOThread(). | 314 // GetConnectorForIOThread(). |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 base::Bind(&DestroyConnectorOnIOThread)); | 359 base::Bind(&DestroyConnectorOnIOThread)); |
352 } | 360 } |
353 | 361 |
354 // static | 362 // static |
355 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { | 363 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { |
356 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 364 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
357 return g_io_thread_connector.Get().get(); | 365 return g_io_thread_connector.Get().get(); |
358 } | 366 } |
359 | 367 |
360 } // namespace content | 368 } // namespace content |
OLD | NEW |