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

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: use string 'preference' Created 4 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: 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 927305765c5d708efa37b1f53d6afcfbffb2260c..7a75222a41f073a10c60b6e62f2b4280e7fc4cc1 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,17 @@ class HostContentSettingsMap : public content_settings::Observer,
ContentSettingsType content_type,
content_settings::ProviderInterface* provider) const;
+ // Migrate old settings for ContentSettingsTypes which only use a primary
+ // pattern. Settings which only used a primary pattern were inconsistent in
+ // what they did with the secondary pattern. Some stored a
+ // ContentSettingsPattern::Wildcard() whereas others stored the same pattern
+ // twice. This function migrates all such settings to use
+ // ContentSettingsPattern::Wildcard(). This allows us to make the scoping code
+ // consistent across different settings.
+ // TODO(lshang): Remove this when clients have migrated (~M53). 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