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

Unified Diff: tools/json_schema_compiler/h_generator.py

Issue 487533005: Add support for references in different paths in apis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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/dart_generator_test.py ('k') | tools/json_schema_compiler/model.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/h_generator.py
diff --git a/tools/json_schema_compiler/h_generator.py b/tools/json_schema_compiler/h_generator.py
index 95c80568f86685bee768c06c9d596a76bccafee7..a6d67db2cc78657a933ee1c9140ef219304b5f35 100644
--- a/tools/json_schema_compiler/h_generator.py
+++ b/tools/json_schema_compiler/h_generator.py
@@ -10,23 +10,19 @@ import cpp_util
import schema_util
class HGenerator(object):
- def __init__(self, type_generator, cpp_namespace_pattern):
+ def __init__(self, type_generator):
self._type_generator = type_generator
- self._cpp_namespace_pattern = cpp_namespace_pattern
def Generate(self, namespace):
- return _Generator(namespace,
- self._type_generator,
- self._cpp_namespace_pattern).Generate()
+ return _Generator(namespace, self._type_generator).Generate()
class _Generator(object):
"""A .h generator for a namespace.
"""
- def __init__(self, namespace, cpp_type_generator, cpp_namespace_pattern):
+ def __init__(self, namespace, cpp_type_generator):
self._namespace = namespace
self._type_helper = cpp_type_generator
- self._cpp_namespace_pattern = cpp_namespace_pattern
self._generate_error_messages = namespace.compiler_options.get(
'generate_error_messages', False)
@@ -65,11 +61,11 @@ class _Generator(object):
# $ref types from other files to be used as required params. This requires
# some detangling of windows and tabs which will currently lead to circular
# #includes.
- c.Cblock(self._type_helper.GenerateForwardDeclarations(
- self._cpp_namespace_pattern))
+ c.Cblock(self._type_helper.GenerateForwardDeclarations())
- cpp_namespace = cpp_util.GetCppNamespace(self._cpp_namespace_pattern,
- self._namespace.unix_name)
+ cpp_namespace = cpp_util.GetCppNamespace(
+ self._namespace.environment.namespace_pattern,
+ self._namespace.unix_name)
c.Concat(cpp_util.OpenNamespace(cpp_namespace))
c.Append()
if self._namespace.properties:
« no previous file with comments | « tools/json_schema_compiler/dart_generator_test.py ('k') | tools/json_schema_compiler/model.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698