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

Unified Diff: extensions/common/value_builder.cc

Issue 2037703004: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //extensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: extensions/common/value_builder.cc
diff --git a/extensions/common/value_builder.cc b/extensions/common/value_builder.cc
index 449fee9da3bddbd6c1fe5adcd26c4fe2117a72fd..2cb33237c1758d3b5b0ff591ef343f123ee6f24f 100644
--- a/extensions/common/value_builder.cc
+++ b/extensions/common/value_builder.cc
@@ -72,22 +72,22 @@ ListBuilder::ListBuilder(const base::ListValue& init) : list_(init.DeepCopy()) {
ListBuilder::~ListBuilder() {}
ListBuilder& ListBuilder::Append(int in_value) {
- list_->Append(new base::FundamentalValue(in_value));
+ list_->AppendInteger(in_value);
return *this;
}
ListBuilder& ListBuilder::Append(double in_value) {
- list_->Append(new base::FundamentalValue(in_value));
+ list_->AppendDouble(in_value);
return *this;
}
ListBuilder& ListBuilder::Append(const std::string& in_value) {
- list_->Append(new base::StringValue(in_value));
+ list_->AppendString(in_value);
return *this;
}
ListBuilder& ListBuilder::Append(const base::string16& in_value) {
- list_->Append(new base::StringValue(in_value));
+ list_->AppendString(in_value);
return *this;
}
@@ -97,7 +97,7 @@ ListBuilder& ListBuilder::Append(std::unique_ptr<base::Value> in_value) {
}
ListBuilder& ListBuilder::AppendBoolean(bool in_value) {
- list_->Append(new base::FundamentalValue(in_value));
+ list_->AppendBoolean(in_value);
return *this;
}
« no previous file with comments | « extensions/common/permissions/api_permission_set_unittest.cc ('k') | extensions/renderer/dom_activity_logger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698