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

Side by Side Diff: Source/bindings/scripts/unstable/v8_interface.py

Issue 110023002: IDL compiler: [InitializedByEventConstructor] attribute any (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years 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 # Copyright (C) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 v8_types.add_includes_for_type(special_wrap_interface) 100 v8_types.add_includes_for_type(special_wrap_interface)
101 101
102 # Constructors 102 # Constructors
103 # [Constructor] 103 # [Constructor]
104 has_constructor = 'Constructor' in extended_attributes 104 has_constructor = 'Constructor' in extended_attributes
105 if has_constructor: 105 if has_constructor:
106 includes.add('bindings/v8/V8ObjectConstructor.h') 106 includes.add('bindings/v8/V8ObjectConstructor.h')
107 107
108 # [EventConstructor] 108 # [EventConstructor]
109 has_event_constructor = 'EventConstructor' in extended_attributes 109 has_event_constructor = 'EventConstructor' in extended_attributes
110 has_any_type_attributes = any(attribute
111 for attribute in interface.attributes
112 if attribute.idl_type == 'any')
110 if has_event_constructor: 113 if has_event_constructor:
111 includes.update(['bindings/v8/Dictionary.h', 114 includes.update(['bindings/v8/Dictionary.h',
112 'bindings/v8/V8ObjectConstructor.h']) 115 'bindings/v8/V8ObjectConstructor.h'])
116 if has_any_type_attributes:
117 includes.add('bindings/v8/SerializedScriptValue.h')
113 118
114 template_contents = { 119 template_contents = {
115 'conditional_string': conditional_string(interface), # [Conditional] 120 'conditional_string': conditional_string(interface), # [Conditional]
116 'constructor_arguments': constructor_arguments(interface), 121 'constructor_arguments': constructor_arguments(interface),
117 'cpp_class': cpp_name(interface), 122 'cpp_class': cpp_name(interface),
118 'generate_visit_dom_wrapper_function': generate_visit_dom_wrapper_functi on, 123 'generate_visit_dom_wrapper_function': generate_visit_dom_wrapper_functi on,
119 'has_constructor': has_constructor, 124 'has_constructor': has_constructor,
120 'has_custom_legacy_call_as_function': has_extended_attribute_value(inter face, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction] 125 'has_custom_legacy_call_as_function': has_extended_attribute_value(inter face, 'Custom', 'LegacyCallAsFunction'), # [Custom=LegacyCallAsFunction]
121 'has_custom_to_v8': has_extended_attribute_value(interface, 'Custom', 'T oV8'), # [Custom=ToV8] 126 'has_custom_to_v8': has_extended_attribute_value(interface, 'Custom', 'T oV8'), # [Custom=ToV8]
122 'has_custom_wrap': has_extended_attribute_value(interface, 'Custom', 'Wr ap'), # [Custom=Wrap] 127 'has_custom_wrap': has_extended_attribute_value(interface, 'Custom', 'Wr ap'), # [Custom=Wrap]
123 'has_event_constructor': has_event_constructor, 128 'has_event_constructor': has_event_constructor,
129 'has_any_type_attributes': has_any_type_attributes,
124 'has_visit_dom_wrapper': ( 130 'has_visit_dom_wrapper': (
125 # [Custom=Wrap], [GenerateVisitDOMWrapper] 131 # [Custom=Wrap], [GenerateVisitDOMWrapper]
126 has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or 132 has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or
127 'GenerateVisitDOMWrapper' in extended_attributes), 133 'GenerateVisitDOMWrapper' in extended_attributes),
128 'header_includes': header_includes, 134 'header_includes': header_includes,
129 'interface_name': interface.name, 135 'interface_name': interface.name,
130 'is_active_dom_object': 'ActiveDOMObject' in extended_attributes, # [Ac tiveDOMObject] 136 'is_active_dom_object': 'ActiveDOMObject' in extended_attributes, # [Ac tiveDOMObject]
131 'is_check_security': is_check_security, 137 'is_check_security': is_check_security,
132 'is_constructor_call_with_document': has_extended_attribute_value( 138 'is_constructor_call_with_document': has_extended_attribute_value(
133 interface, 'ConstructorCallWith', 'Document'), # [ConstructorCallWi th=Document] 139 interface, 'ConstructorCallWith', 'Document'), # [ConstructorCallWi th=Document]
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 if has_extended_attribute_value(interface, 'ConstructorCallWith', 'Execution Context'): 320 if has_extended_attribute_value(interface, 'ConstructorCallWith', 'Execution Context'):
315 arguments.append('context') 321 arguments.append('context')
316 # [ConstructorCallWith=Document] 322 # [ConstructorCallWith=Document]
317 if has_extended_attribute_value(interface, 'ConstructorCallWith', 'Document' ): 323 if has_extended_attribute_value(interface, 'ConstructorCallWith', 'Document' ):
318 arguments.append('document') 324 arguments.append('document')
319 # FIXME: actual arguments! 325 # FIXME: actual arguments!
320 # [RaisesException=Constructor] 326 # [RaisesException=Constructor]
321 if interface.extended_attributes.get('RaisesException') == 'Constructor': 327 if interface.extended_attributes.get('RaisesException') == 'Constructor':
322 arguments.append('exceptionState') 328 arguments.append('exceptionState')
323 return arguments 329 return arguments
OLDNEW
« no previous file with comments | « Source/bindings/scripts/unstable/v8_attributes.py ('k') | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698