| Index: components/content_settings/core/browser/content_settings_pref.cc
|
| diff --git a/components/content_settings/core/browser/content_settings_pref.cc b/components/content_settings/core/browser/content_settings_pref.cc
|
| index 762cb621b62ad15d29f070b292d28bc9c4200644..61451522c52ab7be542512b2933e17dd12443b7e 100644
|
| --- a/components/content_settings/core/browser/content_settings_pref.cc
|
| +++ b/components/content_settings/core/browser/content_settings_pref.cc
|
| @@ -143,27 +143,32 @@ bool ContentSettingsPref::SetWebsiteSetting(
|
| return true;
|
| }
|
|
|
| -void ContentSettingsPref::ClearAllContentSettingsRules() {
|
| +void ContentSettingsPref::ClearPref() {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| DCHECK(prefs_);
|
|
|
| - OriginIdentifierValueMap* map_to_modify = &incognito_value_map_;
|
| - if (!is_incognito_)
|
| - map_to_modify = &value_map_;
|
| -
|
| {
|
| base::AutoLock auto_lock(lock_);
|
| - map_to_modify->clear();
|
| + value_map_.clear();
|
| }
|
|
|
| - if (!is_incognito_) {
|
| - // Clear the preference.
|
| - {
|
| - base::AutoReset<bool> auto_reset(&updating_preferences_, true);
|
| - DictionaryPrefUpdate update(prefs_, pref_name_);
|
| - base::DictionaryValue* pattern_pairs_settings = update.Get();
|
| - pattern_pairs_settings->Clear();
|
| - }
|
| + {
|
| + base::AutoReset<bool> auto_reset(&updating_preferences_, true);
|
| + DictionaryPrefUpdate update(prefs_, pref_name_);
|
| + base::DictionaryValue* pattern_pairs_settings = update.Get();
|
| + pattern_pairs_settings->Clear();
|
| + }
|
| +}
|
| +
|
| +void ContentSettingsPref::ClearAllContentSettingsRules() {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| + DCHECK(prefs_);
|
| +
|
| + if (is_incognito_) {
|
| + base::AutoLock auto_lock(lock_);
|
| + incognito_value_map_.clear();
|
| + } else {
|
| + ClearPref();
|
| }
|
|
|
| notify_callback_.Run(ContentSettingsPattern(),
|
|
|