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

Side by Side Diff: Source/bindings/scripts/v8_attributes.py

Issue 338893004: Extend ScalarValueString handling to include constructors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Tweaks Created 6 years, 6 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 | « Source/bindings/scripts/idl_types.py ('k') | Source/bindings/scripts/v8_interface.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 # 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 'cpp_name': cpp_name(attribute), 102 'cpp_name': cpp_name(attribute),
103 'cpp_type': idl_type.cpp_type, 103 'cpp_type': idl_type.cpp_type,
104 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(cpp_value='origi nal', creation_context='info.Holder()'), 104 'cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(cpp_value='origi nal', creation_context='info.Holder()'),
105 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs] 105 'deprecate_as': v8_utilities.deprecate_as(attribute), # [DeprecateAs]
106 'enum_validation_expression': idl_type.enum_validation_expression, 106 'enum_validation_expression': idl_type.enum_validation_expression,
107 'has_custom_getter': has_custom_getter, 107 'has_custom_getter': has_custom_getter,
108 'has_custom_setter': has_custom_setter, 108 'has_custom_setter': has_custom_setter,
109 'has_setter_exception_state': 109 'has_setter_exception_state':
110 is_setter_raises_exception or has_type_checking_interface or 110 is_setter_raises_exception or has_type_checking_interface or
111 has_type_checking_nullable or has_type_checking_unrestricted or 111 has_type_checking_nullable or has_type_checking_unrestricted or
112 idl_type.is_integer_type or 112 idl_type.may_raise_exception_on_conversion,
113 idl_type.name in ('ByteString', 'ScalarValueString'),
114 'has_type_checking_interface': has_type_checking_interface, 113 'has_type_checking_interface': has_type_checking_interface,
115 'has_type_checking_nullable': has_type_checking_nullable, 114 'has_type_checking_nullable': has_type_checking_nullable,
116 'has_type_checking_unrestricted': has_type_checking_unrestricted, 115 'has_type_checking_unrestricted': has_type_checking_unrestricted,
117 'idl_type': str(idl_type), # need trailing [] on array for Dictionary:: ConversionContext::setConversionType 116 'idl_type': str(idl_type), # need trailing [] on array for Dictionary:: ConversionContext::setConversionType
118 'is_call_with_execution_context': v8_utilities.has_extended_attribute_va lue(attribute, 'CallWith', 'ExecutionContext'), 117 'is_call_with_execution_context': v8_utilities.has_extended_attribute_va lue(attribute, 'CallWith', 'ExecutionContext'),
119 'is_call_with_script_state': v8_utilities.has_extended_attribute_value(a ttribute, 'CallWith', 'ScriptState'), 118 'is_call_with_script_state': v8_utilities.has_extended_attribute_value(a ttribute, 'CallWith', 'ScriptState'),
120 'is_check_security_for_node': is_check_security_for_node, 119 'is_check_security_for_node': is_check_security_for_node,
121 'is_custom_element_callbacks': is_custom_element_callbacks, 120 'is_custom_element_callbacks': is_custom_element_callbacks,
122 'is_expose_js_accessors': 'ExposeJSAccessors' in extended_attributes, 121 'is_expose_js_accessors': 'ExposeJSAccessors' in extended_attributes,
123 'is_getter_raises_exception': # [RaisesException] 122 'is_getter_raises_exception': # [RaisesException]
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 lambda self: strip_suffix(self.base_type, 'Constructor')) 426 lambda self: strip_suffix(self.base_type, 'Constructor'))
428 427
429 428
430 def is_constructor_attribute(attribute): 429 def is_constructor_attribute(attribute):
431 # FIXME: replace this with [ConstructorAttribute] extended attribute 430 # FIXME: replace this with [ConstructorAttribute] extended attribute
432 return attribute.idl_type.base_type.endswith('Constructor') 431 return attribute.idl_type.base_type.endswith('Constructor')
433 432
434 433
435 def generate_constructor_getter(interface, attribute, contents): 434 def generate_constructor_getter(interface, attribute, contents):
436 contents['needs_constructor_getter_callback'] = contents['measure_as'] or co ntents['deprecate_as'] 435 contents['needs_constructor_getter_callback'] = contents['measure_as'] or co ntents['deprecate_as']
OLDNEW
« no previous file with comments | « Source/bindings/scripts/idl_types.py ('k') | Source/bindings/scripts/v8_interface.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698