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

Unified Diff: content/browser/browser_context.cc

Issue 9466031: Fix race condition where the items on ResourceContext's UserData map were rewritten to the same val… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 | « no previous file | content/browser/resource_context_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_context.cc
===================================================================
--- content/browser/browser_context.cc (revision 123588)
+++ content/browser/browser_context.cc (working copy)
@@ -92,7 +92,7 @@
kAppCacheServicKeyName,
new UserDataAdapter<ChromeAppCacheService>(appcache_service));
- EnsureResourceContextInitialized(context);
+ InitializeResourceContext(context);
// Check first to avoid memory leak in unittests.
if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) {
@@ -169,7 +169,13 @@
}
void BrowserContext::EnsureResourceContextInitialized(BrowserContext* context) {
- content::EnsureResourceContextInitialized(context);
+ // This will be enough to tickle initialization of BrowserContext if
+ // necessary, which initializes ResourceContext. The reason we don't call
+ // ResourceContext::InitializeResourceContext directly here is that if
+ // ResourceContext ends up initializing it will call back into BrowserContext
+ // and when that call return it'll end rewriting its UserData map (with the
+ // same value) but this causes a race condition. See http://crbug.com/115678.
+ CreateQuotaManagerAndClients(context);
}
void BrowserContext::SaveSessionState(BrowserContext* browser_context) {
« no previous file with comments | « no previous file | content/browser/resource_context_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698