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

Unified Diff: tools/json_schema_compiler/util.h

Issue 17034006: Add base namespace to more values in sync and elsewhere. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/test/accounts_client/test_accounts_client_unittest.cc ('k') | tools/json_schema_compiler/util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/util.h
diff --git a/tools/json_schema_compiler/util.h b/tools/json_schema_compiler/util.h
index 425487d3c652d053acb39af56e73aed2a7835974..79578301c8f88fdd867ff73d70491e83cf2a646f 100644
--- a/tools/json_schema_compiler/util.h
+++ b/tools/json_schema_compiler/util.h
@@ -18,21 +18,23 @@ namespace util {
// Creates a new item at |out| from |from|[|index|]. These are used by template
// specializations of |Get(Optional)ArrayFromList|.
-bool GetItemFromList(const ListValue& from, int index, int* out);
-bool GetItemFromList(const ListValue& from, int index, bool* out);
-bool GetItemFromList(const ListValue& from, int index, double* out);
-bool GetItemFromList(const ListValue& from, int index, std::string* out);
-bool GetItemFromList(const ListValue& from,
+bool GetItemFromList(const base::ListValue& from, int index, int* out);
+bool GetItemFromList(const base::ListValue& from, int index, bool* out);
+bool GetItemFromList(const base::ListValue& from, int index, double* out);
+bool GetItemFromList(const base::ListValue& from, int index, std::string* out);
+bool GetItemFromList(const base::ListValue& from,
int index,
linked_ptr<base::Value>* out);
-bool GetItemFromList(const ListValue& from,
+bool GetItemFromList(const base::ListValue& from,
int index,
linked_ptr<base::DictionaryValue>* out);
// This template is used for types generated by tools/json_schema_compiler.
template<class T>
-bool GetItemFromList(const ListValue& from, int index, linked_ptr<T>* out) {
- const DictionaryValue* dict;
+bool GetItemFromList(const base::ListValue& from,
+ int index,
+ linked_ptr<T>* out) {
+ const base::DictionaryValue* dict;
if (!from.GetDictionary(index, &dict))
return false;
scoped_ptr<T> obj(new T());
@@ -45,7 +47,7 @@ bool GetItemFromList(const ListValue& from, int index, linked_ptr<T>* out) {
// This is used for getting an enum out of a ListValue, which will happen if an
// array of enums is a parameter to a function.
template<class T>
-bool GetItemFromList(const ListValue& from, int index, T* out) {
+bool GetItemFromList(const base::ListValue& from, int index, T* out) {
int value;
if (!from.GetInteger(index, &value))
return false;
@@ -139,7 +141,7 @@ void AddItemToList(const linked_ptr<base::DictionaryValue>& from,
// This template is used for types generated by tools/json_schema_compiler.
template<class T>
-void AddItemToList(const linked_ptr<T>& from, ListValue* out) {
+void AddItemToList(const linked_ptr<T>& from, base::ListValue* out) {
out->Append(from->ToValue().release());
}
@@ -168,18 +170,18 @@ void PopulateListFromOptionalArray(
}
template <class T>
-scoped_ptr<Value> CreateValueFromArray(const std::vector<T>& from) {
+scoped_ptr<base::Value> CreateValueFromArray(const std::vector<T>& from) {
base::ListValue* list = new base::ListValue();
PopulateListFromArray(from, list);
- return scoped_ptr<Value>(list);
+ return scoped_ptr<base::Value>(list);
}
template <class T>
-scoped_ptr<Value> CreateValueFromOptionalArray(
+scoped_ptr<base::Value> CreateValueFromOptionalArray(
const scoped_ptr<std::vector<T> >& from) {
if (from.get())
return CreateValueFromArray(*from);
- return scoped_ptr<Value>();
+ return scoped_ptr<base::Value>();
}
} // namespace util
« no previous file with comments | « sync/test/accounts_client/test_accounts_client_unittest.cc ('k') | tools/json_schema_compiler/util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698