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

Side by Side Diff: cc/layers/ui_resource_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 unified diff | Download patch
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/quads/nine_patch_generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/ui_resource_layer_impl.h" 5 #include "cc/layers/ui_resource_layer_impl.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/quads/texture_draw_quad.h" 10 #include "cc/quads/texture_draw_quad.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 ValidateQuadResources(quad); 136 ValidateQuadResources(quad);
137 } 137 }
138 138
139 const char* UIResourceLayerImpl::LayerTypeAsString() const { 139 const char* UIResourceLayerImpl::LayerTypeAsString() const {
140 return "cc::UIResourceLayerImpl"; 140 return "cc::UIResourceLayerImpl";
141 } 141 }
142 142
143 std::unique_ptr<base::DictionaryValue> UIResourceLayerImpl::LayerTreeAsJson() { 143 std::unique_ptr<base::DictionaryValue> UIResourceLayerImpl::LayerTreeAsJson() {
144 std::unique_ptr<base::DictionaryValue> result = LayerImpl::LayerTreeAsJson(); 144 std::unique_ptr<base::DictionaryValue> result = LayerImpl::LayerTreeAsJson();
145 145
146 result->Set("ImageBounds", MathUtil::AsValue(image_bounds_).release()); 146 result->Set("ImageBounds", MathUtil::AsValue(image_bounds_));
147 147
148 base::ListValue* list = new base::ListValue; 148 auto list = base::MakeUnique<base::ListValue>();
149 list->AppendDouble(vertex_opacity_[0]); 149 list->AppendDouble(vertex_opacity_[0]);
150 list->AppendDouble(vertex_opacity_[1]); 150 list->AppendDouble(vertex_opacity_[1]);
151 list->AppendDouble(vertex_opacity_[2]); 151 list->AppendDouble(vertex_opacity_[2]);
152 list->AppendDouble(vertex_opacity_[3]); 152 list->AppendDouble(vertex_opacity_[3]);
153 result->Set("VertexOpacity", list); 153 result->Set("VertexOpacity", std::move(list));
154 154
155 result->Set("UVTopLeft", MathUtil::AsValue(uv_top_left_).release()); 155 result->Set("UVTopLeft", MathUtil::AsValue(uv_top_left_));
156 result->Set("UVBottomRight", MathUtil::AsValue(uv_bottom_right_).release()); 156 result->Set("UVBottomRight", MathUtil::AsValue(uv_bottom_right_));
157 157
158 return result; 158 return result;
159 } 159 }
160 160
161 } // namespace cc 161 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/quads/nine_patch_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698