| OLD | NEW |
| 1 {% from 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc
al_cpp_value %} | 1 {% from 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc
al_cpp_value %} |
| 2 | 2 |
| 3 {##############################################################################} | 3 {##############################################################################} |
| 4 {% macro attribute_getter(attribute, world_suffix) %} | 4 {% macro attribute_getter(attribute, world_suffix) %} |
| 5 static void {{attribute.name}}AttributeGetter{{world_suffix}}( | 5 static void {{attribute.name}}AttributeGetter{{world_suffix}}( |
| 6 {%- if attribute.is_data_type_property %} | 6 {%- if attribute.is_data_type_property %} |
| 7 const v8::PropertyCallbackInfo<v8::Value>& info | 7 const v8::PropertyCallbackInfo<v8::Value>& info |
| 8 {%- else %} | 8 {%- else %} |
| 9 const v8::FunctionCallbackInfo<v8::Value>& info | 9 const v8::FunctionCallbackInfo<v8::Value>& info |
| 10 {%- endif %}) | 10 {%- endif %}) |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 {% endif %} | 55 {% endif %} |
| 56 {% if interface_name == 'Window' and attribute.idl_type == 'EventHandler' %} | 56 {% if interface_name == 'Window' and attribute.idl_type == 'EventHandler' %} |
| 57 if (!impl->document()) | 57 if (!impl->document()) |
| 58 return; | 58 return; |
| 59 {% endif %} | 59 {% endif %} |
| 60 {# Local variables #} | 60 {# Local variables #} |
| 61 {% if attribute.is_call_with_execution_context %} | 61 {% if attribute.is_call_with_execution_context %} |
| 62 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 62 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
| 63 {% endif %} | 63 {% endif %} |
| 64 {% if attribute.is_call_with_script_state %} | 64 {% if attribute.is_call_with_script_state %} |
| 65 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); | 65 ScriptState* scriptState = ScriptState::forThisObject(info); |
| 66 {% endif %} | 66 {% endif %} |
| 67 {% if (attribute.is_check_security_for_receiver and | 67 {% if (attribute.is_check_security_for_receiver and |
| 68 not attribute.is_data_type_property) or | 68 not attribute.is_data_type_property) or |
| 69 attribute.is_check_security_for_return_value or | 69 attribute.is_check_security_for_return_value or |
| 70 attribute.is_getter_raises_exception %} | 70 attribute.is_getter_raises_exception %} |
| 71 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na
me}}", "{{interface_name}}", holder, info.GetIsolate()); | 71 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.na
me}}", "{{interface_name}}", holder, info.GetIsolate()); |
| 72 {% endif %} | 72 {% endif %} |
| 73 {% if attribute.is_explicit_nullable %} | 73 {% if attribute.is_explicit_nullable %} |
| 74 bool isNull = false; | 74 bool isNull = false; |
| 75 {% endif %} | 75 {% endif %} |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 const v8::FunctionCallbackInfo<v8::Value>& info | 186 const v8::FunctionCallbackInfo<v8::Value>& info |
| 187 {%- endif %}) | 187 {%- endif %}) |
| 188 { | 188 { |
| 189 {% if attribute.deprecate_as %} | 189 {% if attribute.deprecate_as %} |
| 190 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentEx
ecutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); | 190 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentEx
ecutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); |
| 191 {% endif %} | 191 {% endif %} |
| 192 {% if attribute.measure_as %} | 192 {% if attribute.measure_as %} |
| 193 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte
xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeGetter')}}); | 193 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte
xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeGetter')}}); |
| 194 {% endif %} | 194 {% endif %} |
| 195 {% if world_suffix in attribute.activity_logging_world_list_for_getter %} | 195 {% if world_suffix in attribute.activity_logging_world_list_for_getter %} |
| 196 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo
ntext()); | 196 ScriptState* scriptState = ScriptState::forThisObject(info); |
| 197 V8PerContextData* contextData = scriptState->perContextData(); | 197 V8PerContextData* contextData = scriptState->perContextData(); |
| 198 {% if attribute.activity_logging_world_check %} | 198 {% if attribute.activity_logging_world_check %} |
| 199 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) | 199 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) |
| 200 {% else %} | 200 {% else %} |
| 201 if (contextData && contextData->activityLogger()) | 201 if (contextData && contextData->activityLogger()) |
| 202 {% endif %} | 202 {% endif %} |
| 203 contextData->activityLogger()->logGetter("{{interface_name}}.{{attribute
.name}}"); | 203 contextData->activityLogger()->logGetter("{{interface_name}}.{{attribute
.name}}"); |
| 204 {% endif %} | 204 {% endif %} |
| 205 {% if attribute.has_custom_getter %} | 205 {% if attribute.has_custom_getter %} |
| 206 {{v8_class}}::{{attribute.name}}AttributeGetterCustom(info); | 206 {{v8_class}}::{{attribute.name}}AttributeGetterCustom(info); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 (attribute.is_reflect and | 335 (attribute.is_reflect and |
| 336 not(attribute.idl_type == 'DOMString' and is_node)) %} | 336 not(attribute.idl_type == 'DOMString' and is_node)) %} |
| 337 {# Skip on compact node DOMString getters #} | 337 {# Skip on compact node DOMString getters #} |
| 338 V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; | 338 V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; |
| 339 {% endif %} | 339 {% endif %} |
| 340 {% if attribute.is_call_with_execution_context or | 340 {% if attribute.is_call_with_execution_context or |
| 341 attribute.is_setter_call_with_execution_context %} | 341 attribute.is_setter_call_with_execution_context %} |
| 342 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); | 342 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate
()); |
| 343 {% endif %} | 343 {% endif %} |
| 344 {% if attribute.is_call_with_script_state %} | 344 {% if attribute.is_call_with_script_state %} |
| 345 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); | 345 ScriptState* scriptState = ScriptState::forThisObject(info); |
| 346 {% endif %} | 346 {% endif %} |
| 347 {# Set #} | 347 {# Set #} |
| 348 {% if attribute.cpp_setter %} | 348 {% if attribute.cpp_setter %} |
| 349 {{attribute.cpp_setter}}; | 349 {{attribute.cpp_setter}}; |
| 350 {% endif %} | 350 {% endif %} |
| 351 {# Post-set #} | 351 {# Post-set #} |
| 352 {% if attribute.is_setter_raises_exception %} | 352 {% if attribute.is_setter_raises_exception %} |
| 353 exceptionState.throwIfNeeded(); | 353 exceptionState.throwIfNeeded(); |
| 354 {% endif %} | 354 {% endif %} |
| 355 {% if attribute.cached_attribute_validation_method %} | 355 {% if attribute.cached_attribute_validation_method %} |
| (...skipping 15 matching lines...) Expand all Loading... |
| 371 {% if not attribute.is_data_type_property %} | 371 {% if not attribute.is_data_type_property %} |
| 372 v8::Local<v8::Value> v8Value = info[0]; | 372 v8::Local<v8::Value> v8Value = info[0]; |
| 373 {% endif %} | 373 {% endif %} |
| 374 {% if attribute.deprecate_as %} | 374 {% if attribute.deprecate_as %} |
| 375 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentEx
ecutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); | 375 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentEx
ecutionContext(info.GetIsolate()), UseCounter::{{attribute.deprecate_as}}); |
| 376 {% endif %} | 376 {% endif %} |
| 377 {% if attribute.measure_as %} | 377 {% if attribute.measure_as %} |
| 378 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte
xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeSetter')}}); | 378 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte
xt(info.GetIsolate()), UseCounter::{{attribute.measure_as('AttributeSetter')}}); |
| 379 {% endif %} | 379 {% endif %} |
| 380 {% if world_suffix in attribute.activity_logging_world_list_for_setter %} | 380 {% if world_suffix in attribute.activity_logging_world_list_for_setter %} |
| 381 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo
ntext()); | 381 ScriptState* scriptState = ScriptState::forThisObject(info); |
| 382 V8PerContextData* contextData = scriptState->perContextData(); | 382 V8PerContextData* contextData = scriptState->perContextData(); |
| 383 {% if attribute.activity_logging_world_check %} | 383 {% if attribute.activity_logging_world_check %} |
| 384 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) { | 384 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) { |
| 385 {% else %} | 385 {% else %} |
| 386 if (contextData && contextData->activityLogger()) { | 386 if (contextData && contextData->activityLogger()) { |
| 387 {% endif %} | 387 {% endif %} |
| 388 contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute
.name}}", v8Value); | 388 contextData->activityLogger()->logSetter("{{interface_name}}.{{attribute
.name}}", v8Value); |
| 389 } | 389 } |
| 390 {% endif %} | 390 {% endif %} |
| 391 {% if attribute.is_ce_reactions %} | 391 {% if attribute.is_ce_reactions %} |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 setter_callback_for_main_world, | 509 setter_callback_for_main_world, |
| 510 wrapper_type_info, | 510 wrapper_type_info, |
| 511 access_control, | 511 access_control, |
| 512 property_attribute, | 512 property_attribute, |
| 513 only_exposed_to_private_script, | 513 only_exposed_to_private_script, |
| 514 property_location(attribute), | 514 property_location(attribute), |
| 515 holder_check, | 515 holder_check, |
| 516 ] %} | 516 ] %} |
| 517 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} | 517 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} |
| 518 {%- endmacro %} | 518 {%- endmacro %} |
| OLD | NEW |