Chromium Code Reviews| 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..3513496e580960633f5f532fc269976237b63507 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. We should leave in |
| + // some code to remove old-format settings for a long time. |
|
raymes
2016/03/29 04:43:46
nit: Remove this when clients have migrated (~M53)
lshang
2016/03/29 05:02:30
Done.
|
| + 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 |