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

Unified Diff: tools/json_schema_compiler/h_generator.py

Issue 9701105: Revert 127159 - Refactor extension_function_dispatcher to extract ExtensionFunctionRegistry. This a… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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
===================================================================
--- tools/json_schema_compiler/h_generator.py (revision 127187)
+++ tools/json_schema_compiler/h_generator.py (working copy)
@@ -27,8 +27,7 @@
.Append()
)
- ifndef_name = cpp_util.GenerateIfndefName(self._namespace.source_file_dir,
- self._target_namespace)
+ ifndef_name = self._GenerateIfndefName()
(c.Append('#ifndef %s' % ifndef_name)
.Append('#define %s' % ifndef_name)
.Append('#pragma once')
@@ -264,3 +263,13 @@
c.Eblock('};')
return c
+
+ def _GenerateIfndefName(self):
+ """Formats a path and filename as a #define name.
+
+ e.g chrome/extensions/gen, file.h becomes CHROME_EXTENSIONS_GEN_FILE_H__.
+ """
+ return (('%s_%s_H__' %
+ (self._namespace.source_file_dir, self._target_namespace))
+ .upper().replace(os.sep, '_'))
+
« no previous file with comments | « tools/json_schema_compiler/h_bundle_generator.py ('k') | tools/json_schema_compiler/test/json_schema_compiler_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698