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

Unified Diff: tools/json_schema_compiler/util.h

Issue 10907151: Extensions Docs Server: Enum values do not show up if enum is a type (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add back braces Created 8 years, 3 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
Index: tools/json_schema_compiler/util.h
diff --git a/tools/json_schema_compiler/util.h b/tools/json_schema_compiler/util.h
index 509b0dc1a772a0a9aca503052d70f2446f7a3b8a..34098200cab0f909cacd3353cb95d8546d56bf0a 100644
--- a/tools/json_schema_compiler/util.h
+++ b/tools/json_schema_compiler/util.h
@@ -44,6 +44,16 @@ bool GetItemFromList(const ListValue& from, int index, linked_ptr<T>* out) {
return true;
}
+// This is used for getting an enum out of a ListValue.
+template<class T>
+bool GetItemFromList(const ListValue& from, int index, T* out) {
+ int value;
+ if (!from.GetInteger(index, &value))
+ return false;
+ *out = static_cast<T>(value);
not at google - send to devlin 2012/09/14 01:44:51 i don't understand, ListValue enums are stored as
cduvall 2012/09/17 22:07:46 I clarified the comment. This happens in the JSC t
+ return true;
+}
+
// Populates |out| with |list|. Returns false if there is no list at the
// specified key or if the list has anything other than |T|.
template <class T>

Powered by Google App Engine
This is Rietveld 408576698