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

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

Issue 1392723003: Switch dart:html objects not to be NativeFieldWrapper subclasses with JsInterop (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « tools/dom/scripts/systemhtml.py ('k') | tools/dom/src/native_DOMImplementation.dart » ('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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 template = None 509 template = None
510 interface_name = self._interface.doc_js_name 510 interface_name = self._interface.doc_js_name
511 if interface_name == self._interface.id or not self._database.HasInterface(i nterface_name): 511 if interface_name == self._interface.id or not self._database.HasInterface(i nterface_name):
512 template_file = 'impl_%s.darttemplate' % interface_name 512 template_file = 'impl_%s.darttemplate' % interface_name
513 template = self._template_loader.TryLoad(template_file) 513 template = self._template_loader.TryLoad(template_file)
514 if not template: 514 if not template:
515 template = self._template_loader.Load('dart_implementation.darttemplate') 515 template = self._template_loader.Load('dart_implementation.darttemplate')
516 return template 516 return template
517 517
518 def RootClassName(self): 518 def RootClassName(self):
519 return 'NativeFieldWrapperClass2' 519 return 'DartHtmlDomObject'
520 520
521 # This code matches up with the _generate_native_entry code in 521 # This code matches up with the _generate_native_entry code in
522 # dart_utilities.py in the dartium repository. Any changes to this 522 # dart_utilities.py in the dartium repository. Any changes to this
523 # should have matching changes on that end. 523 # should have matching changes on that end.
524 def DeriveNativeEntry(self, name, kind, count): 524 def DeriveNativeEntry(self, name, kind, count):
525 interface_id = self._interface.id 525 interface_id = self._interface.id
526 database = self._database 526 database = self._database
527 tag = "" 527 tag = ""
528 if kind == 'Getter': 528 if kind == 'Getter':
529 tag = "%s_Getter" % name 529 tag = "%s_Getter" % name
(...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 2034
2035 def _IsCustom(op_or_attr): 2035 def _IsCustom(op_or_attr):
2036 assert(isinstance(op_or_attr, IDLMember)) 2036 assert(isinstance(op_or_attr, IDLMember))
2037 return 'Custom' in op_or_attr.ext_attrs or 'DartCustom' in op_or_attr.ext_attr s 2037 return 'Custom' in op_or_attr.ext_attrs or 'DartCustom' in op_or_attr.ext_attr s
2038 2038
2039 def _IsCustomValue(op_or_attr, value): 2039 def _IsCustomValue(op_or_attr, value):
2040 if _IsCustom(op_or_attr): 2040 if _IsCustom(op_or_attr):
2041 return op_or_attr.ext_attrs.get('Custom') == value \ 2041 return op_or_attr.ext_attrs.get('Custom') == value \
2042 or op_or_attr.ext_attrs.get('DartCustom') == value 2042 or op_or_attr.ext_attrs.get('DartCustom') == value
2043 return False 2043 return False
OLDNEW
« no previous file with comments | « tools/dom/scripts/systemhtml.py ('k') | tools/dom/src/native_DOMImplementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698