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

Side by Side Diff: headless/public/internal/value_conversions.h

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
« no previous file with comments | « google_apis/gaia/gaia_auth_fetcher.cc ('k') | ios/chrome/browser/autofill/autofill_agent.mm » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef HEADLESS_PUBLIC_INTERNAL_VALUE_CONVERSIONS_H_ 5 #ifndef HEADLESS_PUBLIC_INTERNAL_VALUE_CONVERSIONS_H_
6 #define HEADLESS_PUBLIC_INTERNAL_VALUE_CONVERSIONS_H_ 6 #define HEADLESS_PUBLIC_INTERNAL_VALUE_CONVERSIONS_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 struct FromValue<std::vector<T>> { 144 struct FromValue<std::vector<T>> {
145 static std::vector<T> Parse(const base::Value& value, ErrorReporter* errors) { 145 static std::vector<T> Parse(const base::Value& value, ErrorReporter* errors) {
146 std::vector<T> result; 146 std::vector<T> result;
147 const base::ListValue* list; 147 const base::ListValue* list;
148 if (!value.GetAsList(&list)) { 148 if (!value.GetAsList(&list)) {
149 errors->AddError("list value expected"); 149 errors->AddError("list value expected");
150 return result; 150 return result;
151 } 151 }
152 errors->Push(); 152 errors->Push();
153 for (const auto& item : *list) 153 for (const auto& item : *list)
154 result.push_back(FromValue<T>::Parse(item, errors)); 154 result.push_back(FromValue<T>::Parse(*item, errors));
155 errors->Pop(); 155 errors->Pop();
156 return result; 156 return result;
157 } 157 }
158 }; 158 };
159 159
160 } // namespace internal 160 } // namespace internal
161 } // namespace headless 161 } // namespace headless
162 162
163 #endif // HEADLESS_PUBLIC_INTERNAL_VALUE_CONVERSIONS_H_ 163 #endif // HEADLESS_PUBLIC_INTERNAL_VALUE_CONVERSIONS_H_
OLDNEW
« no previous file with comments | « google_apis/gaia/gaia_auth_fetcher.cc ('k') | ios/chrome/browser/autofill/autofill_agent.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698