Commit 725ad66a authored by evliu's avatar evliu Committed by Commit Bot

Update the Speech Recognition sandbox to accommodate Cloud Speech-to-Text

The Speech On-Device API (SODA) will not be available on Windows until
later in the year, so the Live Caption feature will initially launch
using the Cloud Speech-to-Text API. This CL updates the sandbox of the
speech recognition service to use the kUtility sandbox in the event
SODA is not available, as the Cloud Speech-to-Text implementation will
not require the permissions allowed by the kSpeechRecognition sandbox
type.

Bug: 1072846
Change-Id: I7b0ce61850115b476f1f38e81790a0b205ec56c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2157997Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Commit-Queue: Evan Liu <evliu@google.com>
Cr-Commit-Position: refs/heads/master@{#766458}
parent eb451546
...@@ -3803,6 +3803,7 @@ jumbo_static_library("browser") { ...@@ -3803,6 +3803,7 @@ jumbo_static_library("browser") {
"//chrome/services/app_service/public/cpp:publisher", "//chrome/services/app_service/public/cpp:publisher",
"//chrome/services/sharing/public/cpp", "//chrome/services/sharing/public/cpp",
"//chrome/services/sharing/public/mojom", "//chrome/services/sharing/public/mojom",
"//chrome/services/speech:buildflags",
"//components/feedback", "//components/feedback",
"//components/image_fetcher/core", "//components/image_fetcher/core",
"//components/keep_alive_registry", "//components/keep_alive_registry",
......
include_rules = [
"+chrome/services/speech/buildflags.h",
]
...@@ -6,4 +6,7 @@ per-file *tts_*=dmazzoni@chromium.org ...@@ -6,4 +6,7 @@ per-file *tts_*=dmazzoni@chromium.org
per-file *tts_*=dtseng@chromium.org per-file *tts_*=dtseng@chromium.org
per-file *tts_*=katie@chromium.org per-file *tts_*=katie@chromium.org
# Speech recognition service
per-file *speech_recognition_service*=evliu@google.com
# COMPONENT: Blink>Speech # COMPONENT: Blink>Speech
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "chrome/browser/speech/speech_recognition_service.h" #include "chrome/browser/speech/speech_recognition_service.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "chrome/services/speech/buildflags.h"
#include "content/public/browser/service_process_host.h" #include "content/public/browser/service_process_host.h"
namespace speech { namespace speech {
...@@ -28,7 +29,13 @@ void SpeechRecognitionService::LaunchIfNotRunning() { ...@@ -28,7 +29,13 @@ void SpeechRecognitionService::LaunchIfNotRunning() {
speech_recognition_service_.BindNewPipeAndPassReceiver(), speech_recognition_service_.BindNewPipeAndPassReceiver(),
content::ServiceProcessHost::Options() content::ServiceProcessHost::Options()
.WithDisplayName(IDS_UTILITY_PROCESS_SPEECH_RECOGNITION_SERVICE_NAME) .WithDisplayName(IDS_UTILITY_PROCESS_SPEECH_RECOGNITION_SERVICE_NAME)
// Use the custom speech recognition sandbox type if the Speech On-Device API
// is enabled. Otherwise, use the utility sandbox type.
#if BUILDFLAG(ENABLE_SODA)
.WithSandboxType(service_manager::SandboxType::kSpeechRecognition) .WithSandboxType(service_manager::SandboxType::kSpeechRecognition)
#else
.WithSandboxType(service_manager::SandboxType::kUtility)
#endif // BUILDFLAG(ENABLE_SODA)
.Pass()); .Pass());
// Ensure that if the interface is ever disconnected (e.g. the service // Ensure that if the interface is ever disconnected (e.g. the service
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment