Index: content/browser/browser_context.cc |
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc |
index b7a99d57813eadc0f76a539635140e6ba15cb509..75921b8485b9fec7fd3e33b2060aa9ca07a83b21 100644 |
--- a/content/browser/browser_context.cc |
+++ b/content/browser/browser_context.cc |
@@ -20,6 +20,7 @@ |
#include "base/threading/thread_task_runner_handle.h" |
#include "build/build_config.h" |
#include "content/browser/blob_storage/chrome_blob_storage_context.h" |
+#include "content/browser/browsing_data/browsing_data_remover_impl.h" |
#include "content/browser/download/download_manager_impl.h" |
#include "content/browser/indexed_db/indexed_db_context_impl.h" |
#include "content/browser/loader/resource_dispatcher_host_impl.h" |
@@ -71,6 +72,7 @@ class ServiceUserIdHolder : public base::SupportsUserData::Data { |
}; |
// Key names on BrowserContext. |
+const char kBrowsingDataRemoverKey[] = "browsing-data-remover"; |
const char kDownloadManagerKeyName[] = "download_manager"; |
const char kMojoWasInitialized[] = "mojo-was-initialized"; |
const char kServiceManagerConnection[] = "service-manager-connection"; |
@@ -226,6 +228,22 @@ storage::ExternalMountPoints* BrowserContext::GetMountPoints( |
#endif |
} |
+// static |
+content::BrowsingDataRemover* content::BrowserContext::GetBrowsingDataRemover( |
+ BrowserContext* context) { |
+ DCHECK_CURRENTLY_ON(BrowserThread::UI); |
+ |
+ if (!context->GetUserData(kBrowsingDataRemoverKey)) { |
+ std::unique_ptr<BrowsingDataRemoverImpl> remover = |
+ base::MakeUnique<BrowsingDataRemoverImpl>(context); |
+ remover->SetEmbedderDelegate(context->GetBrowsingDataRemoverDelegate()); |
+ context->SetUserData(kBrowsingDataRemoverKey, remover.release()); |
+ } |
+ |
+ return static_cast<BrowsingDataRemoverImpl*>( |
+ context->GetUserData(kBrowsingDataRemoverKey)); |
+} |
+ |
StoragePartition* BrowserContext::GetStoragePartition( |
BrowserContext* browser_context, |
SiteInstance* site_instance) { |
@@ -524,4 +542,8 @@ void BrowserContext::ShutdownStoragePartitions() { |
RemoveUserData(kStoragePartitionMapKeyName); |
} |
+BrowsingDataRemoverDelegate* BrowserContext::GetBrowsingDataRemoverDelegate() { |
+ return nullptr; |
+} |
+ |
} // namespace content |