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 16 matching lines...) Expand all Loading... |
27 #include "content/public/browser/utility_process_host_client.h" | 27 #include "content/public/browser/utility_process_host_client.h" |
28 #include "content/public/common/content_client.h" | 28 #include "content/public/common/content_client.h" |
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/data_decoder/public/interfaces/constants.mojom.h" |
37 #include "services/device/device_service.h" | 38 #include "services/device/device_service.h" |
38 #include "services/device/public/interfaces/constants.mojom.h" | 39 #include "services/device/public/interfaces/constants.mojom.h" |
39 #include "services/service_manager/connect_params.h" | 40 #include "services/service_manager/connect_params.h" |
40 #include "services/service_manager/public/cpp/connector.h" | 41 #include "services/service_manager/public/cpp/connector.h" |
41 #include "services/service_manager/public/cpp/service.h" | 42 #include "services/service_manager/public/cpp/service.h" |
42 #include "services/service_manager/public/interfaces/service.mojom.h" | 43 #include "services/service_manager/public/interfaces/service.mojom.h" |
43 #include "services/service_manager/runner/common/client_util.h" | 44 #include "services/service_manager/runner/common/client_util.h" |
44 #include "services/service_manager/service_manager.h" | 45 #include "services/service_manager/service_manager.h" |
45 #include "services/shape_detection/public/interfaces/constants.mojom.h" | 46 #include "services/shape_detection/public/interfaces/constants.mojom.h" |
46 | 47 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 // This is safe to assign directly from any thread, because | 302 // This is safe to assign directly from any thread, because |
302 // ServiceManagerContext must be constructed before anyone can call | 303 // ServiceManagerContext must be constructed before anyone can call |
303 // GetConnectorForIOThread(). | 304 // GetConnectorForIOThread(). |
304 g_io_thread_connector.Get() = | 305 g_io_thread_connector.Get() = |
305 ServiceManagerConnection::GetForProcess()->GetConnector()->Clone(); | 306 ServiceManagerConnection::GetForProcess()->GetConnector()->Clone(); |
306 | 307 |
307 ContentBrowserClient::OutOfProcessServiceMap sandboxed_services; | 308 ContentBrowserClient::OutOfProcessServiceMap sandboxed_services; |
308 GetContentClient() | 309 GetContentClient() |
309 ->browser() | 310 ->browser() |
310 ->RegisterOutOfProcessServices(&sandboxed_services); | 311 ->RegisterOutOfProcessServices(&sandboxed_services); |
| 312 sandboxed_services.insert( |
| 313 std::make_pair(data_decoder::mojom::kServiceName, |
| 314 base::ASCIIToUTF16("Data Decoder Service"))); |
311 for (const auto& service : sandboxed_services) { | 315 for (const auto& service : sandboxed_services) { |
312 packaged_services_connection_->AddServiceRequestHandler( | 316 packaged_services_connection_->AddServiceRequestHandler( |
313 service.first, base::Bind(&StartServiceInUtilityProcess, service.first, | 317 service.first, base::Bind(&StartServiceInUtilityProcess, service.first, |
314 service.second, true /* use_sandbox */)); | 318 service.second, true /* use_sandbox */)); |
315 } | 319 } |
316 | 320 |
317 ContentBrowserClient::OutOfProcessServiceMap unsandboxed_services; | 321 ContentBrowserClient::OutOfProcessServiceMap unsandboxed_services; |
318 GetContentClient() | 322 GetContentClient() |
319 ->browser() | 323 ->browser() |
320 ->RegisterUnsandboxedOutOfProcessServices(&unsandboxed_services); | 324 ->RegisterUnsandboxedOutOfProcessServices(&unsandboxed_services); |
(...skipping 30 matching lines...) Expand all Loading... |
351 base::Bind(&DestroyConnectorOnIOThread)); | 355 base::Bind(&DestroyConnectorOnIOThread)); |
352 } | 356 } |
353 | 357 |
354 // static | 358 // static |
355 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { | 359 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { |
356 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 360 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
357 return g_io_thread_connector.Get().get(); | 361 return g_io_thread_connector.Get().get(); |
358 } | 362 } |
359 | 363 |
360 } // namespace content | 364 } // namespace content |
OLD | NEW |