| 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 24 matching lines...) Expand all Loading... |
| 35 #include "content/public/common/service_names.mojom.h" | 35 #include "content/public/common/service_names.mojom.h" |
| 36 #include "mojo/edk/embedder/embedder.h" | 36 #include "mojo/edk/embedder/embedder.h" |
| 37 #include "services/catalog/catalog.h" | 37 #include "services/catalog/catalog.h" |
| 38 #include "services/catalog/manifest_provider.h" | 38 #include "services/catalog/manifest_provider.h" |
| 39 #include "services/catalog/public/cpp/manifest_parsing_util.h" | 39 #include "services/catalog/public/cpp/manifest_parsing_util.h" |
| 40 #include "services/catalog/public/interfaces/constants.mojom.h" | 40 #include "services/catalog/public/interfaces/constants.mojom.h" |
| 41 #include "services/catalog/store.h" | 41 #include "services/catalog/store.h" |
| 42 #include "services/data_decoder/public/interfaces/constants.mojom.h" | 42 #include "services/data_decoder/public/interfaces/constants.mojom.h" |
| 43 #include "services/device/device_service.h" | 43 #include "services/device/device_service.h" |
| 44 #include "services/device/public/interfaces/constants.mojom.h" | 44 #include "services/device/public/interfaces/constants.mojom.h" |
| 45 #include "services/resource_coordinator/public/cpp/resource_coordinator_features
.h" |
| 46 #include "services/resource_coordinator/public/interfaces/service_constants.mojo
m.h" |
| 47 #include "services/resource_coordinator/resource_coordinator_service.h" |
| 45 #include "services/service_manager/connect_params.h" | 48 #include "services/service_manager/connect_params.h" |
| 46 #include "services/service_manager/public/cpp/connector.h" | 49 #include "services/service_manager/public/cpp/connector.h" |
| 47 #include "services/service_manager/public/cpp/service.h" | 50 #include "services/service_manager/public/cpp/service.h" |
| 48 #include "services/service_manager/public/interfaces/service.mojom.h" | 51 #include "services/service_manager/public/interfaces/service.mojom.h" |
| 49 #include "services/service_manager/runner/common/client_util.h" | 52 #include "services/service_manager/runner/common/client_util.h" |
| 50 #include "services/service_manager/service_manager.h" | 53 #include "services/service_manager/service_manager.h" |
| 51 #include "services/shape_detection/public/interfaces/constants.mojom.h" | 54 #include "services/shape_detection/public/interfaces/constants.mojom.h" |
| 52 | 55 |
| 53 namespace content { | 56 namespace content { |
| 54 | 57 |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 #else | 301 #else |
| 299 device_info.factory = | 302 device_info.factory = |
| 300 base::Bind(&device::CreateDeviceService, | 303 base::Bind(&device::CreateDeviceService, |
| 301 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 304 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
| 302 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 305 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
| 303 #endif | 306 #endif |
| 304 device_info.task_runner = base::ThreadTaskRunnerHandle::Get(); | 307 device_info.task_runner = base::ThreadTaskRunnerHandle::Get(); |
| 305 packaged_services_connection_->AddEmbeddedService(device::mojom::kServiceName, | 308 packaged_services_connection_->AddEmbeddedService(device::mojom::kServiceName, |
| 306 device_info); | 309 device_info); |
| 307 | 310 |
| 311 if (base::FeatureList::IsEnabled(features::kGlobalResourceCoordinator)) { |
| 312 ServiceInfo resource_coordinator_info; |
| 313 resource_coordinator_info.factory = |
| 314 base::Bind(&resource_coordinator::ResourceCoordinatorService::Create); |
| 315 packaged_services_connection_->AddEmbeddedService( |
| 316 resource_coordinator::mojom::kServiceName, resource_coordinator_info); |
| 317 } |
| 318 |
| 308 ContentBrowserClient::StaticServiceMap services; | 319 ContentBrowserClient::StaticServiceMap services; |
| 309 GetContentClient()->browser()->RegisterInProcessServices(&services); | 320 GetContentClient()->browser()->RegisterInProcessServices(&services); |
| 310 for (const auto& entry : services) { | 321 for (const auto& entry : services) { |
| 311 packaged_services_connection_->AddEmbeddedService(entry.first, | 322 packaged_services_connection_->AddEmbeddedService(entry.first, |
| 312 entry.second); | 323 entry.second); |
| 313 } | 324 } |
| 314 | 325 |
| 315 // This is safe to assign directly from any thread, because | 326 // This is safe to assign directly from any thread, because |
| 316 // ServiceManagerContext must be constructed before anyone can call | 327 // ServiceManagerContext must be constructed before anyone can call |
| 317 // GetConnectorForIOThread(). | 328 // GetConnectorForIOThread(). |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 base::Bind(&DestroyConnectorOnIOThread)); | 397 base::Bind(&DestroyConnectorOnIOThread)); |
| 387 } | 398 } |
| 388 | 399 |
| 389 // static | 400 // static |
| 390 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { | 401 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { |
| 391 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 402 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 392 return g_io_thread_connector.Get().get(); | 403 return g_io_thread_connector.Get().get(); |
| 393 } | 404 } |
| 394 | 405 |
| 395 } // namespace content | 406 } // namespace content |
| OLD | NEW |