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

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

Issue 2029423002: Clean up V8 bindings template code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 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
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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 'name': attribute.name, 149 'name': attribute.name,
150 'only_exposed_to_private_script': is_only_exposed_to_private_script, 150 'only_exposed_to_private_script': is_only_exposed_to_private_script,
151 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local _cpp_value( 151 'private_script_v8_value_to_local_cpp_value': idl_type.v8_value_to_local _cpp_value(
152 extended_attributes, 'v8Value', 'cppValue', bailout_return_value='fa lse', isolate='scriptState->isolate()'), 152 extended_attributes, 'v8Value', 'cppValue', bailout_return_value='fa lse', isolate='scriptState->isolate()'),
153 'property_attributes': property_attributes(interface, attribute), 153 'property_attributes': property_attributes(interface, attribute),
154 'reflect_empty': extended_attributes.get('ReflectEmpty'), 154 'reflect_empty': extended_attributes.get('ReflectEmpty'),
155 'reflect_invalid': extended_attributes.get('ReflectInvalid', ''), 155 'reflect_invalid': extended_attributes.get('ReflectInvalid', ''),
156 'reflect_missing': extended_attributes.get('ReflectMissing'), 156 'reflect_missing': extended_attributes.get('ReflectMissing'),
157 'reflect_only': extended_attribute_value_as_list(attribute, 'ReflectOnly '), 157 'reflect_only': extended_attribute_value_as_list(attribute, 'ReflectOnly '),
158 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(a ttribute), # [RuntimeEnabled] 158 'runtime_enabled_function': v8_utilities.runtime_enabled_function_name(a ttribute), # [RuntimeEnabled]
159 'runtime_feature_name': v8_utilities.runtime_feature_name(attribute), # [RuntimeEnabled]
159 'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script), 160 'should_be_exposed_to_script': not (is_implemented_in_private_script and is_only_exposed_to_private_script),
160 'world_suffixes': ( 161 'world_suffixes': (
161 ['', 'ForMainWorld'] 162 ['', 'ForMainWorld']
162 if 'PerWorldBindings' in extended_attributes 163 if 'PerWorldBindings' in extended_attributes
163 else ['']), # [PerWorldBindings] 164 else ['']), # [PerWorldBindings]
164 } 165 }
165 166
166 if is_constructor_attribute(attribute): 167 if is_constructor_attribute(attribute):
167 update_constructor_attribute_context(interface, attribute, context) 168 update_constructor_attribute_context(interface, attribute, context)
168 if not has_custom_getter(attribute): 169 if not has_custom_getter(attribute):
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 lambda self: strip_suffix(self.base_type, 'Constructor')) 561 lambda self: strip_suffix(self.base_type, 'Constructor'))
561 562
562 563
563 def is_constructor_attribute(attribute): 564 def is_constructor_attribute(attribute):
564 # FIXME: replace this with [ConstructorAttribute] extended attribute 565 # FIXME: replace this with [ConstructorAttribute] extended attribute
565 return attribute.idl_type.name.endswith('Constructor') 566 return attribute.idl_type.name.endswith('Constructor')
566 567
567 568
568 def update_constructor_attribute_context(interface, attribute, context): 569 def update_constructor_attribute_context(interface, attribute, context):
569 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] 570 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as']
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698