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

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

Issue 131183002: IDL compiler: AudioBuffer interfaces (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revised Created 6 years, 11 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 | « no previous file | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 def generate_interface(interface): 63 def generate_interface(interface):
64 includes.clear() 64 includes.clear()
65 includes.update(INTERFACE_CPP_INCLUDES) 65 includes.update(INTERFACE_CPP_INCLUDES)
66 header_includes = INTERFACE_H_INCLUDES 66 header_includes = INTERFACE_H_INCLUDES
67 67
68 parent_interface = interface.parent 68 parent_interface = interface.parent
69 if parent_interface: 69 if parent_interface:
70 header_includes.update(v8_types.includes_for_type(parent_interface)) 70 header_includes.update(v8_types.includes_for_type(parent_interface))
71 extended_attributes = interface.extended_attributes 71 extended_attributes = interface.extended_attributes
72 72
73 is_audio_buffer = inherits_interface(interface.name, 'AudioBuffer')
74 if is_audio_buffer:
75 includes.add('modules/webaudio/AudioBuffer.h')
76
73 is_document = inherits_interface(interface.name, 'Document') 77 is_document = inherits_interface(interface.name, 'Document')
74 if is_document: 78 if is_document:
75 includes.update(['bindings/v8/ScriptController.h', 79 includes.update(['bindings/v8/ScriptController.h',
76 'bindings/v8/V8WindowShell.h', 80 'bindings/v8/V8WindowShell.h',
77 'core/frame/Frame.h']) 81 'core/frame/Frame.h'])
78 82
79 # [CheckSecurity] 83 # [CheckSecurity]
80 is_check_security = 'CheckSecurity' in extended_attributes 84 is_check_security = 'CheckSecurity' in extended_attributes
81 if is_check_security: 85 if is_check_security:
82 includes.add('bindings/v8/BindingSecurity.h') 86 includes.add('bindings/v8/BindingSecurity.h')
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 'has_event_constructor': has_event_constructor, 156 'has_event_constructor': has_event_constructor,
153 'has_visit_dom_wrapper': ( 157 'has_visit_dom_wrapper': (
154 # [Custom=Wrap], [GenerateVisitDOMWrapper] 158 # [Custom=Wrap], [GenerateVisitDOMWrapper]
155 has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or 159 has_extended_attribute_value(interface, 'Custom', 'VisitDOMWrapper') or
156 reachable_node_function or set_reference_list), 160 reachable_node_function or set_reference_list),
157 'header_includes': header_includes, 161 'header_includes': header_includes,
158 'interface_length': 162 'interface_length':
159 interface_length(interface, constructors + custom_constructors), 163 interface_length(interface, constructors + custom_constructors),
160 'interface_name': interface.name, 164 'interface_name': interface.name,
161 'is_active_dom_object': 'ActiveDOMObject' in extended_attributes, # [Ac tiveDOMObject] 165 'is_active_dom_object': 'ActiveDOMObject' in extended_attributes, # [Ac tiveDOMObject]
166 'is_audio_buffer': is_audio_buffer,
162 'is_check_security': is_check_security, 167 'is_check_security': is_check_security,
163 'is_constructor_call_with_document': has_extended_attribute_value( 168 'is_constructor_call_with_document': has_extended_attribute_value(
164 interface, 'ConstructorCallWith', 'Document'), # [ConstructorCallWi th=Document] 169 interface, 'ConstructorCallWith', 'Document'), # [ConstructorCallWi th=Document]
165 'is_constructor_call_with_execution_context': has_extended_attribute_val ue( 170 'is_constructor_call_with_execution_context': has_extended_attribute_val ue(
166 interface, 'ConstructorCallWith', 'ExecutionContext'), # [Construct orCallWith=ExeuctionContext] 171 interface, 'ConstructorCallWith', 'ExecutionContext'), # [Construct orCallWith=ExeuctionContext]
167 'is_constructor_raises_exception': extended_attributes.get('RaisesExcept ion') == 'Constructor', # [RaisesException=Constructor] 172 'is_constructor_raises_exception': extended_attributes.get('RaisesExcept ion') == 'Constructor', # [RaisesException=Constructor]
168 'is_dependent_lifetime': 'DependentLifetime' in extended_attributes, # [DependentLifetime] 173 'is_dependent_lifetime': 'DependentLifetime' in extended_attributes, # [DependentLifetime]
169 'is_document': is_document, 174 'is_document': is_document,
170 'is_event_target': inherits_interface(interface.name, 'EventTarget'), 175 'is_event_target': inherits_interface(interface.name, 'EventTarget'),
171 'is_exception': interface.is_exception, 176 'is_exception': interface.is_exception,
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 436
432 437
433 def interface_length(interface, constructors): 438 def interface_length(interface, constructors):
434 # Docs: http://heycam.github.io/webidl/#es-interface-call 439 # Docs: http://heycam.github.io/webidl/#es-interface-call
435 if 'EventConstructor' in interface.extended_attributes: 440 if 'EventConstructor' in interface.extended_attributes:
436 return 1 441 return 1
437 if not constructors: 442 if not constructors:
438 return 0 443 return 0
439 return min(constructor['number_of_required_arguments'] 444 return min(constructor['number_of_required_arguments']
440 for constructor in constructors) 445 for constructor in constructors)
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698