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

Unified Diff: tools/json_schema_compiler/cpp_util.py

Issue 143473003: Generate ax enums from idl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Caught Blink enum conversion bug! Created 6 years, 10 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 | « tools/json_schema_compiler/cpp_type_generator.py ('k') | tools/json_schema_compiler/idl_schema.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/cpp_util.py
diff --git a/tools/json_schema_compiler/cpp_util.py b/tools/json_schema_compiler/cpp_util.py
index 1e7c3707883bccdce8fd80279e210ad0620bee36..e7c29ac0777de2efdc31ec7bc5a77e2e67d95b69 100644
--- a/tools/json_schema_compiler/cpp_util.py
+++ b/tools/json_schema_compiler/cpp_util.py
@@ -110,6 +110,10 @@ def OpenNamespace(namespace):
"""Get opening root namespace declarations.
"""
c = Code()
+ # In lieu of GYP supporting None for the namespace variable the '' namespace
+ # implies there is no root namespace.
+ if namespace == '':
+ return c
for component in namespace.split('::'):
c.Append('namespace %s {' % component)
return c
@@ -119,6 +123,10 @@ def CloseNamespace(namespace):
"""Get closing root namespace declarations.
"""
c = Code()
+ # In lieu of GYP supporting None for the namespace variable the '' namespace
+ # implies there is no root namespace.
+ if namespace == '':
+ return c
for component in reversed(namespace.split('::')):
c.Append('} // namespace %s' % component)
return c
« no previous file with comments | « tools/json_schema_compiler/cpp_type_generator.py ('k') | tools/json_schema_compiler/idl_schema.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698