summaryrefslogtreecommitdiff
path: root/chromium/components/content_settings/core/browser/host_content_settings_map.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/content_settings/core/browser/host_content_settings_map.h')
-rw-r--r--chromium/components/content_settings/core/browser/host_content_settings_map.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/chromium/components/content_settings/core/browser/host_content_settings_map.h b/chromium/components/content_settings/core/browser/host_content_settings_map.h
index 2a958d33b87..29af9c7c669 100644
--- a/chromium/components/content_settings/core/browser/host_content_settings_map.h
+++ b/chromium/components/content_settings/core/browser/host_content_settings_map.h
@@ -210,6 +210,14 @@ class HostContentSettingsMap : public content_settings::Observer,
// This should only be called on the UI thread.
void ClearSettingsForOneType(ContentSettingsType content_type);
+ // If |pattern_predicate| is null, this method is equivalent to the above.
+ // Otherwise, it only deletes exceptions matched by |pattern_predicate|.
+ void ClearSettingsForOneTypeWithPredicate(
+ ContentSettingsType content_type,
+ const base::Callback<bool(
+ const ContentSettingsPattern& primary_pattern,
+ const ContentSettingsPattern& secondary_pattern)>& pattern_predicate);
+
static bool IsDefaultSettingAllowedForType(ContentSetting setting,
ContentSettingsType content_type);
@@ -278,9 +286,27 @@ class HostContentSettingsMap : public content_settings::Observer,
// Passes ownership of |clock|.
void SetPrefClockForTesting(std::unique_ptr<base::Clock> clock);
+ // Migrate old domain scoped ALLOW settings to be origin scoped for
+ // ContentSettingsTypes which are domain scoped. Only narrow down ALLOW
+ // domain settings to origins so that this will not cause privacy/security
+ // issues.
+ //
+ // |after_sync| will be false when called upon construction of this object and
+ // true when called by the sync layer after sync is completed.
+ // TODO(lshang): https://crbug.com/621398 Remove this when clients have
+ // migrated (~M56).
+ void MigrateDomainScopedSettings(bool after_sync);
+
+ base::WeakPtr<HostContentSettingsMap> GetWeakPtr();
+
private:
friend class base::RefCountedThreadSafe<HostContentSettingsMap>;
- friend class HostContentSettingsMapTest_MigrateKeygenSettings_Test;
+
+ FRIEND_TEST_ALL_PREFIXES(HostContentSettingsMapTest,
+ DomainToOriginMigrationStatus);
+ FRIEND_TEST_ALL_PREFIXES(HostContentSettingsMapTest,
+ MigrateDomainScopedSettings);
+ FRIEND_TEST_ALL_PREFIXES(HostContentSettingsMapTest, MigrateKeygenSettings);
friend class content_settings::TestUtils;
@@ -387,6 +413,8 @@ class HostContentSettingsMap : public content_settings::Observer,
base::ObserverList<content_settings::Observer> observers_;
+ base::WeakPtrFactory<HostContentSettingsMap> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap);
};