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

Unified Diff: tools/json_schema_compiler/cc_generator.py

Issue 11953121: Fix up how the JSON Schema compiler decides whether to include or forward (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert changes to webview so that this can land 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
« no previous file with comments | « chrome/common/extensions/api/events.json ('k') | tools/json_schema_compiler/cpp_type_generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/cc_generator.py
diff --git a/tools/json_schema_compiler/cc_generator.py b/tools/json_schema_compiler/cc_generator.py
index 86724fc4d0668cc6d7d66eb49017b37f7908060d..fff945762c379dd46c55d3e04446731444d33966 100644
--- a/tools/json_schema_compiler/cc_generator.py
+++ b/tools/json_schema_compiler/cc_generator.py
@@ -30,10 +30,12 @@ class CCGenerator(object):
.Append(cpp_util.GENERATED_FILE_MESSAGE % self._namespace.source_file)
.Append()
.Append(self._util_cc_helper.GetIncludePath())
+ .Append('#include "base/json/json_writer.h"')
+ .Append('#include "base/logging.h"')
+ .Append('#include "base/string_number_conversions.h"')
.Append('#include "%s/%s.h"' %
(self._namespace.source_file_dir, self._namespace.unix_name))
- .Append('#include "base/logging.h"')
- .Cblock(self._type_helper.GenerateIncludes())
+ .Cblock(self._type_helper.GenerateIncludes(include_soft=True))
.Concat(self._type_helper.GetRootNamespaceStart())
.Cblock(self._type_helper.GetNamespaceStart())
)
@@ -81,7 +83,7 @@ class CCGenerator(object):
def _GenerateType(self, cpp_namespace, type_):
"""Generates the function definitions for a type.
"""
- classname = cpp_util.Classname(schema_util.StripSchemaNamespace(type_.name))
+ classname = cpp_util.Classname(schema_util.StripNamespace(type_.name))
c = Code()
if type_.functions:
@@ -164,7 +166,7 @@ class CCGenerator(object):
E.g for type "Foo", generates Foo::Populate()
"""
- classname = cpp_util.Classname(schema_util.StripSchemaNamespace(type_.name))
+ classname = cpp_util.Classname(schema_util.StripNamespace(type_.name))
c = Code()
(c.Append('// static')
.Append('bool %(namespace)s::Populate(')
@@ -710,7 +712,7 @@ class CCGenerator(object):
"""Generates ToString() which gets the string representation of an enum.
"""
c = Code()
- classname = cpp_util.Classname(schema_util.StripSchemaNamespace(type_.name))
+ classname = cpp_util.Classname(schema_util.StripNamespace(type_.name))
if cpp_namespace is not None:
c.Append('// static')
@@ -736,7 +738,7 @@ class CCGenerator(object):
representation.
"""
c = Code()
- classname = cpp_util.Classname(schema_util.StripSchemaNamespace(type_.name))
+ classname = cpp_util.Classname(schema_util.StripNamespace(type_.name))
if cpp_namespace is not None:
c.Append('// static')
« no previous file with comments | « chrome/common/extensions/api/events.json ('k') | tools/json_schema_compiler/cpp_type_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698