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

Unified Diff: tools/ipc_fuzzer/fuzzer/fuzzer.cc

Issue 2838893002: Remove base::ListValue::Set(size_t, base::Value*) (Closed)
Patch Set: Android, Fuzzer and JSON Test Fixes 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
« ipc/ipc_message_utils.cc ('K') | « ipc/ipc_message_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ipc_fuzzer/fuzzer/fuzzer.cc
diff --git a/tools/ipc_fuzzer/fuzzer/fuzzer.cc b/tools/ipc_fuzzer/fuzzer/fuzzer.cc
index a913dc23eb78bd86a18506e2345ed007ad8e2310..2474860fd67d9549185612c1625eda734cceaa44 100644
--- a/tools/ipc_fuzzer/fuzzer/fuzzer.cc
+++ b/tools/ipc_fuzzer/fuzzer/fuzzer.cc
@@ -10,6 +10,7 @@
#include <vector>
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/shared_memory_handle.h"
#include "base/strings/string_util.h"
#include "base/values.h"
@@ -510,28 +511,28 @@ struct FuzzTraits<base::ListValue> {
bool tmp;
p->GetBoolean(index, &tmp);
fuzzer->FuzzBool(&tmp);
- p->Set(index, new base::Value(tmp));
+ p->Set(index, base::MakeUnique<base::Value>(tmp));
break;
}
case base::Value::Type::INTEGER: {
int tmp;
p->GetInteger(index, &tmp);
fuzzer->FuzzInt(&tmp);
- p->Set(index, new base::Value(tmp));
+ p->Set(index, base::MakeUnique<base::Value>(tmp));
break;
}
case base::Value::Type::DOUBLE: {
double tmp;
p->GetDouble(index, &tmp);
fuzzer->FuzzDouble(&tmp);
- p->Set(index, new base::Value(tmp));
+ p->Set(index, base::MakeUnique<base::Value>(tmp));
break;
}
case base::Value::Type::STRING: {
std::string tmp;
p->GetString(index, &tmp);
fuzzer->FuzzString(&tmp);
- p->Set(index, new base::Value(tmp));
+ p->Set(index, base::MakeUnique<base::Value>(tmp));
break;
}
case base::Value::Type::BINARY: {
@@ -545,14 +546,14 @@ struct FuzzTraits<base::ListValue> {
base::DictionaryValue* tmp = new base::DictionaryValue();
p->GetDictionary(index, &tmp);
vabr (Chromium) 2017/04/25 17:13:15 This seems wrong: GetDictionary fills |tmp| with a
brettw 2017/04/25 19:55:45 This looks wrong to me too.
jdoerrie 2017/04/26 11:34:37 I agree, looking at this more closely this seems w
FuzzParam(tmp, fuzzer);
- p->Set(index, tmp);
+ p->Set(index, base::WrapUnique(tmp));
break;
}
case base::Value::Type::LIST: {
base::ListValue* tmp = new base::ListValue();
p->GetList(index, &tmp);
FuzzParam(tmp, fuzzer);
- p->Set(index, tmp);
+ p->Set(index, base::WrapUnique(tmp));
break;
}
case base::Value::Type::NONE:
« ipc/ipc_message_utils.cc ('K') | « ipc/ipc_message_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698