summaryrefslogtreecommitdiffstats
path: root/chromium/tools/json_schema_compiler/cpp_util.py
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/tools/json_schema_compiler/cpp_util.py')
-rw-r--r--chromium/tools/json_schema_compiler/cpp_util.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/chromium/tools/json_schema_compiler/cpp_util.py b/chromium/tools/json_schema_compiler/cpp_util.py
index 1e7c3707883..e7c29ac0777 100644
--- a/chromium/tools/json_schema_compiler/cpp_util.py
+++ b/chromium/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