Chromium Code Reviews| Index: content/browser/browser_context.cc |
| diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc |
| index b7a99d57813eadc0f76a539635140e6ba15cb509..3058e18c763714cd4ccd0cafdef1315497d6fb86 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,21 @@ storage::ExternalMountPoints* BrowserContext::GetMountPoints( |
| #endif |
| } |
| +// static |
| +content::BrowsingDataRemover* content::BrowserContext::GetBrowsingDataRemover( |
| + BrowserContext* context) { |
| + DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| + |
| + if (!context->GetUserData(kBrowsingDataRemoverKey)) { |
| + BrowsingDataRemoverImpl* remover = new BrowsingDataRemoverImpl(context); |
|
Bernhard Bauer
2017/04/19 12:39:38
Nit: put this into a std::unique_ptr<> and use bas
msramek
2017/04/19 13:39:18
Done.
A small downside is that we can no longer u
|
| + remover->SetEmbedderDelegate(context->GetBrowsingDataRemoverDelegate()); |
| + context->SetUserData(kBrowsingDataRemoverKey, remover); |
| + } |
| + |
| + return static_cast<BrowsingDataRemoverImpl*>( |
| + context->GetUserData(kBrowsingDataRemoverKey)); |
| +} |
| + |
| StoragePartition* BrowserContext::GetStoragePartition( |
| BrowserContext* browser_context, |
| SiteInstance* site_instance) { |
| @@ -524,4 +541,8 @@ void BrowserContext::ShutdownStoragePartitions() { |
| RemoveUserData(kStoragePartitionMapKeyName); |
| } |
| +BrowsingDataRemoverDelegate* BrowserContext::GetBrowsingDataRemoverDelegate() { |
| + return nullptr; |
| +} |
| + |
| } // namespace content |