diff options
Diffstat (limited to 'www/chromium/files/patch-content_utility_utility__main.cc')
-rw-r--r-- | www/chromium/files/patch-content_utility_utility__main.cc | 54 |
1 files changed, 33 insertions, 21 deletions
diff --git a/www/chromium/files/patch-content_utility_utility__main.cc b/www/chromium/files/patch-content_utility_utility__main.cc index cbb896bebdc2..16f94dca3000 100644 --- a/www/chromium/files/patch-content_utility_utility__main.cc +++ b/www/chromium/files/patch-content_utility_utility__main.cc @@ -1,6 +1,6 @@ ---- content/utility/utility_main.cc.orig 2025-08-07 06:57:29 UTC +--- content/utility/utility_main.cc.orig 2025-09-06 10:01:20 UTC +++ content/utility/utility_main.cc -@@ -38,15 +38,19 @@ +@@ -39,17 +39,21 @@ #include "services/tracing/public/cpp/trace_startup.h" #include "services/video_effects/public/cpp/buildflags.h" @@ -15,13 +15,15 @@ +#endif #include "content/public/common/content_descriptor_keys.h" #include "content/utility/speech/speech_recognition_sandbox_hook_linux.h" + #include "media/gpu/buildflags.h" + #include "media/media_buildflags.h" +#if !BUILDFLAG(IS_BSD) #include "sandbox/policy/linux/sandbox_linux.h" +#endif #include "services/audio/audio_sandbox_hook_linux.h" #include "services/network/network_sandbox_hook_linux.h" #include "services/screen_ai/buildflags/buildflags.h" -@@ -77,7 +81,12 @@ +@@ -84,7 +88,12 @@ #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) @@ -35,7 +37,7 @@ #include "services/video_effects/video_effects_sandbox_hook_linux.h" // nogncheck #endif // BUILDFLAG(IS_LINUX) -@@ -112,7 +121,7 @@ +@@ -121,7 +130,7 @@ sandbox::TargetServices* g_utility_target_services = nullptr; #endif // BUILDFLAG(IS_WIN) @@ -44,7 +46,7 @@ #include "components/services/on_device_translation/sandbox_hook.h" #endif // BUILDFLAG(ENABLE_ON_DEVICE_TRANSLATION) && BUILDFLAG(IS_LINUX) -@@ -120,7 +129,7 @@ namespace content { +@@ -129,7 +138,7 @@ namespace content { namespace { @@ -53,26 +55,27 @@ std::vector<std::string> GetNetworkContextsParentDirectories() { base::MemoryMappedFile::Region region; base::ScopedFD read_pipe_fd = base::FileDescriptorStore::GetInstance().TakeFD( -@@ -268,7 +277,8 @@ int UtilityMain(MainFunctionParams parameters) { +@@ -284,7 +293,7 @@ int UtilityMain(MainFunctionParams parameters) { + CHECK(on_device_model::PreSandboxInit()); } - #endif // BUILDFLAG(USE_LINUX_VIDEO_ACCELERATION) && BUILDFLAG(USE_VAAPI) -#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+// XXX BSD -+#if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && !BUILDFLAG(IS_BSD) - // Thread type delegate of the process should be registered before first ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + + #if BUILDFLAG(USE_LINUX_VIDEO_ACCELERATION) && BUILDFLAG(USE_VAAPI) + // Regardless of the sandbox status, the VaapiWrapper needs to be initialized +@@ -299,7 +308,10 @@ int UtilityMain(MainFunctionParams parameters) { // thread type change in ChildProcess constructor. It also needs to be // registered before the process has multiple threads, which may race with -@@ -276,7 +286,7 @@ int UtilityMain(MainFunctionParams parameters) { + // application of the sandbox. ++// XXX BSD ++#if !BUILDFLAG(IS_BSD) SandboxedProcessThreadTypeHandler::Create(); - #endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#endif --#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) -+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) // Initializes the sandbox before any threads are created. // TODO(jorgelo): move this after GTK initialization when we enable a strict - // Seccomp-BPF policy. -@@ -308,7 +318,7 @@ int UtilityMain(MainFunctionParams parameters) { +@@ -331,7 +343,7 @@ int UtilityMain(MainFunctionParams parameters) { pre_sandbox_hook = base::BindOnce(&speech::SpeechRecognitionPreSandboxHook); break; @@ -81,7 +84,7 @@ case sandbox::mojom::Sandbox::kOnDeviceTranslation: pre_sandbox_hook = base::BindOnce( &on_device_translation::OnDeviceTranslationSandboxHook); -@@ -324,7 +334,7 @@ int UtilityMain(MainFunctionParams parameters) { +@@ -347,7 +359,7 @@ int UtilityMain(MainFunctionParams parameters) { #else NOTREACHED(); #endif @@ -90,7 +93,16 @@ case sandbox::mojom::Sandbox::kVideoEffects: #if BUILDFLAG(ENABLE_VIDEO_EFFECTS) pre_sandbox_hook = -@@ -359,6 +369,7 @@ int UtilityMain(MainFunctionParams parameters) { +@@ -355,7 +367,7 @@ int UtilityMain(MainFunctionParams parameters) { + #endif + break; + #endif // BUILDFLAG(IS_LINUX) +-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) + case sandbox::mojom::Sandbox::kShapeDetection: + pre_sandbox_hook = + base::BindOnce(&shape_detection::ShapeDetectionPreSandboxHook); +@@ -390,6 +402,7 @@ int UtilityMain(MainFunctionParams parameters) { default: break; } @@ -98,7 +110,7 @@ if (!sandbox::policy::IsUnsandboxedSandboxType(sandbox_type) && (parameters.zygote_child || !pre_sandbox_hook.is_null())) { sandbox_options.use_amd_specific_policies = -@@ -366,6 +377,11 @@ int UtilityMain(MainFunctionParams parameters) { +@@ -397,6 +410,11 @@ int UtilityMain(MainFunctionParams parameters) { sandbox::policy::Sandbox::Initialize( sandbox_type, std::move(pre_sandbox_hook), sandbox_options); } @@ -108,5 +120,5 @@ + sandbox::policy::SandboxLinux::Options()); +#endif - // Start the HangWatcher now that the sandbox is engaged, if it hasn't - // already been started. + // Startup tracing creates a tracing thread, which is incompatible on + // platforms that require single-threaded sandbox initialization. In these |