OLD | NEW |
1 {% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_l
ocal_cpp_value %} | 1 {% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_l
ocal_cpp_value %} |
2 | 2 |
3 | 3 |
4 {##############################################################################} | 4 {##############################################################################} |
5 {% macro generate_method(method, world_suffix) %} | 5 {% macro generate_method(method, world_suffix) %} |
6 {% filter conditional(method.conditional_string) %} | 6 {% filter conditional(method.conditional_string) %} |
7 {% if method.returns_promise and method.has_exception_state %} | 7 {% if method.returns_promise and method.has_exception_state %} |
8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis
e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat
e) | 8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis
e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat
e) |
9 {% else %} | 9 {% else %} |
10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) | 10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 {% endif %}{# not method.overloads #} | 459 {% endif %}{# not method.overloads #} |
460 {% if world_suffix in method.activity_logging_world_list %} | 460 {% if world_suffix in method.activity_logging_world_list %} |
461 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo
ntext()); | 461 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo
ntext()); |
462 V8PerContextData* contextData = scriptState->perContextData(); | 462 V8PerContextData* contextData = scriptState->perContextData(); |
463 {% if method.activity_logging_world_check %} | 463 {% if method.activity_logging_world_check %} |
464 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) | 464 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) |
465 {% else %} | 465 {% else %} |
466 if (contextData && contextData->activityLogger()) { | 466 if (contextData && contextData->activityLogger()) { |
467 {% endif %} | 467 {% endif %} |
468 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{metho
d.name}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); | 468 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{metho
d.name}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); |
469 Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<v8::Local<v8::
Value>>(info, 0, exceptionState); | 469 Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Loc
al<v8::Value>>>(info, 0, exceptionState); |
470 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na
me}}", info.Length(), loggerArgs.data()); | 470 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na
me}}", info.Length(), loggerArgs.data()); |
471 } | 471 } |
472 {% endif %} | 472 {% endif %} |
473 {% if method.is_custom %} | 473 {% if method.is_custom %} |
474 {{v8_class}}::{{method.name}}MethodCustom(info); | 474 {{v8_class}}::{{method.name}}MethodCustom(info); |
475 {% elif method.is_post_message %} | 475 {% elif method.is_post_message %} |
476 postMessageMethodCommon("{{interface_name}}", {{v8_class}}::toImpl(info.Hold
er()), info); | 476 postMessageMethodCommon("{{interface_name}}", {{v8_class}}::toImpl(info.Hold
er()), info); |
477 {% else %} | 477 {% else %} |
478 {{cpp_class_or_partial}}V8Internal::{{method.name}}Method{{world_suffix}}(in
fo); | 478 {{cpp_class_or_partial}}V8Internal::{{method.name}}Method{{world_suffix}}(in
fo); |
479 {% endif %} | 479 {% endif %} |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 if method.overloads else | 662 if method.overloads else |
663 method.runtime_enabled_function) %} | 663 method.runtime_enabled_function) %} |
664 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate::New(iso
late, {{cpp_class_or_partial}}V8Internal::{{method.name}}MethodCallback, v8Undef
ined(), defaultSignature, {{method.number_of_required_arguments}}); | 664 v8::Local<v8::FunctionTemplate> functionTemplate = v8::FunctionTemplate::New(iso
late, {{cpp_class_or_partial}}V8Internal::{{method.name}}MethodCallback, v8Undef
ined(), defaultSignature, {{method.number_of_required_arguments}}); |
665 v8::Local<v8::Function> function = ->GetFunction(isolate->GetCurrentContext())).
ToLocalChecked(); | 665 v8::Local<v8::Function> function = ->GetFunction(isolate->GetCurrentContext())).
ToLocalChecked(); |
666 v8CallOrCrash(prototypeObject->Set(isolate->GetCurrentContext(), v8AtomicString(
isolate, "{{method.name}}"), function)); | 666 v8CallOrCrash(prototypeObject->Set(isolate->GetCurrentContext(), v8AtomicString(
isolate, "{{method.name}}"), function)); |
667 {% endfilter %}{# runtime_enabled() #} | 667 {% endfilter %}{# runtime_enabled() #} |
668 {% endfilter %}{# exposed() #} | 668 {% endfilter %}{# exposed() #} |
669 {% endfor %} | 669 {% endfor %} |
670 {% endif %} | 670 {% endif %} |
671 {%- endmacro %} | 671 {%- endmacro %} |
OLD | NEW |