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

Unified Diff: content/browser/browser_context.cc

Issue 11362268: Implement the ability to obliterate a storage partition from disk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: source control is hard, let's go shopping! Created 8 years, 1 month 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 | « chrome/browser/extensions/data_deleter.cc ('k') | content/browser/storage_partition_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
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index d8bc87e317698c9ec9f9b898e224bff9ccafc207..79355bc3089bde7dda9c7c2caf68d33980c302ff 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -37,11 +37,8 @@ namespace {
const char* kDownloadManagerKeyName = "download_manager";
const char* kStorageParitionMapKeyName = "content_storage_partition_map";
-StoragePartition* GetStoragePartitionFromConfig(
- BrowserContext* browser_context,
- const std::string& partition_domain,
- const std::string& partition_name,
- bool in_memory) {
+StoragePartitionImplMap* GetStoragePartitionMap(
+ BrowserContext* browser_context) {
StoragePartitionImplMap* partition_map =
static_cast<StoragePartitionImplMap*>(
browser_context->GetUserData(kStorageParitionMapKeyName));
@@ -49,6 +46,16 @@ StoragePartition* GetStoragePartitionFromConfig(
partition_map = new StoragePartitionImplMap(browser_context);
browser_context->SetUserData(kStorageParitionMapKeyName, partition_map);
}
+ return partition_map;
+}
+
+StoragePartition* GetStoragePartitionFromConfig(
+ BrowserContext* browser_context,
+ const std::string& partition_domain,
+ const std::string& partition_name,
+ bool in_memory) {
+ StoragePartitionImplMap* partition_map =
+ GetStoragePartitionMap(browser_context);
if (browser_context->IsOffTheRecord())
in_memory = true;
@@ -84,6 +91,13 @@ void PurgeMemoryOnIOThread(appcache::AppCacheService* appcache_service) {
} // namespace
+// static
+void BrowserContext::AsyncObliterateStoragePartition(
+ BrowserContext* browser_context,
+ const GURL& site) {
+ GetStoragePartitionMap(browser_context)->AsyncObliterate(site);
+}
+
DownloadManager* BrowserContext::GetDownloadManager(
BrowserContext* context) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -116,7 +130,7 @@ StoragePartition* BrowserContext::GetStoragePartition(
// this conditional and require that |site_instance| is non-NULL.
if (site_instance) {
GetContentClient()->browser()->GetStoragePartitionConfigForSite(
- browser_context, site_instance->GetSiteURL(),
+ browser_context, site_instance->GetSiteURL(), true,
&partition_domain, &partition_name, &in_memory);
}
@@ -132,7 +146,8 @@ StoragePartition* BrowserContext::GetStoragePartitionForSite(
bool in_memory;
GetContentClient()->browser()->GetStoragePartitionConfigForSite(
- browser_context, site, &partition_domain, &partition_name, &in_memory);
+ browser_context, site, true, &partition_domain, &partition_name,
+ &in_memory);
return GetStoragePartitionFromConfig(
browser_context, partition_domain, partition_name, in_memory);
« no previous file with comments | « chrome/browser/extensions/data_deleter.cc ('k') | content/browser/storage_partition_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698