| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 void StartUtilityProcessOnIOThread( | 53 void StartUtilityProcessOnIOThread( |
| 54 service_manager::mojom::ServiceFactoryRequest request, | 54 service_manager::mojom::ServiceFactoryRequest request, |
| 55 const base::string16& process_name, | 55 const base::string16& process_name, |
| 56 bool use_sandbox) { | 56 bool use_sandbox) { |
| 57 UtilityProcessHost* process_host = | 57 UtilityProcessHost* process_host = |
| 58 UtilityProcessHost::Create(nullptr, nullptr); | 58 UtilityProcessHost::Create(nullptr, nullptr); |
| 59 process_host->SetName(process_name); | 59 process_host->SetName(process_name); |
| 60 if (!use_sandbox) | 60 if (!use_sandbox) |
| 61 process_host->DisableSandbox(); | 61 process_host->DisableSandbox(); |
| 62 process_host->Start(); | 62 process_host->Start(); |
| 63 process_host->RegisterMojoServices(); |
| 63 process_host->GetRemoteInterfaces()->GetInterface(std::move(request)); | 64 process_host->GetRemoteInterfaces()->GetInterface(std::move(request)); |
| 64 } | 65 } |
| 65 | 66 |
| 66 void StartServiceInUtilityProcess( | 67 void StartServiceInUtilityProcess( |
| 67 const std::string& service_name, | 68 const std::string& service_name, |
| 68 const base::string16& process_name, | 69 const base::string16& process_name, |
| 69 bool use_sandbox, | 70 bool use_sandbox, |
| 70 service_manager::mojom::ServiceRequest request) { | 71 service_manager::mojom::ServiceRequest request) { |
| 71 service_manager::mojom::ServiceFactoryPtr service_factory; | 72 service_manager::mojom::ServiceFactoryPtr service_factory; |
| 72 BrowserThread::PostTask( | 73 BrowserThread::PostTask( |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 base::Bind(&DestroyConnectorOnIOThread)); | 352 base::Bind(&DestroyConnectorOnIOThread)); |
| 352 } | 353 } |
| 353 | 354 |
| 354 // static | 355 // static |
| 355 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { | 356 service_manager::Connector* ServiceManagerContext::GetConnectorForIOThread() { |
| 356 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 357 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 357 return g_io_thread_connector.Get().get(); | 358 return g_io_thread_connector.Get().get(); |
| 358 } | 359 } |
| 359 | 360 |
| 360 } // namespace content | 361 } // namespace content |
| OLD | NEW |