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

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: Work around race on extension uninstall 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
Index: content/browser/browser_context.cc
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index d8bc87e317698c9ec9f9b898e224bff9ccafc207..94cf92b4748ad0a736f4a56986fd79aeea24d2b4 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));

Powered by Google App Engine
This is Rietveld 408576698