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

Unified Diff: components/content_settings/core/browser/host_content_settings_map.h

Issue 1754073002: Migrate old settings for ContentSettingTypes with wildcard as secondary_pattern (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scoping_set_content_setting
Patch Set: rebase Created 4 years, 10 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: components/content_settings/core/browser/host_content_settings_map.h
diff --git a/components/content_settings/core/browser/host_content_settings_map.h b/components/content_settings/core/browser/host_content_settings_map.h
index 2308855ba577df3201d2054365ee6bec9394aec2..947e075b358dfbfd4718d04ae1e630aa9568fdcd 100644
--- a/components/content_settings/core/browser/host_content_settings_map.h
+++ b/components/content_settings/core/browser/host_content_settings_map.h
@@ -279,7 +279,8 @@ class HostContentSettingsMap : public content_settings::Observer,
private:
friend class base::RefCountedThreadSafe<HostContentSettingsMap>;
- friend class HostContentSettingsMapTest_NonDefaultSettings_Test;
+ friend class HostContentSettingsMapTest_MigrateOldSettings_Test;
+
friend class content_settings::TestUtils;
typedef std::map<ProviderType, content_settings::ProviderInterface*>
@@ -293,6 +294,16 @@ class HostContentSettingsMap : public content_settings::Observer,
ContentSettingsType content_type,
content_settings::ProviderInterface* provider) const;
+ // Migrate old settings for those ContentSettingsType which previously
+ // would use the same pattern twice instead of using
+ // ContentSettingsPattern::Wildcard(). This has no impact on lookups using
+ // GetContentSetting (because Wildcard matches everything) but it has an
+ // impact when trying to change the existing content setting. We need to
+ // migrate the old-format keys.
raymes 2016/03/07 01:47:55 I think we can rephrase this a bit because my expl
lshang 2016/03/23 13:58:36 Done.
+ // TODO(lshang): Remove this when clients have migrated. We should leave in
+ // some code to remove old-format settings for a long time.
+ void MigrateOldSettings();
+
// Adds content settings for |content_type| and |resource_identifier|,
// provided by |provider|, into |settings|. If |incognito| is true, adds only
// the content settings which are applicable to the incognito mode and differ

Powered by Google App Engine
This is Rietveld 408576698