Commit 356a78bd authored by David Tseng's avatar David Tseng Committed by Commit Bot

Handle tts utility process teardown on component extension unload

This change handles a corner case where the tts utility process stays around
after the component extension gets unloaded. On re-load, the utility process is
re-started correctly without this change (i.e. there are not multiple tts utility processes run), so
this change is a minor cleanup.

R=dmazzoni@chromium.org

Test: trigger tts (e.g. via ChromeVox), attach to the utility process and wait
for the tts component extension to be evicted after 15 seconds. Verify the
utility process exits cleanly.

Change-Id: Ieadf44d45ba902e298bf4497bc7433d44aa1a6cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2471803Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: David Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817194}
parent 2e59f35a
...@@ -61,6 +61,11 @@ void TtsService::BindTtsStream( ...@@ -61,6 +61,11 @@ void TtsService::BindTtsStream(
mojo::PendingReceiver<mojom::TtsStream> receiver, mojo::PendingReceiver<mojom::TtsStream> receiver,
mojo::PendingRemote<audio::mojom::StreamFactory> factory) { mojo::PendingRemote<audio::mojom::StreamFactory> factory) {
stream_receiver_.Bind(std::move(receiver)); stream_receiver_.Bind(std::move(receiver));
stream_receiver_.set_disconnect_handler(base::BindOnce([] {
// The remote which lives in component extension js has been disconnected
// due to destruction or error.
exit(0);
}));
// TODO(accessibility): The sample rate below can change based on the audio // TODO(accessibility): The sample rate below can change based on the audio
// data retrieved. Plumb this data through and re-create the output device if // data retrieved. Plumb this data through and re-create the output device if
......
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