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

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

Issue 2075103002: Change ContentSettingsType's scoping type and hookup migration code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@do_migration_after_sync
Patch Set: address comments Created 4 years, 5 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 a3200095a54d4f7565e1b83165182507dfeabb07..bd84dd575b559d048c5ec00b7ccc4b071cb954c3 100644
--- a/components/content_settings/core/browser/host_content_settings_map.h
+++ b/components/content_settings/core/browser/host_content_settings_map.h
@@ -278,6 +278,19 @@ 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| is false means the migration is done upon construction of the
+ // HostContentSettingsMap (before syncing any content settings), and is true
+ // means the migration is done after sync has finished.
+ // 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_DomainToOriginMigrationStatus_Test;
@@ -313,17 +326,6 @@ class HostContentSettingsMap : public content_settings::Observer,
// leave in some code to remove old-format settings for a long time.
void MigrateKeygenSettings();
- // 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| is false means the migration is done upon construction of the
- // HostContentSettingsMap (before syncing any content settings), and is true
- // means the migration is done after sync has finished.
- // TODO(lshang): https://crbug.com/621398 Remove this when clients have
- // migrated (~M56).
- void MigrateDomainScopedSettings(bool after_sync);
-
// Collect UMA data about the number of exceptions.
void RecordNumberOfExceptions();
@@ -400,6 +402,8 @@ class HostContentSettingsMap : public content_settings::Observer,
base::ObserverList<content_settings::Observer> observers_;
+ base::WeakPtrFactory<HostContentSettingsMap> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(HostContentSettingsMap);
};

Powered by Google App Engine
This is Rietveld 408576698