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

Side by Side Diff: Source/bindings/scripts/code_generator_v8.py

Issue 1257613003: bindings: Supports inheritance of [Unforgeable] attributes as accessor-type properties. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Made inherit_unforgeable_attributes more robust. Created 5 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 unified diff | Download patch | Annotate | Revision Log
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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 header_template_filename = 'partial_interface.h' 238 header_template_filename = 'partial_interface.h'
239 cpp_template_filename = 'partial_interface.cpp' 239 cpp_template_filename = 'partial_interface.cpp'
240 interface_name += 'Partial' 240 interface_name += 'Partial'
241 assert component == 'core' 241 assert component == 'core'
242 component = 'modules' 242 component = 'modules'
243 include_paths = interface_info.get('dependencies_other_component_inc lude_paths') 243 include_paths = interface_info.get('dependencies_other_component_inc lude_paths')
244 else: 244 else:
245 header_template_filename = 'interface.h' 245 header_template_filename = 'interface.h'
246 cpp_template_filename = 'interface.cpp' 246 cpp_template_filename = 'interface.cpp'
247 interface_context = v8_interface.interface_context 247 interface_context = v8_interface.interface_context
248 header_template = self.jinja_env.get_template(header_template_filename)
249 cpp_template = self.jinja_env.get_template(cpp_template_filename)
250 248
251 template_context = interface_context(interface) 249 template_context = interface_context(interface)
250 includes.update(interface_info.get('cpp_includes', {}).get(component, se t()))
252 if not interface.is_partial and not is_testing_target(full_path): 251 if not interface.is_partial and not is_testing_target(full_path):
253 template_context['header_includes'].add(self.info_provider.include_p ath_for_export) 252 template_context['header_includes'].add(self.info_provider.include_p ath_for_export)
254 template_context['exported'] = self.info_provider.specifier_for_expo rt 253 template_context['exported'] = self.info_provider.specifier_for_expo rt
255 # Add the include for interface itself 254 # Add the include for interface itself
256 if IdlType(interface_name).is_typed_array: 255 if IdlType(interface_name).is_typed_array:
257 template_context['header_includes'].add('core/dom/DOMTypedArray.h') 256 template_context['header_includes'].add('core/dom/DOMTypedArray.h')
258 elif interface_info['include_path']: 257 elif interface_info['include_path']:
259 template_context['header_includes'].add(interface_info['include_path ']) 258 template_context['header_includes'].add(interface_info['include_path '])
259
260 header_template = self.jinja_env.get_template(header_template_filename)
261 cpp_template = self.jinja_env.get_template(cpp_template_filename)
260 header_text, cpp_text = render_template( 262 header_text, cpp_text = render_template(
261 include_paths, header_template, cpp_template, template_context, 263 include_paths, header_template, cpp_template, template_context,
262 component) 264 component)
263 header_path, cpp_path = self.output_paths(interface_name) 265 header_path, cpp_path = self.output_paths(interface_name)
264 return ( 266 return (
265 (header_path, header_text), 267 (header_path, header_text),
266 (cpp_path, cpp_text), 268 (cpp_path, cpp_text),
267 ) 269 )
268 270
269 def generate_dictionary_code(self, definitions, dictionary_name, 271 def generate_dictionary_code(self, definitions, dictionary_name,
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 458
457 # Create a dummy file as output for the build system, 459 # Create a dummy file as output for the build system,
458 # since filenames of individual cache files are unpredictable and opaque 460 # since filenames of individual cache files are unpredictable and opaque
459 # (they are hashes of the template path, which varies based on environment) 461 # (they are hashes of the template path, which varies based on environment)
460 with open(dummy_filename, 'w') as dummy_file: 462 with open(dummy_filename, 'w') as dummy_file:
461 pass # |open| creates or touches the file 463 pass # |open| creates or touches the file
462 464
463 465
464 if __name__ == '__main__': 466 if __name__ == '__main__':
465 sys.exit(main(sys.argv)) 467 sys.exit(main(sys.argv))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698