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

Unified Diff: content/browser/browser_context.cc

Issue 2827523003: Move BrowsingDataRemover to content/ (Closed)
Patch Set: Addressed some comments. Created 3 years, 8 months 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 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

Powered by Google App Engine
This is Rietveld 408576698