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

Side by Side Diff: cc/test/layer_tree_json_parser.cc

Issue 2740143002: Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Rebase Created 3 years, 8 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 | « base/values_unittest.cc ('k') | chrome/browser/android/bookmarks/partner_bookmarks_shim.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/test/layer_tree_json_parser.h" 5 #include "cc/test/layer_tree_json_parser.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/test/values_test_util.h" 9 #include "base/test/values_test_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 double transform[16]; 145 double transform[16];
146 for (int i = 0; i < 16; ++i) 146 for (int i = 0; i < 16; ++i)
147 success &= list->GetDouble(i, &transform[i]); 147 success &= list->GetDouble(i, &transform[i]);
148 148
149 gfx::Transform layer_transform; 149 gfx::Transform layer_transform;
150 layer_transform.matrix().setColMajord(transform); 150 layer_transform.matrix().setColMajord(transform);
151 new_layer->SetTransform(layer_transform); 151 new_layer->SetTransform(layer_transform);
152 152
153 success &= dict->GetList("Children", &list); 153 success &= dict->GetList("Children", &list);
154 for (const auto& value : *list) { 154 for (const auto& value : *list) {
155 new_layer->AddChild(ParseTreeFromValue(*value, content_client)); 155 new_layer->AddChild(ParseTreeFromValue(value, content_client));
156 } 156 }
157 157
158 if (!success) 158 if (!success)
159 return NULL; 159 return NULL;
160 160
161 return new_layer; 161 return new_layer;
162 } 162 }
163 163
164 } // namespace 164 } // namespace
165 165
166 scoped_refptr<Layer> ParseTreeFromJson(std::string json, 166 scoped_refptr<Layer> ParseTreeFromJson(std::string json,
167 ContentLayerClient* content_client) { 167 ContentLayerClient* content_client) {
168 std::unique_ptr<base::Value> val = base::test::ParseJson(json); 168 std::unique_ptr<base::Value> val = base::test::ParseJson(json);
169 return ParseTreeFromValue(*val, content_client); 169 return ParseTreeFromValue(*val, content_client);
170 } 170 }
171 171
172 } // namespace cc 172 } // namespace cc
OLDNEW
« no previous file with comments | « base/values_unittest.cc ('k') | chrome/browser/android/bookmarks/partner_bookmarks_shim.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698