diff options
author | pneubeck <pneubeck@chromium.org> | 2015-01-16 00:13:44 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-16 08:14:38 +0000 |
commit | c337ee55de79ea5d6123cb2556524ae2b27d3363 (patch) | |
tree | 68a0cfe8d875f3e4ed1bb6c9e3a434df7ba25a24 /tools/json_schema_compiler | |
parent | 0828ee01bbbb817a5df73e6ea052c2564349e6ef (diff) | |
download | chromium_src-c337ee55de79ea5d6123cb2556524ae2b27d3363.zip chromium_src-c337ee55de79ea5d6123cb2556524ae2b27d3363.tar.gz chromium_src-c337ee55de79ea5d6123cb2556524ae2b27d3363.tar.bz2 |
Cleanup: Remove unused code from json_schema_compiler.
Review URL: https://codereview.chromium.org/851943002
Cr-Commit-Position: refs/heads/master@{#311856}
Diffstat (limited to 'tools/json_schema_compiler')
-rw-r--r-- | tools/json_schema_compiler/util.h | 37 | ||||
-rw-r--r-- | tools/json_schema_compiler/util_cc_helper.py | 24 |
2 files changed, 0 insertions, 61 deletions
diff --git a/tools/json_schema_compiler/util.h b/tools/json_schema_compiler/util.h index a7e0a6e..ae0aca2 100644 --- a/tools/json_schema_compiler/util.h +++ b/tools/json_schema_compiler/util.h @@ -60,20 +60,6 @@ bool PopulateArrayFromList( return true; } -// Populates |out| with |from|.|name|. Returns false if there is no list at -// the specified key or if the list has anything other than |T|. -template <class T> -bool PopulateArrayFromDictionary( - const base::DictionaryValue& from, - const std::string& name, - std::vector<T>* out) { - const base::ListValue* list = NULL; - if (!from.GetListWithoutPathExpansion(name, &list)) - return false; - - return PopulateArrayFromList(*list, out); -} - // Creates a new vector containing |list| at |out|. Returns // true on success or if there is nothing at the specified key. Returns false // if anything other than a list of |T| is at the specified key. @@ -94,29 +80,6 @@ bool PopulateOptionalArrayFromList( return true; } -// Creates a new vector containing |from|.|name| at |out|. Returns -// true on success or if there is nothing at the specified key. Returns false -// if anything other than a list of |T| is at the specified key. -template <class T> -bool PopulateOptionalArrayFromDictionary( - const base::DictionaryValue& from, - const std::string& name, - scoped_ptr<std::vector<T> >* out) { - const base::ListValue* list = NULL; - { - const base::Value* maybe_list = NULL; - // Since |name| is optional, its absence is acceptable. However, anything - // other than a ListValue is not. - if (!from.GetWithoutPathExpansion(name, &maybe_list)) - return true; - if (!maybe_list->IsType(base::Value::TYPE_LIST)) - return false; - list = static_cast<const base::ListValue*>(maybe_list); - } - - return PopulateOptionalArrayFromList(*list, out); -} - // Appends a Value newly created from |from| to |out|. These used by template // specializations of |Set(Optional)ArrayToList|. void AddItemToList(const int from, base::ListValue* out); diff --git a/tools/json_schema_compiler/util_cc_helper.py b/tools/json_schema_compiler/util_cc_helper.py index 0e41abf..ee5d6f5 100644 --- a/tools/json_schema_compiler/util_cc_helper.py +++ b/tools/json_schema_compiler/util_cc_helper.py @@ -12,30 +12,6 @@ class UtilCCHelper(object): def __init__(self, type_manager): self._type_manager = type_manager - def PopulateArrayFromDictionary(self, array_prop, src, name, dst): - """Generates code to get an array from a src.name into dst. - - src: DictionaryValue* - dst: std::vector or scoped_ptr<std::vector> - """ - prop = array_prop.item_type - sub = { - 'namespace': _API_UTIL_NAMESPACE, - 'name': name, - 'src': src, - 'dst': dst, - } - - sub['type'] = self._type_manager.GetCppType(prop), - if array_prop.optional: - val = ('%(namespace)s::PopulateOptionalArrayFromDictionary' - '(*%(src)s, "%(name)s", &%(dst)s)') - else: - val = ('%(namespace)s::PopulateArrayFromDictionary' - '(*%(src)s, "%(name)s", &%(dst)s)') - - return val % sub - def PopulateArrayFromList(self, src, dst, optional): """Generates code to get an array from src into dst. |