diff options
Diffstat (limited to 'chromium/content/utility/utility_service_factory.cc')
-rw-r--r-- | chromium/content/utility/utility_service_factory.cc | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/chromium/content/utility/utility_service_factory.cc b/chromium/content/utility/utility_service_factory.cc index 9b0759ab820..2c1c7f992f2 100644 --- a/chromium/content/utility/utility_service_factory.cc +++ b/chromium/content/utility/utility_service_factory.cc @@ -47,6 +47,7 @@ #include "base/mac/mach_logging.h" #include "sandbox/mac/system_services.h" #include "services/service_manager/sandbox/features.h" +#include "services/service_manager/sandbox/sandbox_type.h" #endif #if defined(OS_WIN) @@ -59,10 +60,6 @@ namespace content { namespace { -void TerminateThisProcess() { - UtilityThread::Get()->ReleaseProcess(); -} - #if BUILDFLAG(ENABLE_LIBRARY_CDMS) std::unique_ptr<media::CdmAuxiliaryHelper> CreateCdmHelper( @@ -100,26 +97,6 @@ class ContentCdmServiceClient final : public media::CdmService::Client { #endif // BUILDFLAG(ENABLE_LIBRARY_CDMS) -void RunNetworkServiceOnIOThread( - service_manager::mojom::ServiceRequest service_request, - std::unique_ptr<service_manager::BinderRegistry> network_registry, - scoped_refptr<base::SequencedTaskRunner> main_thread_task_runner) { - auto service = std::make_unique<network::NetworkService>( - std::move(network_registry), nullptr /* request */, - std::move(service_request), true); - - // Transfer ownership of the service to itself, and have it post to the main - // thread on self-termination to kill the process. - auto* raw_service = service.get(); - raw_service->set_termination_closure(base::BindOnce( - [](std::unique_ptr<network::NetworkService> service, - scoped_refptr<base::SequencedTaskRunner> main_thread_task_runner) { - main_thread_task_runner->PostTask( - FROM_HERE, base::BindOnce(&TerminateThisProcess)); - }, - std::move(service), std::move(main_thread_task_runner))); -} - } // namespace UtilityServiceFactory::UtilityServiceFactory() @@ -153,17 +130,6 @@ void UtilityServiceFactory::RunService( !base::FeatureList::IsEnabled( features::kTracingServiceInProcess)) { service = std::make_unique<tracing::TracingService>(std::move(request)); - } else if (service_name == mojom::kNetworkServiceName) { - // Unlike other services supported by the utility process, the network - // service runs on the IO thread and never self-terminates. - GetContentClient()->utility()->RegisterNetworkBinders( - network_registry_.get()); - ChildProcess::current()->io_task_runner()->PostTask( - FROM_HERE, - base::BindOnce(&RunNetworkServiceOnIOThread, std::move(request), - std::move(network_registry_), - base::SequencedTaskRunnerHandle::Get())); - return; } #if BUILDFLAG(ENABLE_LIBRARY_CDMS) else if (service_name == media::mojom::kCdmServiceName) { @@ -199,8 +165,7 @@ UtilityServiceFactory::CreateAudioService( #if defined(OS_MACOSX) // Don't connect to launch services when running sandboxed // (https://crbug.com/874785). - if (base::FeatureList::IsEnabled( - service_manager::features::kAudioServiceSandbox)) { + if (service_manager::IsAudioSandboxEnabled()) { sandbox::DisableLaunchServices(); } |