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

Unified Diff: skia/ext/benchmarking_canvas.cc

Issue 2051663003: base::ListValue::Append cleanup: pass unique_ptr instead of the released pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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: skia/ext/benchmarking_canvas.cc
diff --git a/skia/ext/benchmarking_canvas.cc b/skia/ext/benchmarking_canvas.cc
index cccedd0ce37237076a911193a282ce9433122c20..fb9845fe85e43fda827ebb1e26b0094c16128948 100644
--- a/skia/ext/benchmarking_canvas.cc
+++ b/skia/ext/benchmarking_canvas.cc
@@ -109,7 +109,7 @@ WARN_UNUSED_RESULT
std::unique_ptr<base::Value> AsValue(const SkMatrix& matrix) {
std::unique_ptr<base::ListValue> val(new base::ListValue());
for (int i = 0; i < 9; ++i)
- val->Append(AsValue(matrix[i]).release()); // no scoped_ptr-aware Append() variant
+ val->Append(AsValue(matrix[i])); // no scoped_ptr-aware Append() variant
return std::move(val);
}
@@ -170,7 +170,7 @@ std::unique_ptr<base::Value> AsValue(const SkColorFilter& filter) {
if (filter.asColorMatrix(color_matrix)) {
std::unique_ptr<base::ListValue> color_matrix_val(new base::ListValue());
for (unsigned i = 0; i < 20; ++i)
- color_matrix_val->Append(AsValue(color_matrix[i]).release());
+ color_matrix_val->Append(AsValue(color_matrix[i]));
val->Set("color_matrix", std::move(color_matrix_val));
}
@@ -380,14 +380,14 @@ std::unique_ptr<base::Value> AsValue(const SkPath& path) {
std::unique_ptr<base::ListValue> pts_val(new base::ListValue());
for (int i = 0; i < gPtsPerVerb[verb]; ++i)
- pts_val->Append(AsValue(points[i + gPtOffsetPerVerb[verb]]).release());
+ pts_val->Append(AsValue(points[i + gPtOffsetPerVerb[verb]]));
verb_val->Set(gVerbStrings[verb], std::move(pts_val));
if (SkPath::kConic_Verb == verb)
verb_val->Set("weight", AsValue(iter.conicWeight()));
- verbs_val->Append(verb_val.release());
+ verbs_val->Append(std::move(verb_val));
}
val->Set("verbs", std::move(verbs_val));
@@ -400,7 +400,7 @@ WARN_UNUSED_RESULT std::unique_ptr<base::Value> AsListValue(const T array[],
std::unique_ptr<base::ListValue> val(new base::ListValue());
for (size_t i = 0; i < count; ++i)
- val->Append(AsValue(array[i]).release());
+ val->Append(AsValue(array[i]));
return std::move(val);
}
@@ -492,7 +492,7 @@ public:
std::unique_ptr<base::DictionaryValue> param(new base::DictionaryValue());
param->Set(name, std::move(value));
- op_params_->Append(param.release());
+ op_params_->Append(std::move(param));
}
const SkPaint* paint() const { return &filtered_paint_; }

Powered by Google App Engine
This is Rietveld 408576698