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: cc/quads/nine_patch_generator.cc

Issue 2773513002: Stop passing raw pointers to DictionaryValue::Set, part 1 (Closed)
Patch Set: Fix compilation Created 3 years, 9 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
« no previous file with comments | « cc/layers/ui_resource_layer_impl.cc ('k') | chrome/browser/download/download_target_determiner_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/quads/nine_patch_generator.cc
diff --git a/cc/quads/nine_patch_generator.cc b/cc/quads/nine_patch_generator.cc
index ea722ad47e281ddec4a0fe6a63195e938418fe0a..4edde067abd1cf6b365903ad53a3744e146f10d7 100644
--- a/cc/quads/nine_patch_generator.cc
+++ b/cc/quads/nine_patch_generator.cc
@@ -369,28 +369,28 @@ void NinePatchGenerator::AppendQuads(LayerImpl* layer_impl,
}
void NinePatchGenerator::AsJson(base::DictionaryValue* dictionary) const {
- base::ListValue* list = new base::ListValue;
+ auto list = base::MakeUnique<base::ListValue>();
list->AppendInteger(image_aperture_.origin().x());
list->AppendInteger(image_aperture_.origin().y());
list->AppendInteger(image_aperture_.size().width());
list->AppendInteger(image_aperture_.size().height());
- dictionary->Set("ImageAperture", list);
+ dictionary->Set("ImageAperture", std::move(list));
- list = new base::ListValue;
+ list = base::MakeUnique<base::ListValue>();
list->AppendInteger(image_bounds_.width());
list->AppendInteger(image_bounds_.height());
- dictionary->Set("ImageBounds", list);
+ dictionary->Set("ImageBounds", std::move(list));
- dictionary->Set("Border", MathUtil::AsValue(border_).release());
+ dictionary->Set("Border", MathUtil::AsValue(border_));
dictionary->SetBoolean("FillCenter", fill_center_);
- list = new base::ListValue;
+ list = base::MakeUnique<base::ListValue>();
list->AppendInteger(output_occlusion_.x());
list->AppendInteger(output_occlusion_.y());
list->AppendInteger(output_occlusion_.width());
list->AppendInteger(output_occlusion_.height());
- dictionary->Set("OutputOcclusion", list);
+ dictionary->Set("OutputOcclusion", std::move(list));
}
} // namespace cc
« no previous file with comments | « cc/layers/ui_resource_layer_impl.cc ('k') | chrome/browser/download/download_target_determiner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698