Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Unified Diff: content/shell/browser/shell_browser_context.cc

Issue 2764613002: Fix race condition in content_shell which could lead to an assert on shutdown with PlzNavigate. (Closed)
Patch Set: fix assert Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/browser/shell_browser_context.cc
diff --git a/content/shell/browser/shell_browser_context.cc b/content/shell/browser/shell_browser_context.cc
index c16359e93e3f7a8052d6f7d2c5316792dfdcee66..90f18e9ac8b96fc95361ad4275c992dc92bf5404 100644
--- a/content/shell/browser/shell_browser_context.cc
+++ b/content/shell/browser/shell_browser_context.cc
@@ -67,11 +67,15 @@ ShellBrowserContext::ShellBrowserContext(bool off_the_record,
ShellBrowserContext::~ShellBrowserContext() {
BrowserContextDependencyManager::GetInstance()->
DestroyBrowserContextServices(this);
- ShutdownStoragePartitions();
+ // Need to destruct the ResourceContext before posting tasks which may delete
+ // the URLRequestContext because ResourceContext's destructor will remove any
+ // outstanding request while URLRequestContext's destructor ensures that there
+ // are no more outstanding requests.
if (resource_context_) {
BrowserThread::DeleteSoon(
BrowserThread::IO, FROM_HERE, resource_context_.release());
}
+ ShutdownStoragePartitions();
}
void ShellBrowserContext::InitWhileIOAllowed() {
« no previous file with comments | « content/browser/loader/resource_dispatcher_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698