summaryrefslogtreecommitdiff
path: root/chromium/content/utility
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-06 12:48:11 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:33:43 +0000
commit7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (patch)
treefa14ba0ca8d2683ba2efdabd246dc9b18a1229c6 /chromium/content/utility
parent79b4f909db1049fca459c07cca55af56a9b54fe3 (diff)
downloadqtwebengine-chromium-7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3.tar.gz
BASELINE: Update Chromium to 84.0.4147.141
Change-Id: Ib85eb4cfa1cbe2b2b81e5022c8cad5c493969535 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/content/utility')
-rw-r--r--chromium/content/utility/BUILD.gn2
-rw-r--r--chromium/content/utility/services.cc25
-rw-r--r--chromium/content/utility/soda/OWNERS3
-rw-r--r--chromium/content/utility/speech/BUILD.gn (renamed from chromium/content/utility/soda/BUILD.gn)6
-rw-r--r--chromium/content/utility/speech/DEPS (renamed from chromium/content/utility/soda/DEPS)0
-rw-r--r--chromium/content/utility/speech/OWNERS3
-rw-r--r--chromium/content/utility/speech/speech_recognition_sandbox_hook_linux.cc (renamed from chromium/content/utility/soda/soda_sandbox_hook_linux.cc)10
-rw-r--r--chromium/content/utility/speech/speech_recognition_sandbox_hook_linux.h (renamed from chromium/content/utility/soda/soda_sandbox_hook_linux.h)13
-rw-r--r--chromium/content/utility/utility_main.cc17
9 files changed, 53 insertions, 26 deletions
diff --git a/chromium/content/utility/BUILD.gn b/chromium/content/utility/BUILD.gn
index 493cd749363..5f891b017a2 100644
--- a/chromium/content/utility/BUILD.gn
+++ b/chromium/content/utility/BUILD.gn
@@ -83,7 +83,7 @@ jumbo_source_set("utility") {
}
if (is_linux) {
- deps += [ "//content/utility/soda:soda_sandbox_hook" ]
+ deps += [ "//content/utility/speech:speech_recognition_sandbox_hook" ]
}
if (enable_vr && !is_android) {
diff --git a/chromium/content/utility/services.cc b/chromium/content/utility/services.cc
index 977a53e27be..d27de48acad 100644
--- a/chromium/content/utility/services.cc
+++ b/chromium/content/utility/services.cc
@@ -49,6 +49,7 @@
#endif
#if defined(OS_WIN)
+#include "base/win/scoped_com_initializer.h"
#include "sandbox/win/src/sandbox.h"
extern sandbox::TargetServices* g_utility_target_services;
@@ -62,7 +63,7 @@ namespace {
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
std::unique_ptr<media::CdmAuxiliaryHelper> CreateCdmHelper(
- service_manager::mojom::InterfaceProvider* interface_provider) {
+ media::mojom::FrameInterfaceFactory* interface_provider) {
return std::make_unique<media::MojoCdmHelper>(interface_provider);
}
@@ -80,9 +81,9 @@ class ContentCdmServiceClient final : public media::CdmService::Client {
}
std::unique_ptr<media::CdmFactory> CreateCdmFactory(
- service_manager::mojom::InterfaceProvider* host_interfaces) override {
+ media::mojom::FrameInterfaceFactory* frame_interfaces) override {
return std::make_unique<media::CdmAdapterFactory>(
- base::BindRepeating(&CreateCdmHelper, host_interfaces));
+ base::BindRepeating(&CreateCdmHelper, frame_interfaces));
}
#if BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION)
@@ -95,6 +96,22 @@ class ContentCdmServiceClient final : public media::CdmService::Client {
};
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
+class UtilityThreadVideoCaptureServiceImpl final
+ : public video_capture::VideoCaptureServiceImpl {
+ public:
+ explicit UtilityThreadVideoCaptureServiceImpl(
+ mojo::PendingReceiver<video_capture::mojom::VideoCaptureService> receiver,
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
+ : VideoCaptureServiceImpl(std::move(receiver),
+ std::move(ui_task_runner)) {}
+
+ private:
+#if defined(OS_WIN)
+ base::win::ScopedCOMInitializer com_initializer_{
+ base::win::ScopedCOMInitializer::kMTA};
+#endif
+};
+
auto RunNetworkService(
mojo::PendingReceiver<network::mojom::NetworkService> receiver) {
auto binders = std::make_unique<service_manager::BinderRegistry>();
@@ -164,7 +181,7 @@ auto RunTracing(
auto RunVideoCapture(
mojo::PendingReceiver<video_capture::mojom::VideoCaptureService> receiver) {
- return std::make_unique<video_capture::VideoCaptureServiceImpl>(
+ return std::make_unique<UtilityThreadVideoCaptureServiceImpl>(
std::move(receiver), base::ThreadTaskRunnerHandle::Get());
}
diff --git a/chromium/content/utility/soda/OWNERS b/chromium/content/utility/soda/OWNERS
deleted file mode 100644
index 97961fa525e..00000000000
--- a/chromium/content/utility/soda/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-per-file soda_sandbox_hook_linux.*=file://sandbox/linux/OWNERS
-
-# COMPONENT: Internals>Sandbox
diff --git a/chromium/content/utility/soda/BUILD.gn b/chromium/content/utility/speech/BUILD.gn
index fd62e929762..7a8ad15b25e 100644
--- a/chromium/content/utility/soda/BUILD.gn
+++ b/chromium/content/utility/speech/BUILD.gn
@@ -2,10 +2,10 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-source_set("soda_sandbox_hook") {
+source_set("speech_recognition_sandbox_hook") {
sources = [
- "soda_sandbox_hook_linux.cc",
- "soda_sandbox_hook_linux.h",
+ "speech_recognition_sandbox_hook_linux.cc",
+ "speech_recognition_sandbox_hook_linux.h",
]
deps = [
diff --git a/chromium/content/utility/soda/DEPS b/chromium/content/utility/speech/DEPS
index 4e9e1336acb..4e9e1336acb 100644
--- a/chromium/content/utility/soda/DEPS
+++ b/chromium/content/utility/speech/DEPS
diff --git a/chromium/content/utility/speech/OWNERS b/chromium/content/utility/speech/OWNERS
new file mode 100644
index 00000000000..0aa0cfce167
--- /dev/null
+++ b/chromium/content/utility/speech/OWNERS
@@ -0,0 +1,3 @@
+per-file speech_recognition_sandbox_hook_linux.*=file://sandbox/linux/OWNERS
+
+# COMPONENT: Internals>Sandbox
diff --git a/chromium/content/utility/soda/soda_sandbox_hook_linux.cc b/chromium/content/utility/speech/speech_recognition_sandbox_hook_linux.cc
index b94592d20b8..6d8e9ed2e41 100644
--- a/chromium/content/utility/soda/soda_sandbox_hook_linux.cc
+++ b/chromium/content/utility/speech/speech_recognition_sandbox_hook_linux.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/utility/soda/soda_sandbox_hook_linux.h"
+#include "content/utility/speech/speech_recognition_sandbox_hook_linux.h"
#include <dlfcn.h>
@@ -13,10 +13,11 @@
using sandbox::syscall_broker::BrokerFilePermission;
using sandbox::syscall_broker::MakeBrokerCommandSet;
-namespace soda {
+namespace speech {
namespace {
+// Gets the file permissions required by the Speech On-Device API (SODA).
std::vector<BrokerFilePermission> GetSodaFilePermissions(
base::FilePath latest_version_dir) {
std::vector<BrokerFilePermission> permissions{
@@ -35,7 +36,8 @@ std::vector<BrokerFilePermission> GetSodaFilePermissions(
} // namespace
-bool SodaPreSandboxHook(service_manager::SandboxLinux::Options options) {
+bool SpeechRecognitionPreSandboxHook(
+ service_manager::SandboxLinux::Options options) {
void* soda_library = dlopen(GetSodaBinaryPath().value().c_str(),
RTLD_NOW | RTLD_GLOBAL | RTLD_NODELETE);
DCHECK(soda_library);
@@ -55,4 +57,4 @@ bool SodaPreSandboxHook(service_manager::SandboxLinux::Options options) {
return true;
}
-} // namespace soda
+} // namespace speech
diff --git a/chromium/content/utility/soda/soda_sandbox_hook_linux.h b/chromium/content/utility/speech/speech_recognition_sandbox_hook_linux.h
index 65efc1f6bac..7fdfd3b7436 100644
--- a/chromium/content/utility/soda/soda_sandbox_hook_linux.h
+++ b/chromium/content/utility/speech/speech_recognition_sandbox_hook_linux.h
@@ -2,17 +2,18 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_UTILITY_SODA_SODA_SANDBOX_HOOK_LINUX_H_
-#define CONTENT_UTILITY_SODA_SODA_SANDBOX_HOOK_LINUX_H_
+#ifndef CONTENT_UTILITY_SPEECH_SPEECH_RECOGNITION_SANDBOX_HOOK_LINUX_H_
+#define CONTENT_UTILITY_SPEECH_SPEECH_RECOGNITION_SANDBOX_HOOK_LINUX_H_
#include "services/service_manager/sandbox/linux/sandbox_linux.h"
-namespace soda {
+namespace speech {
// Opens the libsoda.so binary and grants broker file permissions to the
// necessary files required by the binary.
-bool SodaPreSandboxHook(service_manager::SandboxLinux::Options options);
+bool SpeechRecognitionPreSandboxHook(
+ service_manager::SandboxLinux::Options options);
-} // namespace soda
+} // namespace speech
-#endif // CONTENT_UTILITY_SODA_SODA_SANDBOX_HOOK_LINUX_H_
+#endif // CONTENT_UTILITY_SPEECH_SPEECH_RECOGNITION_SANDBOX_HOOK_LINUX_H_
diff --git a/chromium/content/utility/utility_main.cc b/chromium/content/utility/utility_main.cc
index bfd4417b6d8..58372b4a2cc 100644
--- a/chromium/content/utility/utility_main.cc
+++ b/chromium/content/utility/utility_main.cc
@@ -23,7 +23,7 @@
#include "services/tracing/public/cpp/trace_startup.h"
#if defined(OS_LINUX)
-#include "content/utility/soda/soda_sandbox_hook_linux.h"
+#include "content/utility/speech/speech_recognition_sandbox_hook_linux.h"
#include "services/audio/audio_sandbox_hook_linux.h"
#include "services/network/network_sandbox_hook_linux.h"
#include "services/service_manager/sandbox/linux/sandbox_linux.h"
@@ -48,7 +48,7 @@ namespace content {
// Mainline routine for running as the utility process.
int UtilityMain(const MainFunctionParams& parameters) {
- const base::MessagePumpType message_pump_type =
+ base::MessagePumpType message_pump_type =
parameters.command_line.HasSwitch(switches::kMessageLoopTypeUi)
? base::MessagePumpType::UI
: base::MessagePumpType::DEFAULT;
@@ -66,6 +66,12 @@ int UtilityMain(const MainFunctionParams& parameters) {
});
#endif
+#if defined(OS_FUCHSIA)
+ // On Fuchsia always use IO threads to allow FIDL calls.
+ if (message_pump_type == base::MessagePumpType::DEFAULT)
+ message_pump_type = base::MessagePumpType::IO;
+#endif // defined(OS_FUCHSIA)
+
// The main task executor of the utility process.
base::SingleThreadTaskExecutor main_thread_task_executor(message_pump_type);
base::PlatformThread::SetName("CrUtilityMain");
@@ -85,14 +91,15 @@ int UtilityMain(const MainFunctionParams& parameters) {
sandbox_type == service_manager::SandboxType::kIme ||
#endif // OS_CHROMEOS
sandbox_type == service_manager::SandboxType::kAudio ||
- sandbox_type == service_manager::SandboxType::kSoda) {
+ sandbox_type == service_manager::SandboxType::kSpeechRecognition) {
service_manager::SandboxLinux::PreSandboxHook pre_sandbox_hook;
if (sandbox_type == service_manager::SandboxType::kNetwork)
pre_sandbox_hook = base::BindOnce(&network::NetworkPreSandboxHook);
else if (sandbox_type == service_manager::SandboxType::kAudio)
pre_sandbox_hook = base::BindOnce(&audio::AudioPreSandboxHook);
- else if (sandbox_type == service_manager::SandboxType::kSoda)
- pre_sandbox_hook = base::BindOnce(&soda::SodaPreSandboxHook);
+ else if (sandbox_type == service_manager::SandboxType::kSpeechRecognition)
+ pre_sandbox_hook =
+ base::BindOnce(&speech::SpeechRecognitionPreSandboxHook);
#if defined(OS_CHROMEOS)
else if (sandbox_type == service_manager::SandboxType::kIme)
pre_sandbox_hook = base::BindOnce(&chromeos::ime::ImePreSandboxHook);