diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-11-18 16:35:47 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-11-18 15:45:54 +0000 |
commit | 32f5a1c56531e4210bc4cf8d8c7825d66e081888 (patch) | |
tree | eeeec6822f4d738d8454525233fd0e2e3a659e6d /chromium/content/utility | |
parent | 99677208ff3b216fdfec551fbe548da5520cd6fb (diff) | |
download | qtwebengine-chromium-32f5a1c56531e4210bc4cf8d8c7825d66e081888.tar.gz |
BASELINE: Update Chromium to 87.0.4280.67
Change-Id: Ib157360be8c2ffb2c73125751a89f60e049c1d54
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/content/utility')
4 files changed, 18 insertions, 11 deletions
diff --git a/chromium/content/utility/speech/speech_recognition_sandbox_hook_linux.cc b/chromium/content/utility/speech/speech_recognition_sandbox_hook_linux.cc index 4fba6a4f26c..25dd0046b57 100644 --- a/chromium/content/utility/speech/speech_recognition_sandbox_hook_linux.cc +++ b/chromium/content/utility/speech/speech_recognition_sandbox_hook_linux.cc @@ -18,8 +18,8 @@ namespace speech { namespace { // Gets the file permissions required by the Speech On-Device API (SODA). -std::vector<BrokerFilePermission> GetSodaFilePermissions( - base::FilePath soda_dir) { +std::vector<BrokerFilePermission> GetSodaFilePermissions() { + auto soda_dir = GetSodaDirectory(); std::vector<BrokerFilePermission> permissions{ BrokerFilePermission::ReadOnly("/dev/urandom")}; @@ -29,6 +29,13 @@ std::vector<BrokerFilePermission> GetSodaFilePermissions( soda_dir.AsEndingWithSeparator().value())); } + // This may happen if a user doesn't have any language packs installed. + auto language_packs_dir = GetSodaLanguagePacksDirectory(); + if (!language_packs_dir.empty()) { + permissions.push_back(BrokerFilePermission::ReadOnlyRecursive( + language_packs_dir.AsEndingWithSeparator().value())); + } + return permissions; } @@ -47,7 +54,7 @@ bool SpeechRecognitionPreSandboxHook( sandbox::syscall_broker::COMMAND_READLINK, sandbox::syscall_broker::COMMAND_STAT, }), - GetSodaFilePermissions(GetSodaDirectory()), + GetSodaFilePermissions(), sandbox::policy::SandboxLinux::PreSandboxHook(), options); instance->EngageNamespaceSandboxIfPossible(); diff --git a/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.cc b/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.cc index 47ecb8706bb..f61fcf860fe 100644 --- a/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.cc +++ b/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.cc @@ -9,7 +9,7 @@ #if defined(OS_MAC) #include "content/child/child_process_sandbox_support_impl_mac.h" -#elif defined(OS_LINUX) +#elif defined(OS_LINUX) || defined(OS_CHROMEOS) #include "content/child/child_process_sandbox_support_impl_linux.h" #endif @@ -17,7 +17,7 @@ namespace content { UtilityBlinkPlatformWithSandboxSupportImpl:: UtilityBlinkPlatformWithSandboxSupportImpl() { -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_CHROMEOS) mojo::PendingRemote<font_service::mojom::FontService> font_service; UtilityThread::Get()->BindHostReceiver( font_service.InitWithNewPipeAndPassReceiver()); @@ -34,7 +34,7 @@ UtilityBlinkPlatformWithSandboxSupportImpl:: blink::WebSandboxSupport* UtilityBlinkPlatformWithSandboxSupportImpl::GetSandboxSupport() { -#if defined(OS_LINUX) || defined(OS_MAC) +#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC) return sandbox_support_.get(); #else return nullptr; diff --git a/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.h b/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.h index dd6e0f23e54..fcba9fec774 100644 --- a/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.h +++ b/chromium/content/utility/utility_blink_platform_with_sandbox_support_impl.h @@ -11,7 +11,7 @@ #include "build/build_config.h" #include "third_party/blink/public/platform/platform.h" -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_CHROMEOS) #include "components/services/font/public/cpp/font_loader.h" // nogncheck #include "third_party/skia/include/core/SkRefCnt.h" // nogncheck #endif @@ -33,10 +33,10 @@ class UtilityBlinkPlatformWithSandboxSupportImpl : public blink::Platform { blink::WebSandboxSupport* GetSandboxSupport() override; private: -#if defined(OS_LINUX) || defined(OS_MAC) +#if defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_MAC) std::unique_ptr<blink::WebSandboxSupport> sandbox_support_; #endif -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_CHROMEOS) sk_sp<font_service::FontLoader> font_loader_; #endif diff --git a/chromium/content/utility/utility_main.cc b/chromium/content/utility/utility_main.cc index fb930c46bed..06370ca595a 100644 --- a/chromium/content/utility/utility_main.cc +++ b/chromium/content/utility/utility_main.cc @@ -24,7 +24,7 @@ #include "sandbox/policy/sandbox.h" #include "services/tracing/public/cpp/trace_startup.h" -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_CHROMEOS) #include "content/utility/speech/speech_recognition_sandbox_hook_linux.h" #include "sandbox/policy/linux/sandbox_linux.h" #include "services/audio/audio_sandbox_hook_linux.h" @@ -82,7 +82,7 @@ int UtilityMain(const MainFunctionParams& parameters) { if (parameters.command_line.HasSwitch(switches::kUtilityStartupDialog)) WaitForDebugger("Utility"); -#if defined(OS_LINUX) +#if defined(OS_LINUX) || defined(OS_CHROMEOS) // Initializes the sandbox before any threads are created. // TODO(jorgelo): move this after GTK initialization when we enable a strict // Seccomp-BPF policy. |