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

Side by Side Diff: sky/engine/bindings/scripts/dart_compiler.py

Issue 1135283005: Sky: Add a CustomDart attribute to the IDL compiler, and use that with Canvas (Closed) Base URL: git@github.com:/domokit/mojo.git@master
Patch Set: . Created 5 years, 7 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
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (C) 2013 Google Inc. All rights reserved. 2 # Copyright (C) 2013 Google Inc. All rights reserved.
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 self.output_directory = output_directory 76 self.output_directory = output_directory
77 self.reader = IdlReader(interfaces_info, output_directory) 77 self.reader = IdlReader(interfaces_info, output_directory)
78 78
79 def compile_and_write(self, idl_filename, output_filenames): 79 def compile_and_write(self, idl_filename, output_filenames):
80 interface_name = idl_filename_to_interface_name(idl_filename) 80 interface_name = idl_filename_to_interface_name(idl_filename)
81 idl_pickle_filename = os.path.join(self.output_directory, 81 idl_pickle_filename = os.path.join(self.output_directory,
82 '%s_globals.pickle' % interface_name) 82 '%s_globals.pickle' % interface_name)
83 definitions = self.reader.read_idl_definitions(idl_filename) 83 definitions = self.reader.read_idl_definitions(idl_filename)
84 output_code_list = self.code_generator.generate_code(definitions, 84 output_code_list = self.code_generator.generate_code(definitions,
85 interface_name, 85 interface_name,
86 idl_filename,
86 idl_pickle_filename , 87 idl_pickle_filename ,
87 self.only_if_change d) 88 self.only_if_change d)
88 89
89 for output_code, output_filename in zip(output_code_list, output_filenam es): 90 for output_code, output_filename in zip(output_code_list, output_filenam es):
90 write_file(output_code, output_filename, self.only_if_changed) 91 write_file(output_code, output_filename, self.only_if_changed)
91 92
92 def generate_global_and_write(self, global_entries, output_filenames): 93 def generate_global_and_write(self, global_entries, output_filenames):
93 output_code_list = self.code_generator.generate_globals(global_entries) 94 output_code_list = self.code_generator.generate_globals(global_entries)
94 for output_code, output_filename in zip(output_code_list, output_filenam es): 95 for output_code, output_filename in zip(output_code_list, output_filenam es):
95 write_file(output_code, output_filename, self.only_if_changed) 96 write_file(output_code, output_filename, self.only_if_changed)
96 97
97 def generate_dart_blink_and_write(self, global_entries, output_filename): 98 def generate_dart_blink_and_write(self, global_entries, output_filename):
98 output_code = self.code_generator.generate_dart_blink(global_entries) 99 output_code = self.code_generator.generate_dart_blink(global_entries)
99 write_file(output_code, output_filename, self.only_if_changed) 100 write_file(output_code, output_filename, self.only_if_changed)
100 101
101 @abc.abstractmethod 102 @abc.abstractmethod
102 def compile_file(self, idl_filename): 103 def compile_file(self, idl_filename):
103 pass 104 pass
OLDNEW
« no previous file with comments | « sky/engine/bindings/scripts/code_generator_dart.py ('k') | sky/engine/bindings/scripts/templates/interface_dart.template » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698