Stop passing raw pointers to DictionaryValue::Set, part 1
base::Value API has alternatives with unique_ptr, and passing ownership with
raw pointers can hide bugs. Therefore, this CL migrates a portion of Chromium
code to use the unique_ptr-based API.
BUG=697817
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel
[email protected]
Review-Url: https://codereview.chromium.org/2773513002
Cr-Commit-Position: refs/heads/master@{#459164}
diff --git a/components/prefs/pref_service_unittest.cc b/components/prefs/pref_service_unittest.cc
index 55d3ccc..35033153 100644
--- a/components/prefs/pref_service_unittest.cc
+++ b/components/prefs/pref_service_unittest.cc
@@ -330,7 +330,8 @@
EXPECT_TRUE(flag_checker->last_write_flags_set());
EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear());
- prefs->SetUserPrefValue(entry.pref_name, new base::DictionaryValue());
+ prefs->SetUserPrefValue(entry.pref_name,
+ base::MakeUnique<base::DictionaryValue>());
EXPECT_TRUE(flag_checker->last_write_flags_set());
EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear());
}