Commit 1955ae62 authored by evliu's avatar evliu Committed by Chromium LUCI CQ

Add check to verify that the speech recognition service is still active before...

Add check to verify that the speech recognition service is still active before sending data down the pipe

This CL contains a speculative fix that addresses a crash when calling AudioReceivedAfterBubbleClosed after the caption bubble is closed. I haven't been able to repro this crash and thus have not been able to verify this fix; however, the recognition client shouldn't send data to the speech recognition recognizer if the speech recognition service is destroyed anyways so this fix is of very low risk.

Bug: 1161756
Change-Id: Ied868dfa17966650f79ceb954a6ac694f59e33d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2605295Reviewed-by: default avatarChrome Cunningham <chcunningham@chromium.org>
Commit-Queue: Evan Liu <evliu@google.com>
Cr-Commit-Position: refs/heads/master@{#839606}
parent 3a8dcb83
...@@ -215,7 +215,7 @@ void ChromeSpeechRecognitionClient::SendAudioToSpeechRecognitionService( ...@@ -215,7 +215,7 @@ void ChromeSpeechRecognitionClient::SendAudioToSpeechRecognitionService(
if (IsSpeechRecognitionAvailable()) { if (IsSpeechRecognitionAvailable()) {
speech_recognition_recognizer_->SendAudioToSpeechRecognitionService( speech_recognition_recognizer_->SendAudioToSpeechRecognitionService(
std::move(audio_data)); std::move(audio_data));
} else { } else if (is_recognizer_bound_) {
speech_recognition_recognizer_->AudioReceivedAfterBubbleClosed( speech_recognition_recognizer_->AudioReceivedAfterBubbleClosed(
media::AudioTimestampHelper::FramesToTime(audio_data->frame_count, media::AudioTimestampHelper::FramesToTime(audio_data->frame_count,
audio_data->sample_rate)); audio_data->sample_rate));
......
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