OLD | NEW |
1 {##############################################################################} | 1 {##############################################################################} |
2 {% macro attribute_getter(attribute, world_suffix) %} | 2 {% macro attribute_getter(attribute, world_suffix) %} |
3 {% filter conditional(attribute.conditional_string) %} | 3 {% filter conditional(attribute.conditional_string) %} |
4 static void {{attribute.name}}AttributeGetter{{world_suffix}}( | 4 static void {{attribute.name}}AttributeGetter{{world_suffix}}( |
5 {%- if attribute.is_expose_js_accessors %} | 5 {%- if attribute.is_expose_js_accessors %} |
6 const v8::FunctionCallbackInfo<v8::Value>& info | 6 const v8::FunctionCallbackInfo<v8::Value>& info |
7 {%- else %} | 7 {%- else %} |
8 const v8::PropertyCallbackInfo<v8::Value>& info | 8 const v8::PropertyCallbackInfo<v8::Value>& info |
9 {%- endif %}) | 9 {%- endif %}) |
10 { | 10 { |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 {% if attribute.activity_logging_world_check %} | 158 {% if attribute.activity_logging_world_check %} |
159 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) | 159 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) |
160 {% else %} | 160 {% else %} |
161 if (contextData && contextData->activityLogger()) | 161 if (contextData && contextData->activityLogger()) |
162 {% endif %} | 162 {% endif %} |
163 contextData->activityLogger()->logGetter("{{interface_name}}.{{attribute
.name}}"); | 163 contextData->activityLogger()->logGetter("{{interface_name}}.{{attribute
.name}}"); |
164 {% endif %} | 164 {% endif %} |
165 {% if attribute.has_custom_getter %} | 165 {% if attribute.has_custom_getter %} |
166 {{v8_class}}::{{attribute.name}}AttributeGetterCustom(info); | 166 {{v8_class}}::{{attribute.name}}AttributeGetterCustom(info); |
167 {% else %} | 167 {% else %} |
168 {{cpp_class}}V8Internal::{{attribute.name}}AttributeGetter{{world_suffix}}(i
nfo); | 168 {{cpp_class_or_partial}}V8Internal::{{attribute.name}}AttributeGetter{{world
_suffix}}(info); |
169 {% endif %} | 169 {% endif %} |
170 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 170 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
171 } | 171 } |
172 {% endfilter %} | 172 {% endfilter %} |
173 {% endmacro %} | 173 {% endmacro %} |
174 | 174 |
175 | 175 |
176 {##############################################################################} | 176 {##############################################################################} |
177 {% macro constructor_getter_callback(attribute, world_suffix) %} | 177 {% macro constructor_getter_callback(attribute, world_suffix) %} |
178 {% filter conditional(attribute.conditional_string) %} | 178 {% filter conditional(attribute.conditional_string) %} |
179 static void {{attribute.name}}ConstructorGetterCallback{{world_suffix}}(v8::Loca
l<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info) | 179 static void {{attribute.name}}ConstructorGetterCallback{{world_suffix}}(v8::Loca
l<v8::String> property, const v8::PropertyCallbackInfo<v8::Value>& info) |
180 { | 180 { |
181 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 181 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
182 {% if attribute.deprecate_as %} | 182 {% if attribute.deprecate_as %} |
183 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe
cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); | 183 UseCounter::countDeprecationIfNotPrivateScript(info.GetIsolate(), callingExe
cutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); |
184 {% endif %} | 184 {% endif %} |
185 {% if attribute.measure_as %} | 185 {% if attribute.measure_as %} |
186 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte
xt(info.GetIsolate()), UseCounter::{{attribute.measure_as}}); | 186 UseCounter::countIfNotPrivateScript(info.GetIsolate(), callingExecutionConte
xt(info.GetIsolate()), UseCounter::{{attribute.measure_as}}); |
187 {% endif %} | 187 {% endif %} |
188 {{cpp_class}}V8Internal::{{cpp_class}}ConstructorGetter{{world_suffix}}(prop
erty, info); | 188 {{cpp_class_or_partial}}V8Internal::{{cpp_class}}ConstructorGetter{{world_su
ffix}}(property, info); |
189 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 189 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
190 } | 190 } |
191 {% endfilter %} | 191 {% endfilter %} |
192 {% endmacro %} | 192 {% endmacro %} |
193 | 193 |
194 | 194 |
195 {##############################################################################} | 195 {##############################################################################} |
196 {% macro attribute_setter(attribute, world_suffix) %} | 196 {% macro attribute_setter(attribute, world_suffix) %} |
197 {% filter conditional(attribute.conditional_string) %} | 197 {% filter conditional(attribute.conditional_string) %} |
198 static void {{attribute.name}}AttributeSetter{{world_suffix}}( | 198 static void {{attribute.name}}AttributeSetter{{world_suffix}}( |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 {% endif %} | 315 {% endif %} |
316 contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute
.name}}", v8Value); | 316 contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute
.name}}", v8Value); |
317 } | 317 } |
318 {% endif %} | 318 {% endif %} |
319 {% if attribute.is_custom_element_callbacks or attribute.is_reflect %} | 319 {% if attribute.is_custom_element_callbacks or attribute.is_reflect %} |
320 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; | 320 CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; |
321 {% endif %} | 321 {% endif %} |
322 {% if attribute.has_custom_setter %} | 322 {% if attribute.has_custom_setter %} |
323 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info); | 323 {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info); |
324 {% else %} | 324 {% else %} |
325 {{cpp_class}}V8Internal::{{attribute.name}}AttributeSetter{{world_suffix}}(v
8Value, info); | 325 {{cpp_class_or_partial}}V8Internal::{{attribute.name}}AttributeSetter{{world
_suffix}}(v8Value, info); |
326 {% endif %} | 326 {% endif %} |
327 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 327 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
328 } | 328 } |
329 {% endfilter %} | 329 {% endfilter %} |
330 {% endmacro %} | 330 {% endmacro %} |
331 | 331 |
332 | 332 |
333 {##############################################################################} | 333 {##############################################################################} |
334 {% macro attribute_getter_implemented_in_private_script(attribute) %} | 334 {% macro attribute_getter_implemented_in_private_script(attribute) %} |
335 bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeGetter(LocalFrame*
frame, {{cpp_class}}* holderImpl, {{attribute.cpp_type}}* result) | 335 bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeGetter(LocalFrame*
frame, {{cpp_class}}* holderImpl, {{attribute.cpp_type}}* result) |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 ExceptionState exceptionState(ExceptionState::SetterContext, "{{attribute.na
me}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate()
); | 382 ExceptionState exceptionState(ExceptionState::SetterContext, "{{attribute.na
me}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate()
); |
383 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "{{cpp_class}}", "{{attribute.name}}", holder, {{attribute.private_s
cript_cpp_value_to_v8_value}}); | 383 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "{{cpp_class}}", "{{attribute.name}}", holder, {{attribute.private_s
cript_cpp_value_to_v8_value}}); |
384 } | 384 } |
385 {% endmacro %} | 385 {% endmacro %} |
386 | 386 |
387 | 387 |
388 {##############################################################################} | 388 {##############################################################################} |
389 {% macro attribute_configuration(attribute) %} | 389 {% macro attribute_configuration(attribute) %} |
390 {% set getter_callback = | 390 {% set getter_callback = |
391 '%sV8Internal::%sAttributeGetterCallback' % | 391 '%sV8Internal::%sAttributeGetterCallback' % |
392 (cpp_class, attribute.name) | 392 (cpp_class_or_partial, attribute.name) |
393 if not attribute.constructor_type else | 393 if not attribute.constructor_type else |
394 ('%sV8Internal::%sConstructorGetterCallback' % | 394 ('%sV8Internal::%sConstructorGetterCallback' % |
395 (cpp_class, attribute.name) | 395 (cpp_class_or_partial, attribute.name) |
396 if attribute.needs_constructor_getter_callback else | 396 if attribute.needs_constructor_getter_callback else |
397 '{0}V8Internal::{0}ConstructorGetter'.format(cpp_class)) %} | 397 '%sV8Internal::%sConstructorGetter' % (cpp_class_or_partial, cpp_class))
%} |
398 {% set getter_callback_for_main_world = | 398 {% set getter_callback_for_main_world = |
399 '%sV8Internal::%sAttributeGetterCallbackForMainWorld' % | 399 '%sV8Internal::%sAttributeGetterCallbackForMainWorld' % |
400 (cpp_class, attribute.name) | 400 (cpp_class_or_partial, attribute.name) |
401 if attribute.is_per_world_bindings else '0' %} | 401 if attribute.is_per_world_bindings else '0' %} |
402 {% set setter_callback = attribute.setter_callback %} | 402 {% set setter_callback = attribute.setter_callback %} |
403 {% set setter_callback_for_main_world = | 403 {% set setter_callback_for_main_world = |
404 '%sV8Internal::%sAttributeSetterCallbackForMainWorld' % | 404 '%sV8Internal::%sAttributeSetterCallbackForMainWorld' % |
405 (cpp_class, attribute.name) | 405 (cpp_class_or_partial, attribute.name) |
406 if attribute.is_per_world_bindings and | 406 if attribute.is_per_world_bindings and |
407 (not attribute.is_read_only or attribute.put_forwards) else '0' %} | 407 (not attribute.is_read_only or attribute.put_forwards) else '0' %} |
408 {% set wrapper_type_info = | 408 {% set wrapper_type_info = |
409 'const_cast<WrapperTypeInfo*>(&V8%s::wrapperTypeInfo)' % | 409 'const_cast<WrapperTypeInfo*>(&V8%s::wrapperTypeInfo)' % |
410 attribute.constructor_type | 410 attribute.constructor_type |
411 if attribute.constructor_type else '0' %} | 411 if attribute.constructor_type else '0' %} |
412 {% set access_control = 'static_cast<v8::AccessControl>(%s)' % | 412 {% set access_control = 'static_cast<v8::AccessControl>(%s)' % |
413 ' | '.join(attribute.access_control_list) %} | 413 ' | '.join(attribute.access_control_list) %} |
414 {% set property_attribute = 'static_cast<v8::PropertyAttribute>(%s)' % | 414 {% set property_attribute = 'static_cast<v8::PropertyAttribute>(%s)' % |
415 ' | '.join(attribute.property_attributes) %} | 415 ' | '.join(attribute.property_attributes) %} |
(...skipping 11 matching lines...) Expand all Loading... |
427 access_control, | 427 access_control, |
428 property_attribute, | 428 property_attribute, |
429 only_exposed_to_private_script, | 429 only_exposed_to_private_script, |
430 ] %} | 430 ] %} |
431 {% if not attribute.is_expose_js_accessors %} | 431 {% if not attribute.is_expose_js_accessors %} |
432 {% set attribute_configuration_list = attribute_configuration_list | 432 {% set attribute_configuration_list = attribute_configuration_list |
433 + [on_prototype] %} | 433 + [on_prototype] %} |
434 {% endif %} | 434 {% endif %} |
435 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} | 435 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} |
436 {%- endmacro %} | 436 {%- endmacro %} |
OLD | NEW |