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

Unified Diff: content/browser/gpu/gpu_internals_ui.cc

Issue 2285933003: Remove more usage of the base::ListValue::Append(Value*) overload. (Closed)
Patch Set: rebase Created 4 years, 4 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: content/browser/gpu/gpu_internals_ui.cc
diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc
index 1d0da63b7b8477d97c4964755b94ef787dea9481..23aed354f8d19bb7a764e7c83eeea000b10c9cf6 100644
--- a/content/browser/gpu/gpu_internals_ui.cc
+++ b/content/browser/gpu/gpu_internals_ui.cc
@@ -68,17 +68,19 @@ WebUIDataSource* CreateGpuHTMLSource() {
return source;
}
-base::DictionaryValue* NewDescriptionValuePair(const std::string& desc,
+std::unique_ptr<base::DictionaryValue> NewDescriptionValuePair(
+ const std::string& desc,
const std::string& value) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("description", desc);
dict->SetString("value", value);
return dict;
}
-base::DictionaryValue* NewDescriptionValuePair(const std::string& desc,
+std::unique_ptr<base::DictionaryValue> NewDescriptionValuePair(
+ const std::string& desc,
base::Value* value) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("description", desc);
dict->Set("value", value);
return dict;
@@ -429,8 +431,7 @@ void GpuMessageHandler::OnCallAsync(const base::ListValue* args) {
ok = args->Get(i, &arg);
DCHECK(ok);
- base::Value* argCopy = arg->DeepCopy();
- submessageArgs->Append(argCopy);
+ submessageArgs->Append(arg->CreateDeepCopy());
}
// call the submessage handler

Powered by Google App Engine
This is Rietveld 408576698