summaryrefslogtreecommitdiffstats
path: root/tools/json_schema_compiler
diff options
context:
space:
mode:
authorvabr@chromium.org <vabr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-03 08:43:37 +0000
committervabr@chromium.org <vabr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-03 08:43:37 +0000
commit5d30f92bf4e9f055d44ea0db2327b036ae41eef6 (patch)
treee4237d83ef224e420140e6411ac84f60216555d1 /tools/json_schema_compiler
parent4ccaee6820cb8ac79581141a4f2463a2abb38442 (diff)
downloadchromium_src-5d30f92bf4e9f055d44ea0db2327b036ae41eef6.zip
chromium_src-5d30f92bf4e9f055d44ea0db2327b036ae41eef6.tar.gz
chromium_src-5d30f92bf4e9f055d44ea0db2327b036ae41eef6.tar.bz2
Correct const accessors in base/values.(h|cc), Part II (ListValue)
For problem description and other info please see the BUG page. This is for ListValue. BUG=138946 TEST=N/A (no fix & no new feature) TBR=jar,zelidrag,scottbyer,mpcomplete,darin,achuith,sky,estade,atwilson,grt,thakis,jamesr,hans,sadrul,pastarmovj Review URL: https://chromiumcodereview.appspot.com/10837044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149819 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/json_schema_compiler')
-rw-r--r--tools/json_schema_compiler/cc_generator.py2
-rw-r--r--tools/json_schema_compiler/util.cc4
-rw-r--r--tools/json_schema_compiler/util.h2
3 files changed, 4 insertions, 4 deletions
diff --git a/tools/json_schema_compiler/cc_generator.py b/tools/json_schema_compiler/cc_generator.py
index 6875187..d09d325 100644
--- a/tools/json_schema_compiler/cc_generator.py
+++ b/tools/json_schema_compiler/cc_generator.py
@@ -420,7 +420,7 @@ class CCGenerator(object):
failure_value = 'scoped_ptr<Params>()'
c.Append()
value_var = param.unix_name + '_value'
- (c.Append('base::Value* %(value_var)s = NULL;')
+ (c.Append('const base::Value* %(value_var)s = NULL;')
.Append('if (args.Get(%(i)s, &%(value_var)s) &&\n'
' !%(value_var)s->IsType(base::Value::TYPE_NULL))')
.Sblock('{')
diff --git a/tools/json_schema_compiler/util.cc b/tools/json_schema_compiler/util.cc
index 9d8abd5..ca5c25a 100644
--- a/tools/json_schema_compiler/util.cc
+++ b/tools/json_schema_compiler/util.cc
@@ -28,7 +28,7 @@ bool GetItemFromList(const ListValue& from, int index, std::string* out) {
bool GetItemFromList(const ListValue& from, int index,
linked_ptr<any::Any>* out) {
- Value* value = NULL;
+ const Value* value = NULL;
if (!from.Get(index, &value))
return false;
scoped_ptr<any::Any> any_object(new any::Any());
@@ -39,7 +39,7 @@ bool GetItemFromList(const ListValue& from, int index,
bool GetItemFromList(const ListValue& from, int index,
linked_ptr<base::DictionaryValue>* out) {
- DictionaryValue* dict = NULL;
+ const DictionaryValue* dict = NULL;
if (!from.GetDictionary(index, &dict))
return false;
*out = linked_ptr<DictionaryValue>(dict->DeepCopy());
diff --git a/tools/json_schema_compiler/util.h b/tools/json_schema_compiler/util.h
index 61148c6..509b0dc 100644
--- a/tools/json_schema_compiler/util.h
+++ b/tools/json_schema_compiler/util.h
@@ -34,7 +34,7 @@ bool GetItemFromList(const ListValue& from, int index,
// 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) {
- DictionaryValue* dict;
+ const DictionaryValue* dict;
if (!from.GetDictionary(index, &dict))
return false;
scoped_ptr<T> obj(new T());