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

Unified Diff: chrome/browser/password_manager/password_store_factory.cc

Issue 1072413003: Add foundation for trimming the AffiliationDatabase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keep noncontroversial parts. Created 5 years, 7 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: chrome/browser/password_manager/password_store_factory.cc
diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc
index 8e6408167eaeec1c4e810fb005223ec6c1acfcfe..13d0e74db4f6cda402aa6ea290e72352f36ce3f5 100644
--- a/chrome/browser/password_manager/password_store_factory.cc
+++ b/chrome/browser/password_manager/password_store_factory.cc
@@ -193,6 +193,21 @@ void PasswordStoreFactory::OnPasswordsSyncedStatePotentiallyChanged(
}
}
+// static
+void PasswordStoreFactory::TrimOrDeleteAffiliationCache(Profile* profile) {
+ scoped_refptr<PasswordStore> password_store =
+ GetForProfile(profile, ServiceAccessType::EXPLICIT_ACCESS);
+ if (password_store && password_store->HasAffiliatedMatchHelper()) {
+ password_store->TrimAffiliationCache();
+ } else {
+ scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner(
+ content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::DB));
+ password_manager::AffiliationService::DeleteCache(
+ GetAffiliationDatabasePath(profile), db_thread_runner.get());
+ }
+}
+
PasswordStoreFactory::PasswordStoreFactory()
: BrowserContextKeyedServiceFactory(
"PasswordStore",

Powered by Google App Engine
This is Rietveld 408576698