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

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

Issue 606653006: bindings: Adds DOMArrayBuffer, etc. as thin wrappers for ArrayBuffer, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 years, 2 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 header_template_filename = 'interface.h' 161 header_template_filename = 'interface.h'
162 cpp_template_filename = 'interface.cpp' 162 cpp_template_filename = 'interface.cpp'
163 interface_context = v8_interface.interface_context 163 interface_context = v8_interface.interface_context
164 header_template = self.jinja_env.get_template(header_template_filename) 164 header_template = self.jinja_env.get_template(header_template_filename)
165 cpp_template = self.jinja_env.get_template(cpp_template_filename) 165 cpp_template = self.jinja_env.get_template(cpp_template_filename)
166 166
167 interface_info = self.interfaces_info[interface_name] 167 interface_info = self.interfaces_info[interface_name]
168 168
169 template_context = interface_context(interface) 169 template_context = interface_context(interface)
170 # Add the include for interface itself 170 # Add the include for interface itself
171 template_context['header_includes'].add(interface_info['include_path']) 171 if IdlType(interface_name).is_typed_array:
172 template_context['header_includes'].add('core/dom/DOMTypedArray.h')
173 else:
174 template_context['header_includes'].add(interface_info['include_path '])
172 header_text, cpp_text = render_template( 175 header_text, cpp_text = render_template(
173 interface_info, header_template, cpp_template, template_context) 176 interface_info, header_template, cpp_template, template_context)
174 header_path, cpp_path = self.output_paths(interface_name) 177 header_path, cpp_path = self.output_paths(interface_name)
175 return ( 178 return (
176 (header_path, header_text), 179 (header_path, header_text),
177 (cpp_path, cpp_text), 180 (cpp_path, cpp_text),
178 ) 181 )
179 182
180 def generate_dictionary_code(self, definitions, dictionary_name, 183 def generate_dictionary_code(self, definitions, dictionary_name,
181 dictionary): 184 dictionary):
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 306
304 # Create a dummy file as output for the build system, 307 # Create a dummy file as output for the build system,
305 # since filenames of individual cache files are unpredictable and opaque 308 # since filenames of individual cache files are unpredictable and opaque
306 # (they are hashes of the template path, which varies based on environment) 309 # (they are hashes of the template path, which varies based on environment)
307 with open(dummy_filename, 'w') as dummy_file: 310 with open(dummy_filename, 'w') as dummy_file:
308 pass # |open| creates or touches the file 311 pass # |open| creates or touches the file
309 312
310 313
311 if __name__ == '__main__': 314 if __name__ == '__main__':
312 sys.exit(main(sys.argv)) 315 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « Source/bindings/modules/v8/custom/V8SubtleCryptoCustom.cpp ('k') | Source/bindings/scripts/idl_definitions.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698