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

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

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: revise test 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.cc
diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc
index 4be9e65c0b818e337a0e47c10f5d6318ea2b5abb..51675433d943aa43af63bd471bb10a48490e391e 100644
--- a/components/content_settings/core/browser/host_content_settings_map.cc
+++ b/components/content_settings/core/browser/host_content_settings_map.cc
@@ -135,11 +135,7 @@ content_settings::PatternPair GetPatternsFromScopingType(
content_settings::PatternPair patterns;
switch (scoping_type) {
- case WebsiteSettingsInfo::TOP_LEVEL_DOMAIN_ONLY_SCOPE:
- case WebsiteSettingsInfo::REQUESTING_DOMAIN_ONLY_SCOPE:
- patterns.first = ContentSettingsPattern::FromURL(primary_url);
- patterns.second = ContentSettingsPattern::Wildcard();
- break;
+ case WebsiteSettingsInfo::TOP_LEVEL_ORIGIN_ONLY_SCOPE:
case WebsiteSettingsInfo::REQUESTING_ORIGIN_ONLY_SCOPE:
patterns.first = ContentSettingsPattern::FromURLNoWildcard(primary_url);
patterns.second = ContentSettingsPattern::Wildcard();
@@ -164,7 +160,8 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs,
used_from_thread_id_(base::PlatformThread::CurrentId()),
#endif
prefs_(prefs),
- is_off_the_record_(is_incognito_profile || is_guest_profile) {
+ is_off_the_record_(is_incognito_profile || is_guest_profile),
+ weak_ptr_factory_(this) {
DCHECK(!(is_incognito_profile && is_guest_profile));
content_settings::PolicyProvider* policy_provider =
@@ -189,7 +186,7 @@ HostContentSettingsMap::HostContentSettingsMap(PrefService* prefs,
content_settings_providers_[DEFAULT_PROVIDER] = default_provider;
MigrateKeygenSettings();
-
+ MigrateDomainScopedSettings(false);
RecordNumberOfExceptions();
}
@@ -600,6 +597,10 @@ void HostContentSettingsMap::MigrateDomainScopedSettings(bool after_sync) {
}
}
+base::WeakPtr<HostContentSettingsMap> HostContentSettingsMap::GetWeakPtr() {
+ return weak_ptr_factory_.GetWeakPtr();
+}
+
void HostContentSettingsMap::RecordNumberOfExceptions() {
for (const content_settings::WebsiteSettingsInfo* info :
*content_settings::WebsiteSettingsRegistry::GetInstance()) {

Powered by Google App Engine
This is Rietveld 408576698