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

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

Issue 24479002: Revert "Start of dartium custom element lifecycle event support." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « tools/dom/idl/dart/dart.idl ('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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 arguments, 730 arguments,
731 return_type, 731 return_type,
732 return_type_is_nullable, 732 return_type_is_nullable,
733 raises_dom_exception): 733 raises_dom_exception):
734 734
735 ext_attrs = node.ext_attrs 735 ext_attrs = node.ext_attrs
736 736
737 cpp_arguments = [] 737 cpp_arguments = []
738 runtime_check = None 738 runtime_check = None
739 raises_exceptions = raises_dom_exception or arguments 739 raises_exceptions = raises_dom_exception or arguments
740 needs_custom_element_callbacks = False
741 740
742 # TODO(antonm): unify with ScriptState below. 741 # TODO(antonm): unify with ScriptState below.
743 requires_stack_info = (ext_attrs.get('CallWith') == 'ScriptArguments|ScriptS tate' or 742 requires_stack_info = (ext_attrs.get('CallWith') == 'ScriptArguments|ScriptS tate' or
744 ext_attrs.get('ConstructorCallWith') == 'ScriptArgume nts|ScriptState' or 743 ext_attrs.get('ConstructorCallWith') == 'ScriptArgume nts|ScriptState' or
745 ext_attrs.get('CallWith') == 'ScriptArguments&ScriptS tate' or 744 ext_attrs.get('CallWith') == 'ScriptArguments&ScriptS tate' or
746 ext_attrs.get('ConstructorCallWith') == 'ScriptArgume nts&ScriptState') 745 ext_attrs.get('ConstructorCallWith') == 'ScriptArgume nts&ScriptState')
747 if requires_stack_info: 746 if requires_stack_info:
748 raises_exceptions = True 747 raises_exceptions = True
749 cpp_arguments = ['&state', 'scriptArguments.release()'] 748 cpp_arguments = ['&state', 'scriptArguments.release()']
750 # WebKit uses scriptArguments to reconstruct last argument, so 749 # WebKit uses scriptArguments to reconstruct last argument, so
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 cpp_arguments = ['document'] 781 cpp_arguments = ['document']
783 782
784 if 'ImplementedBy' in ext_attrs: 783 if 'ImplementedBy' in ext_attrs:
785 assert needs_receiver 784 assert needs_receiver
786 self._cpp_impl_includes.add('"%s.h"' % ext_attrs['ImplementedBy']) 785 self._cpp_impl_includes.add('"%s.h"' % ext_attrs['ImplementedBy'])
787 cpp_arguments.append('receiver') 786 cpp_arguments.append('receiver')
788 787
789 if 'Reflect' in ext_attrs: 788 if 'Reflect' in ext_attrs:
790 cpp_arguments = [self._GenerateWebCoreReflectionAttributeName(node)] 789 cpp_arguments = [self._GenerateWebCoreReflectionAttributeName(node)]
791 790
792 if ext_attrs.get('CustomElementCallbacks') == 'Enable':
793 self._cpp_impl_includes.add('"core/dom/CustomElementCallbackDispatcher.h"' )
794 needs_custom_element_callbacks = True
795
796 if return_type_is_nullable: 791 if return_type_is_nullable:
797 cpp_arguments = ['isNull'] 792 cpp_arguments = ['isNull']
798 793
799 v8EnabledPerContext = ext_attrs.get('synthesizedV8EnabledPerContext', ext_at trs.get('V8EnabledPerContext')) 794 v8EnabledPerContext = ext_attrs.get('synthesizedV8EnabledPerContext', ext_at trs.get('V8EnabledPerContext'))
800 v8EnabledAtRuntime = ext_attrs.get('synthesizedV8EnabledAtRuntime', ext_attr s.get('V8EnabledAtRuntime')) 795 v8EnabledAtRuntime = ext_attrs.get('synthesizedV8EnabledAtRuntime', ext_attr s.get('V8EnabledAtRuntime'))
801 assert(not (v8EnabledPerContext and v8EnabledAtRuntime)) 796 assert(not (v8EnabledPerContext and v8EnabledAtRuntime))
802 797
803 if v8EnabledPerContext: 798 if v8EnabledPerContext:
804 raises_exceptions = True 799 raises_exceptions = True
805 self._cpp_impl_includes.add('"ContextFeatures.h"') 800 self._cpp_impl_includes.add('"ContextFeatures.h"')
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 '\n' 903 '\n'
909 ' Dart_Handle customArgument = Dart_GetNativeArgument(args, $IN DEX);\n' 904 ' Dart_Handle customArgument = Dart_GetNativeArgument(args, $IN DEX);\n'
910 ' RefPtr<ScriptArguments> scriptArguments(DartUtilities::create ScriptArguments(customArgument, exception));\n' 905 ' RefPtr<ScriptArguments> scriptArguments(DartUtilities::create ScriptArguments(customArgument, exception));\n'
911 ' if (!scriptArguments)\n' 906 ' if (!scriptArguments)\n'
912 ' goto fail;\n' 907 ' goto fail;\n'
913 ' RefPtr<ScriptCallStack> scriptCallStack(DartUtilities::create ScriptCallStack());\n' 908 ' RefPtr<ScriptCallStack> scriptCallStack(DartUtilities::create ScriptCallStack());\n'
914 ' if (!scriptCallStack->size())\n' 909 ' if (!scriptCallStack->size())\n'
915 ' return;\n', 910 ' return;\n',
916 INDEX=len(arguments) + 1) 911 INDEX=len(arguments) + 1)
917 912
918 if needs_custom_element_callbacks:
919 body_emitter.Emit(' CustomElementCallbackDispatcher::CallbackDelive ryScope deliveryScope;\n');
920
921 # Emit arguments. 913 # Emit arguments.
922 start_index = 1 if needs_receiver else 0 914 start_index = 1 if needs_receiver else 0
923 for i, argument in enumerate(arguments): 915 for i, argument in enumerate(arguments):
924 type_info = self._TypeInfo(argument.type.id) 916 type_info = self._TypeInfo(argument.type.id)
925 self._cpp_impl_includes |= set(type_info.conversion_includes()) 917 self._cpp_impl_includes |= set(type_info.conversion_includes())
926 argument_expression_template, type, cls, function = \ 918 argument_expression_template, type, cls, function = \
927 type_info.to_native_info(argument, self._interface.id) 919 type_info.to_native_info(argument, self._interface.id)
928 920
929 def AllowsNull(): 921 def AllowsNull():
930 # TODO(vsm): HTMLSelectElement's indexed setter treats a null as a remov e. 922 # TODO(vsm): HTMLSelectElement's indexed setter treats a null as a remov e.
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu mentCount))\n' 1171 ' if (Dart_NativeFunction func = $CLASS_NAME::resolver(name, argu mentCount))\n'
1180 ' return func;\n', 1172 ' return func;\n',
1181 CLASS_NAME=os.path.splitext(os.path.basename(path))[0]) 1173 CLASS_NAME=os.path.splitext(os.path.basename(path))[0])
1182 1174
1183 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument): 1175 def _IsOptionalStringArgumentInInitEventMethod(interface, operation, argument):
1184 return ( 1176 return (
1185 interface.id.endswith('Event') and 1177 interface.id.endswith('Event') and
1186 operation.id.startswith('init') and 1178 operation.id.startswith('init') and
1187 argument.ext_attrs.get('Default') == 'Undefined' and 1179 argument.ext_attrs.get('Default') == 'Undefined' and
1188 argument.type.id == 'DOMString') 1180 argument.type.id == 'DOMString')
OLDNEW
« no previous file with comments | « tools/dom/idl/dart/dart.idl ('k') | tools/dom/src/native_DOMImplementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698