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

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

Issue 1832713002: Optimize dartium dart:html bindings so real world application performance is acceptable. Improves d… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: update cached patches Created 4 years, 8 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/generator.py ('k') | tools/dom/scripts/systemhtml.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/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 system to generate 6 """This module provides shared functionality for the system to generate
7 dart:html APIs from the IDL database.""" 7 dart:html APIs from the IDL database."""
8 8
9 import emitter 9 import emitter
10 from generator import AnalyzeOperation, ConstantOutputOrder, \ 10 from generator import AnalyzeOperation, ConstantOutputOrder, \
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 self.DeriveNativeEntry("constructorCallback", 'Constructor', arg ument_count) 619 self.DeriveNativeEntry("constructorCallback", 'Constructor', arg ument_count)
620 qualified_name = \ 620 qualified_name = \
621 self.DeriveQualifiedBlinkName(self._interface.id, 621 self.DeriveQualifiedBlinkName(self._interface.id,
622 base_name) 622 base_name)
623 args = constructor_info.ParametersAsArgumentList(argument_count) 623 args = constructor_info.ParametersAsArgumentList(argument_count)
624 624
625 # Handle converting Maps to Dictionaries, etc. 625 # Handle converting Maps to Dictionaries, etc.
626 (factory_params, converted_arguments) = self._ConvertArgumentTypes( 626 (factory_params, converted_arguments) = self._ConvertArgumentTypes(
627 stmts_emitter, arguments, argument_count, constructor_info) 627 stmts_emitter, arguments, argument_count, constructor_info)
628 args = ', '.join(converted_arguments) 628 args = ', '.join(converted_arguments)
629 call_template = 'wrap_jso($FACTORY_NAME($FACTORY_PARAMS))' 629 call_template = '$FACTORY_NAME($FACTORY_PARAMS)'
630 else: 630 else:
631 qualified_name = emitter.Format( 631 qualified_name = emitter.Format(
632 '$FACTORY.$NAME', 632 '$FACTORY.$NAME',
633 FACTORY=factory_name, 633 FACTORY=factory_name,
634 NAME=name) 634 NAME=name)
635 (factory_params, converted_arguments) = self._ConvertArgumentTypes( 635 (factory_params, converted_arguments) = self._ConvertArgumentTypes(
636 stmts_emitter, arguments, argument_count, constructor_info) 636 stmts_emitter, arguments, argument_count, constructor_info)
637 args = ', '.join(converted_arguments) 637 args = ', '.join(converted_arguments)
638 call_template = '$FACTORY_NAME($FACTORY_PARAMS)' 638 call_template = '$FACTORY_NAME($FACTORY_PARAMS)'
639 call_emitter.Emit(call_template, FACTORY_NAME=qualified_name, FACTORY_PA RAMS=args) 639 call_emitter.Emit(call_template, FACTORY_NAME=qualified_name, FACTORY_PA RAMS=args)
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 def _InputType(self, type_name, info): 888 def _InputType(self, type_name, info):
889 conversion = self._InputConversion(type_name, info.declared_name) 889 conversion = self._InputConversion(type_name, info.declared_name)
890 if conversion: 890 if conversion:
891 return conversion.input_type 891 return conversion.input_type
892 else: 892 else:
893 # If typedef it's a union return dynamic. 893 # If typedef it's a union return dynamic.
894 if self._database.HasTypeDef(type_name): 894 if self._database.HasTypeDef(type_name):
895 return 'dynamic' 895 return 'dynamic'
896 else: 896 else:
897 return self._NarrowInputType(type_name) if type_name else 'dynamic' 897 return self._NarrowInputType(type_name) if type_name else 'dynamic'
OLDNEW
« no previous file with comments | « tools/dom/scripts/generator.py ('k') | tools/dom/scripts/systemhtml.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698