Commit d96e2e6a authored by Clark DuVall's avatar Clark DuVall Committed by Commit Bot

Fix flakiness in SystemDisplayApiTest.SetDisplay

RulesRegistryService posts tasks to the IO thread which access
ExtensionWebRequestEventRouter::GetInstance().
ExtensionWebRequestEventRouter accesses ExtensionsAPIClient::Get(),
which used to be destroyed before the tasks could run in some
situations. This change moves destruction of ExtensionsAPIClient
to ShellBrowserMainParts::PostDestroyThreads(), which should be
safe since tasks will no longer run at that time.

Bug: 866904
Change-Id: I974d474d08ff9d7c0c727a7c95d26f04363ce7f0
Reviewed-on: https://chromium-review.googlesource.com/1194579
Commit-Queue: Clark DuVall <cduvall@chromium.org>
Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#587343}
parent ca1cca8e
...@@ -279,8 +279,6 @@ void ShellBrowserMainParts::PostMainMessageLoopRun() { ...@@ -279,8 +279,6 @@ void ShellBrowserMainParts::PostMainMessageLoopRun() {
BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices( BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices(
browser_context_.get()); browser_context_.get());
extension_system_ = NULL; extension_system_ = NULL;
ExtensionsBrowserClient::Set(NULL);
extensions_browser_client_.reset();
desktop_controller_.reset(); desktop_controller_.reset();
...@@ -302,6 +300,9 @@ void ShellBrowserMainParts::PostMainMessageLoopRun() { ...@@ -302,6 +300,9 @@ void ShellBrowserMainParts::PostMainMessageLoopRun() {
} }
void ShellBrowserMainParts::PostDestroyThreads() { void ShellBrowserMainParts::PostDestroyThreads() {
extensions_browser_client_.reset();
ExtensionsBrowserClient::Set(nullptr);
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
network_controller_.reset(); network_controller_.reset();
chromeos::NetworkHandler::Shutdown(); chromeos::NetworkHandler::Shutdown();
......
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