Commit 3a72c5d2 authored by evliu's avatar evliu Committed by Commit Bot

Check if mojo pipe is bound before binding speech recognition context

This CL adds a check to prevent binding the speech recognition context
if the mojo pipe to the speech recognition service is not bound. This
can occur if the Speech On-Device API (SODA) files were not found.

Bug: 1147226
Change-Id: I86fe0a4b9fe80de0449e196b451423cbcf2b8a60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2538054Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Commit-Queue: Evan Liu <evliu@google.com>
Cr-Commit-Position: refs/heads/master@{#827427}
parent 3a1fd9be
...@@ -32,7 +32,9 @@ SpeechRecognitionService::~SpeechRecognitionService() = default; ...@@ -32,7 +32,9 @@ SpeechRecognitionService::~SpeechRecognitionService() = default;
void SpeechRecognitionService::Create( void SpeechRecognitionService::Create(
mojo::PendingReceiver<media::mojom::SpeechRecognitionContext> receiver) { mojo::PendingReceiver<media::mojom::SpeechRecognitionContext> receiver) {
LaunchIfNotRunning(); LaunchIfNotRunning();
speech_recognition_service_->BindContext(std::move(receiver));
if (speech_recognition_service_.is_bound())
speech_recognition_service_->BindContext(std::move(receiver));
} }
void SpeechRecognitionService::OnNetworkServiceDisconnect() { void SpeechRecognitionService::OnNetworkServiceDisconnect() {
......
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