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

Side by Side Diff: Source/build/scripts/name_macros.py

Issue 360053004: Fix some nits as a follow-up for issue 355193003. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 path = entry['name'] 124 path = entry['name']
125 return path + '.h' 125 return path + '.h'
126 126
127 def _headers_header_includes(self, entries): 127 def _headers_header_includes(self, entries):
128 includes = dict() 128 includes = dict()
129 for entry in entries: 129 for entry in entries:
130 cpp_name = name_utilities.cpp_name(entry) 130 cpp_name = name_utilities.cpp_name(entry)
131 # Avoid duplicate includes. 131 # Avoid duplicate includes.
132 if cpp_name in includes: 132 if cpp_name in includes:
133 continue 133 continue
134 if self.suffix == "Modules": 134 if self.suffix == 'Modules':
135 subdir_name = 'modules' 135 subdir_name = 'modules'
136 else: 136 else:
137 subdir_name = 'core' 137 subdir_name = 'core'
138 include = '#include "%(path)s"\n#include "bindings/%(subdir_name)s/v 8/V8%(script_name)s.h"' % { 138 include = '#include "%(path)s"\n#include "bindings/%(subdir_name)s/v 8/V8%(script_name)s.h"' % {
139 'path': self._headers_header_include_path(entry), 139 'path': self._headers_header_include_path(entry),
140 'script_name': name_utilities.script_name(entry),
140 'subdir_name': subdir_name, 141 'subdir_name': subdir_name,
141 'script_name': name_utilities.script_name(entry),
142 } 142 }
143 includes[cpp_name] = self.wrap_with_condition(include, entry['Condit ional']) 143 includes[cpp_name] = self.wrap_with_condition(include, entry['Condit ional'])
144 return includes.values() 144 return includes.values()
145 145
146 def generate_headers_header(self): 146 def generate_headers_header(self):
147 base_header_for_suffix = '' 147 base_header_for_suffix = ''
148 if self.suffix: 148 if self.suffix:
149 base_header_for_suffix = '\n#include "core/%(namespace)sHeaders.h"\n ' % {'namespace': self.namespace} 149 base_header_for_suffix = '\n#include "core/%(namespace)sHeaders.h"\n ' % {'namespace': self.namespace}
150 return HEADER_TEMPLATE % { 150 return HEADER_TEMPLATE % {
151 'license': license.license_for_generated_cpp(), 151 'license': license.license_for_generated_cpp(),
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 return INTERFACES_HEADER_TEMPLATE % { 192 return INTERFACES_HEADER_TEMPLATE % {
193 'license': license.license_for_generated_cpp(), 193 'license': license.license_for_generated_cpp(),
194 'namespace': self.namespace, 194 'namespace': self.namespace,
195 'suffix': self.suffix, 195 'suffix': self.suffix,
196 'base_header_for_suffix': base_header_for_suffix, 196 'base_header_for_suffix': base_header_for_suffix,
197 'macro_style_name': name_utilities.to_macro_style(self.namespace + s elf.suffix), 197 'macro_style_name': name_utilities.to_macro_style(self.namespace + s elf.suffix),
198 'declare_conditional_macros': self._declare_conditional_macros(), 198 'declare_conditional_macros': self._declare_conditional_macros(),
199 'unconditional_macros': '\n'.join(sorted(set(map(self._unconditional _macro, self._unconditional_entries)))), 199 'unconditional_macros': '\n'.join(sorted(set(map(self._unconditional _macro, self._unconditional_entries)))),
200 'conditional_macros': '\n'.join(map(self._conditional_macros, self._ entries_by_conditional.keys())), 200 'conditional_macros': '\n'.join(map(self._conditional_macros, self._ entries_by_conditional.keys())),
201 } 201 }
OLDNEW
« no previous file with comments | « no previous file | Source/core/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698