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

Unified Diff: components/sync_preferences/pref_model_associator_unittest.cc

Issue 2884933002: Remove raw base::DictionaryValue::SetWithoutPathExpansion (Closed)
Patch Set: Include Created 3 years, 7 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/sync_preferences/pref_model_associator_unittest.cc
diff --git a/components/sync_preferences/pref_model_associator_unittest.cc b/components/sync_preferences/pref_model_associator_unittest.cc
index d9c4f17d4e689903417da9e6a5da18bc33c461ea..25da5672dd235ce883e6ba9480f3f7bfb350610f 100644
--- a/components/sync_preferences/pref_model_associator_unittest.cc
+++ b/components/sync_preferences/pref_model_associator_unittest.cc
@@ -65,15 +65,13 @@ class AbstractPreferenceMergeTest : public testing::Test {
void SetContentPattern(base::DictionaryValue* patterns_dict,
const std::string& expression,
int setting) {
- base::DictionaryValue* expression_dict;
- bool found = patterns_dict->GetDictionaryWithoutPathExpansion(
- expression, &expression_dict);
- if (!found) {
- expression_dict = new base::DictionaryValue;
- patterns_dict->SetWithoutPathExpansion(expression, expression_dict);
+ base::DictionaryValue* expression_dict = nullptr;
+ if (!patterns_dict->GetDictionaryWithoutPathExpansion(expression,
+ &expression_dict)) {
+ expression_dict = patterns_dict->SetDictionaryWithoutPathExpansion(
+ expression, base::MakeUnique<base::DictionaryValue>());
}
- expression_dict->SetWithoutPathExpansion("setting",
- new base::Value(setting));
+ expression_dict->SetIntegerWithoutPathExpansion("setting", setting);
}
void SetPrefToEmpty(const std::string& pref_name) {
« no previous file with comments | « components/sync_preferences/pref_model_associator.cc ('k') | components/url_matcher/url_matcher_factory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698