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

Side by Side Diff: tools/json_schema_compiler/util.h

Issue 2149253003: Switch various ValueTypeToString()s to base::Value::GetTypeName(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@value
Patch Set: fix tests Created 4 years, 5 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 #ifndef TOOLS_JSON_SCHEMA_COMPILER_UTIL_H_ 5 #ifndef TOOLS_JSON_SCHEMA_COMPILER_UTIL_H_
6 #define TOOLS_JSON_SCHEMA_COMPILER_UTIL_H_ 6 #define TOOLS_JSON_SCHEMA_COMPILER_UTIL_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 template <class T> 200 template <class T>
201 std::unique_ptr<base::Value> CreateValueFromArray(const std::vector<T>& from) { 201 std::unique_ptr<base::Value> CreateValueFromArray(const std::vector<T>& from) {
202 std::unique_ptr<base::ListValue> list(new base::ListValue()); 202 std::unique_ptr<base::ListValue> list(new base::ListValue());
203 PopulateListFromArray(from, list.get()); 203 PopulateListFromArray(from, list.get());
204 return std::move(list); 204 return std::move(list);
205 } 205 }
206 206
207 template <class T> 207 template <class T>
208 std::unique_ptr<base::Value> CreateValueFromOptionalArray( 208 std::unique_ptr<base::Value> CreateValueFromOptionalArray(
209 const std::unique_ptr<std::vector<T>>& from) { 209 const std::unique_ptr<std::vector<T>>& from) {
210 if (from) 210 return from ? CreateValueFromArray(*from) : nullptr;
211 return CreateValueFromArray(*from);
212 return nullptr;
213 } 211 }
214 212
215 std::string ValueTypeToString(base::Value::Type type);
216
217 } // namespace util 213 } // namespace util
218 } // namespace json_schema_compiler 214 } // namespace json_schema_compiler
219 215
220 #endif // TOOLS_JSON_SCHEMA_COMPILER_UTIL_H_ 216 #endif // TOOLS_JSON_SCHEMA_COMPILER_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698