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

Unified Diff: skia/ext/benchmarking_canvas.cc

Issue 2911033002: Remove raw base::DictionaryValue::Set (Closed)
Patch Set: Proper Windows Fix Created 3 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 da63a1a3376919c826b66b92ec82b67a81e1df86..1f46938173ff5fc5c5bde1c96c1e94f5195ceba3 100644
--- a/skia/ext/benchmarking_canvas.cc
+++ b/skia/ext/benchmarking_canvas.cc
@@ -379,24 +379,23 @@ class BenchmarkingCanvas::AutoOp {
public:
// AutoOp objects are always scoped within draw call frames,
// so the paint is guaranteed to be valid for their lifetime.
- AutoOp(BenchmarkingCanvas* canvas, const char op_name[],
- const SkPaint* paint = nullptr)
- : canvas_(canvas)
- , op_record_(new base::DictionaryValue())
- , op_params_(new base::ListValue()) {
-
- DCHECK(canvas);
- DCHECK(op_name);
-
- op_record_->SetString("cmd_string", op_name);
- op_record_->Set("info", op_params_);
-
- if (paint) {
- this->addParam("paint", AsValue(*paint));
- filtered_paint_ = *paint;
- }
-
- start_ticks_ = base::TimeTicks::Now();
+ AutoOp(BenchmarkingCanvas* canvas,
+ const char op_name[],
+ const SkPaint* paint = nullptr)
+ : canvas_(canvas), op_record_(new base::DictionaryValue()) {
+ DCHECK(canvas);
+ DCHECK(op_name);
+
+ op_record_->SetString("cmd_string", op_name);
+ op_params_ =
+ op_record_->SetList("info", base::MakeUnique<base::ListValue>());
+
+ if (paint) {
+ this->addParam("paint", AsValue(*paint));
+ filtered_paint_ = *paint;
+ }
+
+ start_ticks_ = base::TimeTicks::Now();
}
~AutoOp() {

Powered by Google App Engine
This is Rietveld 408576698