| OLD | NEW |
| 1 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable, v8_value_t
o_local_cpp_value %} | 1 {% from 'utilities.cpp.tmpl' import declare_enum_validation_variable, v8_value_t
o_local_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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 ScriptForbiddenScope::AllowUserAgentScript script; | 432 ScriptForbiddenScope::AllowUserAgentScript script; |
| 433 ScriptState* scriptState = ScriptState::forWorld(frame, DOMWrapperWorld::priva
teScriptIsolatedWorld()); | 433 ScriptState* scriptState = ScriptState::forWorld(frame, DOMWrapperWorld::priva
teScriptIsolatedWorld()); |
| 434 if (!scriptState) | 434 if (!scriptState) |
| 435 return false; | 435 return false; |
| 436 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 436 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 437 if (!scriptStateInUserScript) | 437 if (!scriptStateInUserScript) |
| 438 return false; | 438 return false; |
| 439 | 439 |
| 440 ScriptState::Scope scope(scriptState); | 440 ScriptState::Scope scope(scriptState); |
| 441 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(
), scriptState->isolate()); | 441 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(
), scriptState->isolate()); |
| 442 ExceptionState exceptionState(ExceptionState::GetterContext, "{{attribute.name
}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate()); | 442 ExceptionState exceptionState(scriptState->isolate(), ExceptionState::GetterCo
ntext, "{{cpp_class}}", "{{attribute.name}}"); |
| 443 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scri
ptState, scriptStateInUserScript, "{{cpp_class}}", "{{attribute.name}}", holder)
; | 443 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(scri
ptState, scriptStateInUserScript, "{{cpp_class}}", "{{attribute.name}}", holder)
; |
| 444 if (v8Value.IsEmpty()) | 444 if (v8Value.IsEmpty()) |
| 445 return false; | 445 return false; |
| 446 {{v8_value_to_local_cpp_value(attribute.private_script_v8_value_to_local_cpp_v
alue) | indent(2)}} | 446 {{v8_value_to_local_cpp_value(attribute.private_script_v8_value_to_local_cpp_v
alue) | indent(2)}} |
| 447 CHECK(!exceptionState.hadException()); | 447 CHECK(!exceptionState.hadException()); |
| 448 *result = cppValue; | 448 *result = cppValue; |
| 449 return true; | 449 return true; |
| 450 } | 450 } |
| 451 {% endmacro %} | 451 {% endmacro %} |
| 452 | 452 |
| 453 | 453 |
| 454 {% macro attribute_setter_implemented_in_private_script(attribute) %} | 454 {% macro attribute_setter_implemented_in_private_script(attribute) %} |
| 455 bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeSetter(LocalFrame*
frame, {{cpp_class}}* holderImpl, {{attribute.argument_cpp_type}} cppValue) { | 455 bool {{v8_class}}::PrivateScript::{{attribute.name}}AttributeSetter(LocalFrame*
frame, {{cpp_class}}* holderImpl, {{attribute.argument_cpp_type}} cppValue) { |
| 456 if (!frame) | 456 if (!frame) |
| 457 return false; | 457 return false; |
| 458 v8::HandleScope handleScope(toIsolate(frame)); | 458 v8::HandleScope handleScope(toIsolate(frame)); |
| 459 ScriptForbiddenScope::AllowUserAgentScript script; | 459 ScriptForbiddenScope::AllowUserAgentScript script; |
| 460 ScriptState* scriptState = ScriptState::forWorld(frame, DOMWrapperWorld::priva
teScriptIsolatedWorld()); | 460 ScriptState* scriptState = ScriptState::forWorld(frame, DOMWrapperWorld::priva
teScriptIsolatedWorld()); |
| 461 if (!scriptState) | 461 if (!scriptState) |
| 462 return false; | 462 return false; |
| 463 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 463 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 464 if (!scriptStateInUserScript) | 464 if (!scriptStateInUserScript) |
| 465 return false; | 465 return false; |
| 466 | 466 |
| 467 ScriptState::Scope scope(scriptState); | 467 ScriptState::Scope scope(scriptState); |
| 468 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(
), scriptState->isolate()); | 468 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Global(
), scriptState->isolate()); |
| 469 ExceptionState exceptionState(ExceptionState::SetterContext, "{{attribute.name
}}", "{{cpp_class}}", scriptState->context()->Global(), scriptState->isolate()); | 469 ExceptionState exceptionState(scriptState->isolate(), ExceptionState::SetterCo
ntext, "{{cpp_class}}", "{{attribute.name}}"); |
| 470 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateInUs
erScript, "{{cpp_class}}", "{{attribute.name}}", holder, {{attribute.private_scr
ipt_cpp_value_to_v8_value}}); | 470 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateInUs
erScript, "{{cpp_class}}", "{{attribute.name}}", holder, {{attribute.private_scr
ipt_cpp_value_to_v8_value}}); |
| 471 } | 471 } |
| 472 {% endmacro %} | 472 {% endmacro %} |
| 473 | 473 |
| 474 | 474 |
| 475 {##############################################################################} | 475 {##############################################################################} |
| 476 {% macro attribute_configuration(attribute) %} | 476 {% macro attribute_configuration(attribute) %} |
| 477 {% from 'utilities.cpp.tmpl' import property_location %} | 477 {% from 'utilities.cpp.tmpl' import property_location %} |
| 478 {% if attribute.constructor_type %} | 478 {% if attribute.constructor_type %} |
| 479 {% set getter_callback = | 479 {% set getter_callback = |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 cached_accessor_callback, | 525 cached_accessor_callback, |
| 526 wrapper_type_info, | 526 wrapper_type_info, |
| 527 access_control, | 527 access_control, |
| 528 property_attribute, | 528 property_attribute, |
| 529 only_exposed_to_private_script, | 529 only_exposed_to_private_script, |
| 530 property_location(attribute), | 530 property_location(attribute), |
| 531 holder_check, | 531 holder_check, |
| 532 ] %} | 532 ] %} |
| 533 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} | 533 {{'{'}}{{attribute_configuration_list | join(', ')}}{{'}'}} |
| 534 {%- endmacro %} | 534 {%- endmacro %} |
| OLD | NEW |