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

Unified Diff: chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc

Issue 2812113004: Write last_modified date to Content Settings in the PrefProvider (Closed)
Patch Set: fix 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: chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
index 0cf44b96ea2b9888c0925ba7443b340d75e71d27..2a68e5097dd50d2609e0c1dcbe3569760b13a552 100644
--- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
+++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc
@@ -150,12 +150,19 @@ base::Callback<void(T)> IgnoreArgument(const base::Closure& callback) {
bool WebsiteSettingsFilterAdapter(
const base::Callback<bool(const GURL&)> predicate,
+ base::Time begin_time,
const ContentSettingsPattern& primary_pattern,
- const ContentSettingsPattern& secondary_pattern) {
+ const ContentSettingsPattern& secondary_pattern,
+ base::Time last_modified) {
// Ignore the default setting.
if (primary_pattern == ContentSettingsPattern::Wildcard())
return false;
+ // Ignore entries that are too old.
+ if (last_modified < begin_time) {
+ return false;
+ }
+
// Website settings only use origin-scoped patterns. The only content setting
// currently supported by ChromeBrowsingDataRemoverDelegate is
// DURABLE_STORAGE, which also only uses origin-scoped patterns. Such patterns
@@ -705,8 +712,8 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
if (remove_mask & DATA_TYPE_DURABLE_PERMISSION) {
HostContentSettingsMapFactory::GetForProfile(profile_)
->ClearSettingsForOneTypeWithPredicate(
- CONTENT_SETTINGS_TYPE_DURABLE_STORAGE,
- base::Bind(&WebsiteSettingsFilterAdapter, filter));
+ CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, std::string(),
+ base::Bind(&WebsiteSettingsFilterAdapter, filter, base::Time()));
}
//////////////////////////////////////////////////////////////////////////////
@@ -714,16 +721,16 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData(
if (remove_mask & DATA_TYPE_SITE_USAGE_DATA) {
HostContentSettingsMapFactory::GetForProfile(profile_)
->ClearSettingsForOneTypeWithPredicate(
- CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT,
- base::Bind(&WebsiteSettingsFilterAdapter, filter));
+ CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, std::string(),
+ base::Bind(&WebsiteSettingsFilterAdapter, filter, base::Time()));
}
if ((remove_mask & DATA_TYPE_SITE_USAGE_DATA) ||
(remove_mask & DATA_TYPE_HISTORY)) {
HostContentSettingsMapFactory::GetForProfile(profile_)
->ClearSettingsForOneTypeWithPredicate(
- CONTENT_SETTINGS_TYPE_APP_BANNER,
- base::Bind(&WebsiteSettingsFilterAdapter, filter));
+ CONTENT_SETTINGS_TYPE_APP_BANNER, std::string(),
+ base::Bind(&WebsiteSettingsFilterAdapter, filter, base::Time()));
PermissionDecisionAutoBlocker::GetForProfile(profile_)->RemoveCountsByUrl(
filter);

Powered by Google App Engine
This is Rietveld 408576698