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

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

Issue 10928060: Partially migrate from old getter syntax to new one. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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 | « lib/dom/scripts/systemhtml.py ('k') | lib/dom/templates/html/dart2js/html_dart2js.darttemplate » ('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/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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 if 'CheckSecurityForNode' in attribute.ext_attrs: 409 if 'CheckSecurityForNode' in attribute.ext_attrs:
410 # FIXME: exclude from interface as well. 410 # FIXME: exclude from interface as well.
411 return 411 return
412 412
413 self._AddGetter(attribute, html_name) 413 self._AddGetter(attribute, html_name)
414 if not read_only: 414 if not read_only:
415 self._AddSetter(attribute, html_name) 415 self._AddSetter(attribute, html_name)
416 416
417 def _AddGetter(self, attr, html_name): 417 def _AddGetter(self, attr, html_name):
418 type_info = self._TypeInfo(attr.type.id) 418 type_info = self._TypeInfo(attr.type.id)
419 dart_declaration = '%s get %s()' % (self._DartType(attr.type.id), html_name) 419 dart_declaration = '%s get %s' % (self._DartType(attr.type.id), html_name)
420 is_custom = 'Custom' in attr.ext_attrs or 'CustomGetter' in attr.ext_attrs 420 is_custom = 'Custom' in attr.ext_attrs or 'CustomGetter' in attr.ext_attrs
421 cpp_callback_name = self._GenerateNativeBinding(attr.id, 1, 421 cpp_callback_name = self._GenerateNativeBinding(attr.id, 1,
422 dart_declaration, 'Getter', is_custom) 422 dart_declaration, 'Getter', is_custom)
423 if is_custom: 423 if is_custom:
424 return 424 return
425 425
426 if 'Reflect' in attr.ext_attrs: 426 if 'Reflect' in attr.ext_attrs:
427 webcore_function_name = self._TypeInfo(attr.type.id).webcore_getter_name() 427 webcore_function_name = self._TypeInfo(attr.type.id).webcore_getter_name()
428 if 'URL' in attr.ext_attrs: 428 if 'URL' in attr.ext_attrs:
429 if 'NonEmpty' in attr.ext_attrs: 429 if 'NonEmpty' in attr.ext_attrs:
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 True, 477 True,
478 function_expression, 478 function_expression,
479 attr, 479 attr,
480 [attr], 480 [attr],
481 'void', 481 'void',
482 attr.set_raises) 482 attr.set_raises)
483 483
484 def AddIndexer(self, element_type): 484 def AddIndexer(self, element_type):
485 """Adds all the methods required to complete implementation of List.""" 485 """Adds all the methods required to complete implementation of List."""
486 # We would like to simply inherit the implementation of everything except 486 # We would like to simply inherit the implementation of everything except
487 # get length(), [], and maybe []=. It is possible to extend from a base 487 # length, [], and maybe []=. It is possible to extend from a base
488 # array implementation class only when there is no other implementation 488 # array implementation class only when there is no other implementation
489 # inheritance. There might be no implementation inheritance other than 489 # inheritance. There might be no implementation inheritance other than
490 # DOMBaseWrapper for many classes, but there might be some where the 490 # DOMBaseWrapper for many classes, but there might be some where the
491 # array-ness is introduced by a non-root interface: 491 # array-ness is introduced by a non-root interface:
492 # 492 #
493 # interface Y extends X, List<T> ... 493 # interface Y extends X, List<T> ...
494 # 494 #
495 # In the non-root case we have to choose between: 495 # In the non-root case we have to choose between:
496 # 496 #
497 # class YImpl extends XImpl { add List<T> methods; } 497 # class YImpl extends XImpl { add List<T> methods; }
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 parent_interface = _FindInHierarchy(database, parent_interface, test) 960 parent_interface = _FindInHierarchy(database, parent_interface, test)
961 if parent_interface: 961 if parent_interface:
962 return parent_interface 962 return parent_interface
963 963
964 def _ToWebKitName(name): 964 def _ToWebKitName(name):
965 name = name[0].lower() + name[1:] 965 name = name[0].lower() + name[1:]
966 name = re.sub(r'^(hTML|uRL|jS|xML|xSLT)', lambda s: s.group(1).lower(), 966 name = re.sub(r'^(hTML|uRL|jS|xML|xSLT)', lambda s: s.group(1).lower(),
967 name) 967 name)
968 return re.sub(r'^(create|exclusive)', lambda s: 'is' + s.group(1).capitalize() , 968 return re.sub(r'^(create|exclusive)', lambda s: 'is' + s.group(1).capitalize() ,
969 name) 969 name)
OLDNEW
« no previous file with comments | « lib/dom/scripts/systemhtml.py ('k') | lib/dom/templates/html/dart2js/html_dart2js.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698