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

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

Issue 1257093002: Remove the migration code from content_settings::PrefProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Lock testing function. Created 5 years, 4 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/content_settings_pref.h
diff --git a/components/content_settings/core/browser/content_settings_pref.h b/components/content_settings/core/browser/content_settings_pref.h
index 1314e163c889f65bf7ff275af9fb7d07b26807a3..2dd554b3f3f6aece45aab764c490ae47df6f7a30 100644
--- a/components/content_settings/core/browser/content_settings_pref.h
+++ b/components/content_settings/core/browser/content_settings_pref.h
@@ -45,7 +45,6 @@ class ContentSettingsPref {
PrefChangeRegistrar* registrar,
const char* pref_name,
bool incognito,
- bool* updating_old_preferences_flag,
NotifyObserversCallback notify_callback);
~ContentSettingsPref();
@@ -68,15 +67,17 @@ class ContentSettingsPref {
size_t GetNumExceptions();
+ // Tries to lock |lock_|. If successful, returns true and releases the lock.
+ bool TryLockForTesting() const;
+
private:
- // Only to access static method CanonicalizeContentSettingsExceptions,
- // so that we reduce duplicity between the two.
- // TODO(msramek): Remove this after the migration is over.
- friend class PrefProvider;
+ // TODO(msramek): Currently only needed in the unittest to get the
+ // corresponding pref name. Remove once pref names are in WebsiteSettingsInfo.
+ friend class DeadlockCheckerObserver;
- // Reads all content settings exceptions from the preference and load them
+ // Reads all content settings exceptions from the preference and loads them
// into the |value_map_|. The |value_map_| is cleared first.
- void ReadContentSettingsFromPrefAndWriteToOldPref();
+ void ReadContentSettingsFromPref();
// Callback for changes in the pref with the same name.
void OnPrefChanged();
@@ -99,20 +100,6 @@ class ContentSettingsPref {
// release it.
void AssertLockNotHeld() const;
- // Update the old aggregate preference, so that the settings can be synced
- // to old versions of Chrome.
- // TODO(msramek): Remove after the migration is over.
- void UpdateOldPref(
- const ContentSettingsPattern& primary_pattern,
- const ContentSettingsPattern& secondary_pattern,
- const ResourceIdentifier& resource_identifier,
- const base::Value* value);
-
- // Remove all exceptions of |content_type_| from the old aggregate dictionary
- // preference.
- // TODO(msramek): Remove after the migration is over.
- void ClearOldPreference();
-
// The type of content settings stored in this pref.
ContentSettingsType content_type_;
@@ -131,11 +118,6 @@ class ContentSettingsPref {
// notifications from the preferences service that we triggered ourself.
bool updating_preferences_;
- // Whether we are currently updating the old aggregate dictionary preference.
- // Owned by the parent |PrefProvider| and shared by all its children
- // |ContentSettingsPref|s.
- bool* updating_old_preferences_;
-
OriginIdentifierValueMap value_map_;
OriginIdentifierValueMap incognito_value_map_;

Powered by Google App Engine
This is Rietveld 408576698