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 generate_method(method, world_suffix) %} | 4 {% macro generate_method(method, world_suffix) %} |
5 {% if method.returns_promise and method.has_exception_state %} | 5 {% if method.returns_promise and method.has_exception_state %} |
6 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis
e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat
e) | 6 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis
e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat
e) |
7 {% else %} | 7 {% else %} |
8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) | 8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) |
9 {% endif %} | 9 {% endif %} |
10 { | 10 { |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 226 |
227 {######################################} | 227 {######################################} |
228 {% macro cpp_method_call(method, v8_set_return_value, cpp_value) %} | 228 {% macro cpp_method_call(method, v8_set_return_value, cpp_value) %} |
229 {% if method.is_custom_call_prologue %} | 229 {% if method.is_custom_call_prologue %} |
230 {{v8_class}}::{{method.name}}MethodPrologueCustom(info, impl); | 230 {{v8_class}}::{{method.name}}MethodPrologueCustom(info, impl); |
231 {% endif %} | 231 {% endif %} |
232 {# Local variables #} | 232 {# Local variables #} |
233 {% if method.is_call_with_script_state or method.is_call_with_this_value %} | 233 {% if method.is_call_with_script_state or method.is_call_with_this_value %} |
234 {# [ConstructorCallWith=ScriptState] #} | 234 {# [ConstructorCallWith=ScriptState] #} |
235 {# [CallWith=ScriptState] #} | 235 {# [CallWith=ScriptState] #} |
236 ScriptState* scriptState = ScriptState::current(info.GetIsolate()); | 236 ScriptState* scriptState = ScriptState::forHolderObject(info); |
237 {% endif %} | 237 {% endif %} |
238 {% if method.is_call_with_execution_context %} | 238 {% if method.is_call_with_execution_context %} |
239 {# [ConstructorCallWith=ExecutionContext] #} | 239 {# [ConstructorCallWith=ExecutionContext] #} |
240 {# [CallWith=ExecutionContext] #} | 240 {# [CallWith=ExecutionContext] #} |
241 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); | 241 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate()); |
242 {% endif %} | 242 {% endif %} |
243 {% if method.is_call_with_script_arguments %} | 243 {% if method.is_call_with_script_arguments %} |
244 {# [CallWith=ScriptArguments] #} | 244 {# [CallWith=ScriptArguments] #} |
245 ScriptArguments* scriptArguments(ScriptArguments::create(scriptState, info, {{me
thod.number_of_arguments}})); | 245 ScriptArguments* scriptArguments(ScriptArguments::create(scriptState, info, {{me
thod.number_of_arguments}})); |
246 {% endif %} | 246 {% endif %} |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 { | 495 { |
496 {% if not method.overloads %}{# Overloaded methods are measured in overload_
resolution_method() #} | 496 {% if not method.overloads %}{# Overloaded methods are measured in overload_
resolution_method() #} |
497 {% if method.measure_as %} | 497 {% if method.measure_as %} |
498 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte
xt(info.GetIsolate()), UseCounter::{{method.measure_as('Method')}}); | 498 UseCounter::countIfNotPrivateScript(info.GetIsolate(), currentExecutionConte
xt(info.GetIsolate()), UseCounter::{{method.measure_as('Method')}}); |
499 {% endif %} | 499 {% endif %} |
500 {% if method.deprecate_as %} | 500 {% if method.deprecate_as %} |
501 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentEx
ecutionContext(info.GetIsolate()), UseCounter::{{method.deprecate_as}}); | 501 Deprecation::countDeprecationIfNotPrivateScript(info.GetIsolate(), currentEx
ecutionContext(info.GetIsolate()), UseCounter::{{method.deprecate_as}}); |
502 {% endif %} | 502 {% endif %} |
503 {% endif %}{# not method.overloads #} | 503 {% endif %}{# not method.overloads #} |
504 {% if world_suffix in method.activity_logging_world_list %} | 504 {% if world_suffix in method.activity_logging_world_list %} |
505 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo
ntext()); | 505 ScriptState* scriptState = ScriptState::forHolderObject(info); |
506 V8PerContextData* contextData = scriptState->perContextData(); | 506 V8PerContextData* contextData = scriptState->perContextData(); |
507 {% if method.activity_logging_world_check %} | 507 {% if method.activity_logging_world_check %} |
508 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) | 508 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) |
509 {% else %} | 509 {% else %} |
510 if (contextData && contextData->activityLogger()) { | 510 if (contextData && contextData->activityLogger()) { |
511 {% endif %} | 511 {% endif %} |
512 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{metho
d.name}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); | 512 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{metho
d.name}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); |
513 Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Loc
al<v8::Value>>>(info, 0, exceptionState); | 513 Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Loc
al<v8::Value>>>(info, 0, exceptionState); |
514 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na
me}}", info.Length(), loggerArgs.data()); | 514 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na
me}}", info.Length(), loggerArgs.data()); |
515 } | 515 } |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all | 685 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all |
686 if method.overloads else | 686 if method.overloads else |
687 method.runtime_enabled_function) %} | 687 method.runtime_enabled_function) %} |
688 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration
= {{method_configuration(method)}}; | 688 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration
= {{method_configuration(method)}}; |
689 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), proto
typeObject, interfaceObject, signature, {{method.name}}MethodConfiguration); | 689 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), proto
typeObject, interfaceObject, signature, {{method.name}}MethodConfiguration); |
690 {% endfilter %}{# runtime_enabled() #} | 690 {% endfilter %}{# runtime_enabled() #} |
691 {% endfilter %}{# exposed() #} | 691 {% endfilter %}{# exposed() #} |
692 {% endfor %} | 692 {% endfor %} |
693 {% endif %} | 693 {% endif %} |
694 {%- endmacro %} | 694 {%- endmacro %} |
OLD | NEW |