Index: content/browser/storage_partition_impl_map.cc |
diff --git a/content/browser/storage_partition_impl_map.cc b/content/browser/storage_partition_impl_map.cc |
index 77fb9239c9063bd32de0e793a5d87b9b5bf1c5aa..43aec42a60d18ec581ae4b58d7df331b463ca90a 100644 |
--- a/content/browser/storage_partition_impl_map.cc |
+++ b/content/browser/storage_partition_impl_map.cc |
@@ -204,10 +204,15 @@ StoragePartitionImpl* StoragePartitionImplMap::Get( |
if (it != partitions_.end()) |
return it->second; |
- // There was no previous partition, so let's make a new one. |
+ // There was no previous partition, so let's make a new one. The storage |
+ // partition should be in memory for guest processes and OTR profiles. |
+ bool in_memory = browser_context_->IsOffTheRecord() || |
+ StartsWithASCII(partition_id, "guest-", true); |
+ |
StoragePartitionImpl* partition = |
StoragePartitionImpl::Create(browser_context_, partition_id, |
- browser_context_->GetPath()); |
+ browser_context_->GetPath(), |
+ in_memory); |
partitions_[partition_id] = partition; |
// These calls must happen after StoragePartitionImpl::Create(). |