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 17 matching lines...) Expand all Loading... |
28 #include "content/public/browser/utility_process_host.h" | 28 #include "content/public/browser/utility_process_host.h" |
29 #include "content/public/browser/utility_process_host_client.h" | 29 #include "content/public/browser/utility_process_host_client.h" |
30 #include "content/public/common/content_client.h" | 30 #include "content/public/common/content_client.h" |
31 #include "content/public/common/service_manager_connection.h" | 31 #include "content/public/common/service_manager_connection.h" |
32 #include "content/public/common/service_names.mojom.h" | 32 #include "content/public/common/service_names.mojom.h" |
33 #include "mojo/edk/embedder/embedder.h" | 33 #include "mojo/edk/embedder/embedder.h" |
34 #include "services/catalog/catalog.h" | 34 #include "services/catalog/catalog.h" |
35 #include "services/catalog/manifest_provider.h" | 35 #include "services/catalog/manifest_provider.h" |
36 #include "services/catalog/public/cpp/manifest_parsing_util.h" | 36 #include "services/catalog/public/cpp/manifest_parsing_util.h" |
37 #include "services/catalog/public/interfaces/constants.mojom.h" | 37 #include "services/catalog/public/interfaces/constants.mojom.h" |
| 38 #include "services/blamer/blamer_service.h" |
| 39 #include "services/blamer/public/interfaces/service_constants.mojom.h" |
38 #include "services/catalog/store.h" | 40 #include "services/catalog/store.h" |
39 #include "services/data_decoder/public/interfaces/constants.mojom.h" | 41 #include "services/data_decoder/public/interfaces/constants.mojom.h" |
40 #include "services/device/device_service.h" | 42 #include "services/device/device_service.h" |
41 #include "services/device/public/interfaces/constants.mojom.h" | 43 #include "services/device/public/interfaces/constants.mojom.h" |
42 #include "services/service_manager/connect_params.h" | 44 #include "services/service_manager/connect_params.h" |
43 #include "services/service_manager/public/cpp/connector.h" | 45 #include "services/service_manager/public/cpp/connector.h" |
44 #include "services/service_manager/public/cpp/service.h" | 46 #include "services/service_manager/public/cpp/service.h" |
45 #include "services/service_manager/public/interfaces/service.mojom.h" | 47 #include "services/service_manager/public/interfaces/service.mojom.h" |
46 #include "services/service_manager/runner/common/client_util.h" | 48 #include "services/service_manager/runner/common/client_util.h" |
47 #include "services/service_manager/service_manager.h" | 49 #include "services/service_manager/service_manager.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 #else | 297 #else |
296 device_info.factory = | 298 device_info.factory = |
297 base::Bind(&device::CreateDeviceService, | 299 base::Bind(&device::CreateDeviceService, |
298 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 300 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
299 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 301 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
300 #endif | 302 #endif |
301 device_info.task_runner = base::ThreadTaskRunnerHandle::Get(); | 303 device_info.task_runner = base::ThreadTaskRunnerHandle::Get(); |
302 packaged_services_connection_->AddEmbeddedService(device::mojom::kServiceName, | 304 packaged_services_connection_->AddEmbeddedService(device::mojom::kServiceName, |
303 device_info); | 305 device_info); |
304 | 306 |
| 307 // Create the blamer service. |
| 308 ServiceInfo blamer_info; |
| 309 blamer_info.factory = base::Bind(&blamer::BlamerService::Create); |
| 310 packaged_services_connection_->AddEmbeddedService( |
| 311 blamer::mojom::kServiceName, blamer_info); |
| 312 |
305 ContentBrowserClient::StaticServiceMap services; | 313 ContentBrowserClient::StaticServiceMap services; |
306 GetContentClient()->browser()->RegisterInProcessServices(&services); | 314 GetContentClient()->browser()->RegisterInProcessServices(&services); |
307 for (const auto& entry : services) { | 315 for (const auto& entry : services) { |
308 packaged_services_connection_->AddEmbeddedService(entry.first, | 316 packaged_services_connection_->AddEmbeddedService(entry.first, |
309 entry.second); | 317 entry.second); |
310 } | 318 } |
311 | 319 |
312 // This is safe to assign directly from any thread, because | 320 // This is safe to assign directly from any thread, because |
313 // ServiceManagerContext must be constructed before anyone can call | 321 // ServiceManagerContext must be constructed before anyone can call |
314 // GetConnectorForIOThread(). | 322 // GetConnectorForIOThread(). |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 base::Bind(&DestroyConnectorOnIOThread)); | 373 base::Bind(&DestroyConnectorOnIOThread)); |
366 } | 374 } |
367 | 375 |
368 // static | 376 // static |
369 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { | 377 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { |
370 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 378 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
371 return g_io_thread_connector.Get().get(); | 379 return g_io_thread_connector.Get().get(); |
372 } | 380 } |
373 | 381 |
374 } // namespace content | 382 } // namespace content |
OLD | NEW |