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

Side by Side Diff: tools/dom/scripts/systemnative.py

Issue 12095088: "Reverting 17940" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """This module provides shared functionality for the systems to generate 6 """This module provides shared functionality for the systems to generate
7 native binding from the IDL database.""" 7 native binding from the IDL database."""
8 8
9 import emitter 9 import emitter
10 import os 10 import os
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 arguments, 228 arguments,
229 self._interface.id, 229 self._interface.id,
230 'ConstructorRaisesException' in ext_attrs) 230 'ConstructorRaisesException' in ext_attrs)
231 231
232 def HasSupportCheck(self): 232 def HasSupportCheck(self):
233 # Need to omit a support check if it is conditional in JS. 233 # Need to omit a support check if it is conditional in JS.
234 return self._interface.doc_js_name in js_support_checks 234 return self._interface.doc_js_name in js_support_checks
235 235
236 def GetSupportCheck(self): 236 def GetSupportCheck(self):
237 # Assume that everything is supported on Dartium. 237 # Assume that everything is supported on Dartium.
238 value = js_support_checks.get(self._interface.doc_js_name) 238 return 'true'
239 if type(value) == tuple:
240 return value
241 else:
242 return 'true'
243 239
244 def FinishInterface(self): 240 def FinishInterface(self):
245 self._GenerateCPPHeader() 241 self._GenerateCPPHeader()
246 242
247 self._cpp_impl_emitter.Emit( 243 self._cpp_impl_emitter.Emit(
248 self._template_loader.Load('cpp_implementation.template'), 244 self._template_loader.Load('cpp_implementation.template'),
249 INTERFACE=self._interface.id, 245 INTERFACE=self._interface.id,
250 INCLUDES=self._GenerateCPPIncludes(self._cpp_impl_includes), 246 INCLUDES=self._GenerateCPPIncludes(self._cpp_impl_includes),
251 CALLBACKS=self._cpp_definitions_emitter.Fragments(), 247 CALLBACKS=self._cpp_definitions_emitter.Fragments(),
252 RESOLVER=self._cpp_resolver_emitter.Fragments(), 248 RESOLVER=self._cpp_resolver_emitter.Fragments(),
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu mentCount))\n' 891 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu mentCount))\n'
896 ' return func;\n', 892 ' return func;\n',
897 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) 893 CLASS_NAME=os.path.splitext(os.path.basename(path))[0])
898 894
899 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): 895 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument):
900 return ( 896 return (
901 interface.id.endswith('Event') and 897 interface.id.endswith('Event') and
902 operation.id.startswith('init') and 898 operation.id.startswith('init') and
903 argument.ext_attrs.get('Optional') == 'DefaultIsUndefined' and 899 argument.ext_attrs.get('Optional') == 'DefaultIsUndefined' and
904 argument.type.id == 'DOMString') 900 argument.type.id == 'DOMString')
OLDNEW
« no previous file with comments | « tools/dom/scripts/systemhtml.py ('k') | tools/dom/templates/html/impl/impl_SVGElement.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698