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

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

Issue 2843813002: Remove SetWithoutPathExpansion (Closed)
Patch Set: Fix CrOS Error Created 3 years, 8 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
« no previous file with comments | « chromeos/network/policy_util.cc ('k') | components/policy/core/common/policy_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f32e3018b4cc0828d4b5b7efa7a596d5f022d82b..d69ca377baf183593456e5549016f9b1e492667d 100644
--- a/components/content_settings/core/browser/content_settings_pref.cc
+++ b/components/content_settings/core/browser/content_settings_pref.cc
@@ -5,11 +5,14 @@
#include "components/content_settings/core/browser/content_settings_pref.h"
#include <memory>
+#include <utility>
#include "base/auto_reset.h"
#include "base/bind.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_split.h"
+#include "base/values.h"
#include "components/content_settings/core/browser/content_settings_info.h"
#include "components/content_settings/core/browser/content_settings_registry.h"
#include "components/content_settings/core/browser/content_settings_rule.h"
@@ -339,9 +342,10 @@ void ContentSettingsPref::UpdatePref(
pattern_str, &settings_dictionary);
if (!found && value) {
- settings_dictionary = new base::DictionaryValue;
pattern_pairs_settings->SetWithoutPathExpansion(
- pattern_str, settings_dictionary);
+ pattern_str, base::MakeUnique<base::DictionaryValue>());
+ pattern_pairs_settings->GetDictionaryWithoutPathExpansion(
+ pattern_str, &settings_dictionary);
}
if (settings_dictionary) {
@@ -366,16 +370,16 @@ void ContentSettingsPref::UpdatePref(
kPerResourceIdentifierPrefName, NULL);
}
} else {
- resource_dictionary->SetWithoutPathExpansion(
- resource_identifier, value->DeepCopy());
+ resource_dictionary->SetWithoutPathExpansion(resource_identifier,
+ value->CreateDeepCopy());
}
} else {
// Update settings dictionary.
if (value == NULL) {
settings_dictionary->RemoveWithoutPathExpansion(kSettingPath, NULL);
} else {
- settings_dictionary->SetWithoutPathExpansion(
- kSettingPath, value->DeepCopy());
+ settings_dictionary->SetWithoutPathExpansion(kSettingPath,
+ value->CreateDeepCopy());
}
}
// Remove the settings dictionary if it is empty.
@@ -439,7 +443,7 @@ void ContentSettingsPref::CanonicalizeContentSettingsExceptions(
all_settings_dictionary->RemoveWithoutPathExpansion(
move_items[i].first, &pattern_settings_dictionary);
all_settings_dictionary->SetWithoutPathExpansion(
- move_items[i].second, pattern_settings_dictionary.release());
+ move_items[i].second, std::move(pattern_settings_dictionary));
}
}
« no previous file with comments | « chromeos/network/policy_util.cc ('k') | components/policy/core/common/policy_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698