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

Side by Side Diff: chromeos/network/onc/onc_mapper.cc

Issue 2816513002: Revert of Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chromeos/network/onc/onc_mapper.h" 5 #include "chromeos/network/onc/onc_mapper.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 const OncValueSignature& array_signature, 113 const OncValueSignature& array_signature,
114 const base::ListValue& onc_array, 114 const base::ListValue& onc_array,
115 bool* nested_error) { 115 bool* nested_error) {
116 DCHECK(array_signature.onc_array_entry_signature != NULL) 116 DCHECK(array_signature.onc_array_entry_signature != NULL)
117 << "Found missing onc_array_entry_signature."; 117 << "Found missing onc_array_entry_signature.";
118 118
119 std::unique_ptr<base::ListValue> result_array(new base::ListValue); 119 std::unique_ptr<base::ListValue> result_array(new base::ListValue);
120 int original_index = 0; 120 int original_index = 0;
121 for (const auto& entry : onc_array) { 121 for (const auto& entry : onc_array) {
122 std::unique_ptr<base::Value> result_entry; 122 std::unique_ptr<base::Value> result_entry;
123 result_entry = 123 result_entry = MapEntry(original_index,
124 MapEntry(original_index, *array_signature.onc_array_entry_signature, 124 *array_signature.onc_array_entry_signature,
125 entry, nested_error); 125 *entry,
126 nested_error);
126 if (result_entry.get() != NULL) 127 if (result_entry.get() != NULL)
127 result_array->Append(std::move(result_entry)); 128 result_array->Append(std::move(result_entry));
128 else 129 else
129 DCHECK(*nested_error); 130 DCHECK(*nested_error);
130 ++original_index; 131 ++original_index;
131 } 132 }
132 return result_array; 133 return result_array;
133 } 134 }
134 135
135 std::unique_ptr<base::Value> Mapper::MapEntry( 136 std::unique_ptr<base::Value> Mapper::MapEntry(
136 int index, 137 int index,
137 const OncValueSignature& signature, 138 const OncValueSignature& signature,
138 const base::Value& onc_value, 139 const base::Value& onc_value,
139 bool* error) { 140 bool* error) {
140 return MapValue(signature, onc_value, error); 141 return MapValue(signature, onc_value, error);
141 } 142 }
142 143
143 } // namespace onc 144 } // namespace onc
144 } // namespace chromeos 145 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_certificate_importer_impl.cc ('k') | chromeos/network/onc/onc_merger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698