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

Unified Diff: tools/ipc_fuzzer/fuzzer/fuzzer.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
Index: tools/ipc_fuzzer/fuzzer/fuzzer.cc
diff --git a/tools/ipc_fuzzer/fuzzer/fuzzer.cc b/tools/ipc_fuzzer/fuzzer/fuzzer.cc
index 159ee81f3d7e0f6e042614abc0ae20f552ecf1e0..cc2065d4c4b1f5e68500afceec469486c02ab678 100644
--- a/tools/ipc_fuzzer/fuzzer/fuzzer.cc
+++ b/tools/ipc_fuzzer/fuzzer/fuzzer.cc
@@ -590,25 +590,29 @@ struct FuzzTraits<base::DictionaryValue> {
case base::Value::Type::BOOLEAN: {
bool tmp;
fuzzer->FuzzBool(&tmp);
- p->SetWithoutPathExpansion(property, new base::Value(tmp));
+ p->SetWithoutPathExpansion(property,
+ base::MakeUnique<base::Value>(tmp));
break;
}
case base::Value::Type::INTEGER: {
int tmp;
fuzzer->FuzzInt(&tmp);
- p->SetWithoutPathExpansion(property, new base::Value(tmp));
+ p->SetWithoutPathExpansion(property,
+ base::MakeUnique<base::Value>(tmp));
break;
}
case base::Value::Type::DOUBLE: {
double tmp;
fuzzer->FuzzDouble(&tmp);
- p->SetWithoutPathExpansion(property, new base::Value(tmp));
+ p->SetWithoutPathExpansion(property,
+ base::MakeUnique<base::Value>(tmp));
break;
}
case base::Value::Type::STRING: {
std::string tmp;
fuzzer->FuzzString(&tmp);
- p->SetWithoutPathExpansion(property, new base::Value(tmp));
+ p->SetWithoutPathExpansion(
+ property, base::MakeUnique<base::Value>(std::move(tmp)));
break;
}
case base::Value::Type::BINARY: {
@@ -620,15 +624,15 @@ struct FuzzTraits<base::DictionaryValue> {
break;
}
case base::Value::Type::DICTIONARY: {
- base::DictionaryValue* tmp = new base::DictionaryValue();
- FuzzParam(tmp, fuzzer);
- p->SetWithoutPathExpansion(property, tmp);
+ auto tmp = base::MakeUnique<base::DictionaryValue>();
+ FuzzParam(tmp.get(), fuzzer);
+ p->SetWithoutPathExpansion(property, std::move(tmp));
break;
}
case base::Value::Type::LIST: {
- base::ListValue* tmp = new base::ListValue();
- FuzzParam(tmp, fuzzer);
- p->SetWithoutPathExpansion(property, tmp);
+ auto tmp = base::MakeUnique<base::ListValue>();
+ FuzzParam(tmp.get(), fuzzer);
+ p->SetWithoutPathExpansion(property, std::move(tmp));
break;
}
case base::Value::Type::NONE:
« no previous file with comments | « services/preferences/tracked/pref_hash_filter_unittest.cc ('k') | tools/json_schema_compiler/test/choices_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698