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

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

Issue 2022013002: binding: Makes [SaveSameObject] use V8PrivateProperty. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/templates/attributes.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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 is_implemented_in_private_script = 'ImplementedInPrivateScript' in extended_ attributes 76 is_implemented_in_private_script = 'ImplementedInPrivateScript' in extended_ attributes
77 if is_implemented_in_private_script: 77 if is_implemented_in_private_script:
78 includes.add('bindings/core/v8/PrivateScriptRunner.h') 78 includes.add('bindings/core/v8/PrivateScriptRunner.h')
79 includes.add('core/frame/LocalFrame.h') 79 includes.add('core/frame/LocalFrame.h')
80 includes.add('platform/ScriptForbiddenScope.h') 80 includes.add('platform/ScriptForbiddenScope.h')
81 # [OnlyExposedToPrivateScript] 81 # [OnlyExposedToPrivateScript]
82 is_only_exposed_to_private_script = 'OnlyExposedToPrivateScript' in extended _attributes 82 is_only_exposed_to_private_script = 'OnlyExposedToPrivateScript' in extended _attributes
83 # [PerWorldBindings] 83 # [PerWorldBindings]
84 if 'PerWorldBindings' in extended_attributes: 84 if 'PerWorldBindings' in extended_attributes:
85 assert idl_type.is_wrapper_type or 'LogActivity' in extended_attributes, '[PerWorldBindings] should only be used with wrapper types: %s.%s' % (interface .name, attribute.name) 85 assert idl_type.is_wrapper_type or 'LogActivity' in extended_attributes, '[PerWorldBindings] should only be used with wrapper types: %s.%s' % (interface .name, attribute.name)
86 # [SaveSameObject]
87 is_save_same_object = (
88 'SameObject' in attribute.extended_attributes and
89 'SaveSameObject' in attribute.extended_attributes)
90 if is_save_same_object:
91 includes.add('bindings/core/v8/V8PrivateProperty.h')
86 92
87 if (base_idl_type == 'EventHandler' and 93 if (base_idl_type == 'EventHandler' and
88 interface.name in ['Window', 'WorkerGlobalScope'] and 94 interface.name in ['Window', 'WorkerGlobalScope'] and
89 attribute.name == 'onerror'): 95 attribute.name == 'onerror'):
90 includes.add('bindings/core/v8/V8ErrorHandler.h') 96 includes.add('bindings/core/v8/V8ErrorHandler.h')
91 97
92 cached_attribute_validation_method = extended_attributes.get('CachedAttribut e') 98 cached_attribute_validation_method = extended_attributes.get('CachedAttribut e')
93 keep_alive_for_gc = is_keep_alive_for_gc(interface, attribute) 99 keep_alive_for_gc = is_keep_alive_for_gc(interface, attribute)
94 if cached_attribute_validation_method or keep_alive_for_gc: 100 if cached_attribute_validation_method or keep_alive_for_gc:
95 includes.add('bindings/core/v8/V8HiddenValue.h') 101 includes.add('bindings/core/v8/V8HiddenValue.h')
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 'is_lenient_this': 'LenientThis' in extended_attributes, 134 'is_lenient_this': 'LenientThis' in extended_attributes,
129 'is_nullable': idl_type.is_nullable, 135 'is_nullable': idl_type.is_nullable,
130 'is_explicit_nullable': idl_type.is_explicit_nullable, 136 'is_explicit_nullable': idl_type.is_explicit_nullable,
131 'is_partial_interface_member': 137 'is_partial_interface_member':
132 'PartialInterfaceImplementedAs' in extended_attributes, 138 'PartialInterfaceImplementedAs' in extended_attributes,
133 'is_per_world_bindings': 'PerWorldBindings' in extended_attributes, 139 'is_per_world_bindings': 'PerWorldBindings' in extended_attributes,
134 'is_put_forwards': 'PutForwards' in extended_attributes, 140 'is_put_forwards': 'PutForwards' in extended_attributes,
135 'is_read_only': attribute.is_read_only, 141 'is_read_only': attribute.is_read_only,
136 'is_reflect': is_reflect, 142 'is_reflect': is_reflect,
137 'is_replaceable': 'Replaceable' in attribute.extended_attributes, 143 'is_replaceable': 'Replaceable' in attribute.extended_attributes,
138 'is_save_same_object': ( 144 'is_save_same_object': is_save_same_object,
139 'SameObject' in attribute.extended_attributes and
140 'SaveSameObject' in attribute.extended_attributes),
141 'is_static': attribute.is_static, 145 'is_static': attribute.is_static,
142 'is_url': 'URL' in extended_attributes, 146 'is_url': 'URL' in extended_attributes,
143 'is_unforgeable': is_unforgeable(interface, attribute), 147 'is_unforgeable': is_unforgeable(interface, attribute),
144 'on_instance': v8_utilities.on_instance(interface, attribute), 148 'on_instance': v8_utilities.on_instance(interface, attribute),
145 'on_interface': v8_utilities.on_interface(interface, attribute), 149 'on_interface': v8_utilities.on_interface(interface, attribute),
146 'on_prototype': v8_utilities.on_prototype(interface, attribute), 150 'on_prototype': v8_utilities.on_prototype(interface, attribute),
147 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_funct ion_name(attribute), # [OriginTrialEnabled] 151 'origin_trial_enabled_function': v8_utilities.origin_trial_enabled_funct ion_name(attribute), # [OriginTrialEnabled]
148 'use_output_parameter_for_result': idl_type.use_output_parameter_for_res ult, 152 'use_output_parameter_for_result': idl_type.use_output_parameter_for_res ult,
149 'measure_as': v8_utilities.measure_as(attribute, interface), # [Measure As] 153 'measure_as': v8_utilities.measure_as(attribute, interface), # [Measure As]
150 'name': attribute.name, 154 'name': attribute.name,
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 lambda self: strip_suffix(self.base_type, 'Constructor')) 550 lambda self: strip_suffix(self.base_type, 'Constructor'))
547 551
548 552
549 def is_constructor_attribute(attribute): 553 def is_constructor_attribute(attribute):
550 # FIXME: replace this with [ConstructorAttribute] extended attribute 554 # FIXME: replace this with [ConstructorAttribute] extended attribute
551 return attribute.idl_type.name.endswith('Constructor') 555 return attribute.idl_type.name.endswith('Constructor')
552 556
553 557
554 def update_constructor_attribute_context(interface, attribute, context): 558 def update_constructor_attribute_context(interface, attribute, context):
555 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] or context['origin_trial_enabled_function'] # TODO(chasej): Should/can this be true when OriginTrialEnabled is inherited from containing in terface? 559 context['needs_constructor_getter_callback'] = context['measure_as'] or cont ext['deprecate_as'] or context['origin_trial_enabled_function'] # TODO(chasej): Should/can this be true when OriginTrialEnabled is inherited from containing in terface?
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/templates/attributes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698