summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-21 19:42:19 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-21 19:42:19 +0000
commit0c6c1e43289fc2e225a6c824aff40c9b63b5df78 (patch)
tree9ab1034e260c5887ecc7a70cd112cef97458582a /tools
parentae0c0f6af00c25b6c41c9e37e8cb849de9a9a680 (diff)
downloadchromium_src-0c6c1e43289fc2e225a6c824aff40c9b63b5df78.zip
chromium_src-0c6c1e43289fc2e225a6c824aff40c9b63b5df78.tar.gz
chromium_src-0c6c1e43289fc2e225a6c824aff40c9b63b5df78.tar.bz2
Add base namespace to more values in sync and elsewhere.
This makes sync and net compile with no "using *Value". BUG= Review URL: https://codereview.chromium.org/17034006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207907 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r--tools/json_schema_compiler/util.cc16
-rw-r--r--tools/json_schema_compiler/util.h30
2 files changed, 24 insertions, 22 deletions
diff --git a/tools/json_schema_compiler/util.cc b/tools/json_schema_compiler/util.cc
index 25f908c..a449509 100644
--- a/tools/json_schema_compiler/util.cc
+++ b/tools/json_schema_compiler/util.cc
@@ -9,23 +9,23 @@
namespace json_schema_compiler {
namespace util {
-bool GetItemFromList(const ListValue& from, int index, int* out) {
+bool GetItemFromList(const base::ListValue& from, int index, int* out) {
return from.GetInteger(index, out);
}
-bool GetItemFromList(const ListValue& from, int index, bool* out) {
+bool GetItemFromList(const base::ListValue& from, int index, bool* out) {
return from.GetBoolean(index, out);
}
-bool GetItemFromList(const ListValue& from, int index, double* out) {
+bool GetItemFromList(const base::ListValue& from, int index, double* out) {
return from.GetDouble(index, out);
}
-bool GetItemFromList(const ListValue& from, int index, std::string* out) {
+bool GetItemFromList(const base::ListValue& from, int index, std::string* out) {
return from.GetString(index, out);
}
-bool GetItemFromList(const ListValue& from,
+bool GetItemFromList(const base::ListValue& from,
int index,
linked_ptr<base::Value>* out) {
const base::Value* value = NULL;
@@ -35,9 +35,9 @@ bool GetItemFromList(const ListValue& from,
return true;
}
-bool GetItemFromList(const ListValue& from, int index,
+bool GetItemFromList(const base::ListValue& from, int index,
linked_ptr<base::DictionaryValue>* out) {
- const DictionaryValue* dict = NULL;
+ const base::DictionaryValue* dict = NULL;
if (!from.GetDictionary(index, &dict))
return false;
*out = make_linked_ptr(dict->DeepCopy());
@@ -67,7 +67,7 @@ void AddItemToList(const linked_ptr<base::Value>& from,
void AddItemToList(const linked_ptr<base::DictionaryValue>& from,
base::ListValue* out) {
- out->Append(static_cast<Value*>(from->DeepCopy()));
+ out->Append(static_cast<base::Value*>(from->DeepCopy()));
}
} // namespace api_util
diff --git a/tools/json_schema_compiler/util.h b/tools/json_schema_compiler/util.h
index 425487d..7957830 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