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

Unified Diff: content/browser/storage_partition_impl_map.cc

Issue 12047075: Fix race condition that occurs if ResourceContext::SetUserData is called on the IO thread before In… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/storage_partition_impl_map.cc
===================================================================
--- content/browser/storage_partition_impl_map.cc (revision 178360)
+++ content/browser/storage_partition_impl_map.cc (working copy)
@@ -454,15 +454,6 @@
const std::string& partition_domain,
const std::string& partition_name,
bool in_memory) {
- // TODO(ajwong): ResourceContexts no longer have any storage related state.
- // We should move this into a place where it is called once per
- // BrowserContext creation rather than piggybacking off the default context
- // creation.
- if (!resource_context_initialized_) {
- resource_context_initialized_ = true;
- InitializeResourceContext(browser_context_);
- }
-
// Find the previously created partition if it's available.
StoragePartitionConfig partition_config(
partition_domain, partition_name, in_memory);
@@ -580,6 +571,15 @@
void StoragePartitionImplMap::PostCreateInitialization(
StoragePartitionImpl* partition,
bool in_memory) {
+ // TODO(ajwong): ResourceContexts no longer have any storage related state.
+ // We should move this into a place where it is called once per
+ // BrowserContext creation rather than piggybacking off the default context
+ // creation.
+ if (!resource_context_initialized_) {
+ resource_context_initialized_ = true;
+ InitializeResourceContext(browser_context_);
+ }
+
// Check first to avoid memory leak in unittests.
if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) {
BrowserThread::PostTask(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698