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

Unified Diff: tools/json_schema_compiler/h_generator.py

Issue 12041098: Initial commit of the Dart Chrome Extension APIs generators (Closed) Base URL: http://git.chromium.org/chromium/src.git@file_path_bugfix
Patch Set: Small style & structure fixes to dart_generator, and similar. Created 7 years, 11 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/h_generator.py
diff --git a/tools/json_schema_compiler/h_generator.py b/tools/json_schema_compiler/h_generator.py
index 43d14f8f7724c75436fd9ec3b4ca031111bb93a6..fb8fdb58c328d64cb65908dc9370a082c88fb2dc 100644
--- a/tools/json_schema_compiler/h_generator.py
+++ b/tools/json_schema_compiler/h_generator.py
@@ -8,6 +8,13 @@ import cpp_util
import schema_util
class HGenerator(object):
+ def __init__(self, type_generator):
+ self._type_generator = type_generator
+
+ def Generate(self, namespace):
+ return _Generator(namespace, self._type_generator).Generate()
+
+class _Generator(object):
"""A .h generator for a namespace.
"""
def __init__(self, namespace, cpp_type_generator):
@@ -242,6 +249,7 @@ class HGenerator(object):
is_in_container=True)))
)
(c.Eblock()
+ .Append()
.Sblock(' private:')
.Append('DISALLOW_COPY_AND_ASSIGN(%(classname)s);')
.Eblock('};')
@@ -320,6 +328,7 @@ class HGenerator(object):
.Cblock(self._GenerateTypes(p.type_ for p in function.params))
.Cblock(self._GenerateFields(function.params))
.Eblock()
+ .Append()
.Sblock(' private:')
.Append('Params();')
.Append()

Powered by Google App Engine
This is Rietveld 408576698