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

Unified Diff: cc/layers/layer_impl.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 | « base/value_conversions.cc ('k') | cc/layers/ui_resource_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 0b76c707c300350ea5cf56a1412fe38e4411144f..c423115cf5fd35004d8c9bb6c770f43962fcdbe7 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -386,23 +386,23 @@ std::unique_ptr<base::DictionaryValue> LayerImpl::LayerTreeAsJson() {
result->SetInteger("LayerId", id());
result->SetString("LayerType", LayerTypeAsString());
- base::ListValue* list = new base::ListValue;
+ auto list = base::MakeUnique<base::ListValue>();
list->AppendInteger(bounds().width());
list->AppendInteger(bounds().height());
- result->Set("Bounds", list);
+ result->Set("Bounds", std::move(list));
- list = new base::ListValue;
+ list = base::MakeUnique<base::ListValue>();
list->AppendDouble(position_.x());
list->AppendDouble(position_.y());
- result->Set("Position", list);
+ result->Set("Position", std::move(list));
const gfx::Transform& gfx_transform = test_properties()->transform;
double transform[16];
gfx_transform.matrix().asColMajord(transform);
- list = new base::ListValue;
+ list = base::MakeUnique<base::ListValue>();
for (int i = 0; i < 16; ++i)
list->AppendDouble(transform[i]);
- result->Set("Transform", list);
+ result->Set("Transform", std::move(list));
result->SetBoolean("DrawsContent", draws_content_);
result->SetBoolean("Is3dSorted", Is3dSorted());
@@ -414,13 +414,13 @@ std::unique_ptr<base::DictionaryValue> LayerImpl::LayerTreeAsJson() {
if (!touch_event_handler_region_.IsEmpty()) {
std::unique_ptr<base::Value> region = touch_event_handler_region_.AsValue();
- result->Set("TouchRegion", region.release());
+ result->Set("TouchRegion", std::move(region));
}
- list = new base::ListValue;
+ list = base::MakeUnique<base::ListValue>();
for (size_t i = 0; i < test_properties()->children.size(); ++i)
list->Append(test_properties()->children[i]->LayerTreeAsJson());
- result->Set("Children", list);
+ result->Set("Children", std::move(list));
return result;
}
« no previous file with comments | « base/value_conversions.cc ('k') | cc/layers/ui_resource_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698