#include "content/utility/utility_thread_impl.h"
#include <memory>
#include <optional>
#include <set>
#include <utility>
#include "base/command_line.h"
#include "base/containers/unique_ptr_adapters.h"
#include "base/debug/crash_logging.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/no_destructor.h"
#include "base/process/current_process.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/trace_event/trace_log.h"
#include "build/build_config.h"
#include "content/child/child_process.h"
#include "content/public/utility/content_utility_client.h"
#include "content/utility/browser_exposed_utility_interfaces.h"
#include "content/utility/services.h"
#include "content/utility/utility_blink_platform_with_sandbox_support_impl.h"
#include "mojo/public/cpp/bindings/binder_map.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/service_factory.h"
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include "content/child/sandboxed_process_thread_type_handler.h"
#endif
namespace content {
namespace {
class ServiceBinderImpl { … };
ChildThreadImpl::Options::ServiceBinder GetServiceBinder() { … }
}
UtilityThreadImpl::UtilityThreadImpl(base::RepeatingClosure quit_closure)
: … { … }
UtilityThreadImpl::UtilityThreadImpl(const InProcessChildThreadParams& params)
: … { … }
UtilityThreadImpl::~UtilityThreadImpl() = default;
void UtilityThreadImpl::Shutdown() { … }
void UtilityThreadImpl::ReleaseProcess() { … }
void UtilityThreadImpl::EnsureBlinkInitialized() { … }
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID)
void UtilityThreadImpl::EnsureBlinkInitializedWithSandboxSupport() { … }
#endif
void UtilityThreadImpl::HandleServiceRequest(
mojo::GenericPendingReceiver receiver,
base::OnceClosure termination_callback) { … }
void UtilityThreadImpl::EnsureBlinkInitializedInternal(bool sandbox_support) { … }
void UtilityThreadImpl::Init() { … }
constexpr ServiceCurrentProcessType kCurrentProcessTypes[] = …;
CurrentProcessType GetCurrentProcessType(const std::string& name) { … }
}