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

Unified Diff: content/browser/storage_partition_impl.cc

Issue 11320018: Fixing guest processes to use the proper storage partition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing storage to be in-memory only. Created 8 years, 2 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
Index: content/browser/storage_partition_impl.cc
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc
index 7ba19db086d3e608d288eec93a9530ff70a6b603..1962acc8b18bb4a762304dc3ea20da8887593d8e 100644
--- a/content/browser/storage_partition_impl.cc
+++ b/content/browser/storage_partition_impl.cc
@@ -95,6 +95,11 @@ StoragePartitionImpl* StoragePartitionImpl::Create(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
!BrowserThread::IsMessageLoopValid(BrowserThread::UI));
+ // The storage partition should be only in memory for guest processes
+ // and OTR profiles.
+ bool in_memory = (partition_id.find("guest-") != std::string::npos) ||
Charlie Reis 2012/10/27 00:48:27 Albert noted this shouldn't use find.
+ context->IsOffTheRecord();
Charlie Reis 2012/10/27 00:48:27 nit: Wrong indent.
+
FilePath partition_path =
profile_path.Append(GetPartitionPath(partition_id));
@@ -104,7 +109,7 @@ StoragePartitionImpl* StoragePartitionImpl::Create(
// that utilizes the QuotaManager.
scoped_refptr<quota::QuotaManager> quota_manager =
new quota::QuotaManager(
- context->IsOffTheRecord(), partition_path,
+ in_memory, partition_path,
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::DB),
context->GetSpecialStoragePolicy());
@@ -112,17 +117,17 @@ StoragePartitionImpl* StoragePartitionImpl::Create(
// Each consumer is responsible for registering its QuotaClient during
// its construction.
scoped_refptr<fileapi::FileSystemContext> filesystem_context =
- CreateFileSystemContext(partition_path, context->IsOffTheRecord(),
+ CreateFileSystemContext(partition_path, in_memory,
context->GetSpecialStoragePolicy(),
quota_manager->proxy());
scoped_refptr<webkit_database::DatabaseTracker> database_tracker =
new webkit_database::DatabaseTracker(
- partition_path, context->IsOffTheRecord(),
+ partition_path, in_memory,
context->GetSpecialStoragePolicy(), quota_manager->proxy(),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE));
- FilePath path = context->IsOffTheRecord() ? FilePath() : partition_path;
+ FilePath path = in_memory ? FilePath() : partition_path;
scoped_refptr<DOMStorageContextImpl> dom_storage_context =
new DOMStorageContextImpl(path, context->GetSpecialStoragePolicy());

Powered by Google App Engine
This is Rietveld 408576698