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

Side by Side Diff: core/scripts/make_dom_exceptions.py

Issue 15643014: Blink IDL roll. (Closed) Base URL: http://dart.googlecode.com/svn/third_party/WebCore/
Patch Set: Created 7 years, 6 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
« no previous file with comments | « core/scripts/make_css_value_keywords.py ('k') | core/scripts/make_event_factory.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 class ExceptionCodeDescriptionWriter(name_macros.Writer): 116 class ExceptionCodeDescriptionWriter(name_macros.Writer):
117 defaults = { 117 defaults = {
118 'interfaceName': None, 118 'interfaceName': None,
119 'conditional': None, 119 'conditional': None,
120 } 120 }
121 default_parameters = { 121 default_parameters = {
122 'namespace': '', 122 'namespace': '',
123 } 123 }
124 124
125 def __init__(self, in_file_path, enabled_conditions):
126 super(ExceptionCodeDescriptionWriter, self).__init__(in_file_path, enabl ed_conditions)
127 self._outputs[(self.class_name + ".cpp")] = self.generate_implementation
128 self._outputs[(self.class_name + ".h")] = self.generate_header
129
125 def _exceptions(self): 130 def _exceptions(self):
126 return self.in_file.name_dictionaries 131 return self.in_file.name_dictionaries
127 132
128 def _exception_type(self, exception): 133 def _exception_type(self, exception):
129 name = os.path.basename(exception['name']) 134 name = os.path.basename(exception['name'])
130 return self.wrap_with_condition(' ' + name + 'Type,', exception['cond itional']) 135 return self.wrap_with_condition(' ' + name + 'Type,', exception['cond itional'])
131 136
132 def generate_header(self): 137 def generate_header(self):
133 return HEADER_TEMPLATE % { 138 return HEADER_TEMPLATE % {
134 'license': license.license_for_generated_cpp(), 139 'license': license.license_for_generated_cpp(),
(...skipping 17 matching lines...) Expand all
152 return IMPLEMENTATION_TEMPLATE % { 157 return IMPLEMENTATION_TEMPLATE % {
153 'license': license.license_for_generated_cpp(), 158 'license': license.license_for_generated_cpp(),
154 'class_name': self.class_name, 159 'class_name': self.class_name,
155 'includes': '\n'.join(map(self._include, self._exceptions())), 160 'includes': '\n'.join(map(self._include, self._exceptions())),
156 'description_initalizations': '\n'.join(map(self._description_inital ization, self._exceptions())), 161 'description_initalizations': '\n'.join(map(self._description_inital ization, self._exceptions())),
157 } 162 }
158 163
159 164
160 if __name__ == "__main__": 165 if __name__ == "__main__":
161 name_macros.Maker(ExceptionCodeDescriptionWriter).main(sys.argv) 166 name_macros.Maker(ExceptionCodeDescriptionWriter).main(sys.argv)
OLDNEW
« no previous file with comments | « core/scripts/make_css_value_keywords.py ('k') | core/scripts/make_event_factory.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698