Commit 2bc83fa1 authored by hans@chromium.org's avatar hans@chromium.org

Don't reset speech_recognition_manager_ in BrowserMainLoop::ShutdownThreadsAndCleanUp()

Instead, let it be reset during the destruction of BrowserMainLoop, which
happens after the IO thread has been shutdown.

This prevents a race condition between ShutdownThreadsAndCleanUp() and the
destructor of InputTagSpeechDispatcherHost. The latter runs on the IO thread,
and could sometimes end up trying to use the SpeechRecognitionManager
at the same time as it was being destructed.

Tested by running WorkerTest.QueuedSharedWorkerShutdown a couple of hundred
times under ASan, as well as running existing speech tests.

BUG=none


Review URL: https://chromiumcodereview.appspot.com/10836007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149394 0039d316-1c4b-4281-b951-d872f2087c98
parent 6057a488
...@@ -498,8 +498,6 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() { ...@@ -498,8 +498,6 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
if (resource_dispatcher_host_.get()) if (resource_dispatcher_host_.get())
resource_dispatcher_host_.get()->Shutdown(); resource_dispatcher_host_.get()->Shutdown();
speech_recognition_manager_.reset();
#if defined(USE_AURA) #if defined(USE_AURA)
ImageTransportFactory::Terminate(); ImageTransportFactory::Terminate();
#endif #endif
......
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