Potential race in SpeechRecognitionDispatcherHost |
||||
Issue descriptionCurrently, OnStartRequest is called on the UI thread and then posts a task on the IO thread to start a session. It is however possible for another message to be handled on the IO thread, while OnStartRequest is being processed on the main thread (for example, OnStopCaptureRequest). So theoretically it looks like we could have: var recognition = new SpeechRecognition(); recognition.start(); recognition.stop(); and the call to stop() fails because start() hasn't finished executing and a session hasn't started.
,
Apr 25 2018
,
Apr 26 2018
I'm not familiar with the code, but I think the mojo-y way to fix it would be to have the browser->renderer messages be sent on some interface (SpeechRecognitionClient) and send a SpeechRecognitionClientPtr in with each StartRequest (instead of request_id). Then, to stop, just destroy the SpeechRecognitionClient binding on the renderer side (no need for a separate message).
,
Apr 26 2018
That should work, I'll change the implementation to do something like that when I convert the browser->renderer messages.
,
May 22 2018
This was fixed in https://crrev.com/db1039b3ed35c9424981b4d2db15ed2cf1187f6c. Stop messages are sent on a separate pipe, and is guaranteed to be processed only after Start finishes (the pipe is only opened after Start is completed). |
||||
►
Sign in to add a comment |
||||
Comment 1 by adithyas@chromium.org
, Apr 25 2018