OLD | NEW |
1 {##############################################################################} | 1 {##############################################################################} |
2 {% macro generate_method(method, world_suffix) %} | 2 {% macro generate_method(method, world_suffix) %} |
3 {% filter conditional(method.conditional_string) %} | 3 {% filter conditional(method.conditional_string) %} |
4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) | 4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) |
5 { | 5 { |
6 {# Local variables #} | 6 {# Local variables #} |
7 {% if method.has_exception_state %} | 7 {% if method.has_exception_state %} |
8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na
me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); | 8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na
me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); |
9 {% endif %} | 9 {% endif %} |
10 {# Overloaded methods have length checked during overload resolution #} | 10 {# Overloaded methods have length checked during overload resolution #} |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 396 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
397 {% if not method.overloads %}{# Overloaded methods are measured in overload_
resolution_method() #} | 397 {% if not method.overloads %}{# Overloaded methods are measured in overload_
resolution_method() #} |
398 {% if method.measure_as %} | 398 {% if method.measure_as %} |
399 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{
method.measure_as}}); | 399 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{
method.measure_as}}); |
400 {% endif %} | 400 {% endif %} |
401 {% if method.deprecate_as %} | 401 {% if method.deprecate_as %} |
402 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use
Counter::{{method.deprecate_as}}); | 402 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use
Counter::{{method.deprecate_as}}); |
403 {% endif %} | 403 {% endif %} |
404 {% endif %}{# not method.overloads #} | 404 {% endif %}{# not method.overloads #} |
405 {% if world_suffix in method.activity_logging_world_list %} | 405 {% if world_suffix in method.activity_logging_world_list %} |
406 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 406 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo
ntext()); |
| 407 V8PerContextData* contextData = scriptState->perContextData(); |
| 408 {% if method.activity_logging_world_check %} |
| 409 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) |
| 410 {% else %} |
407 if (contextData && contextData->activityLogger()) { | 411 if (contextData && contextData->activityLogger()) { |
| 412 {% endif %} |
408 {# FIXME: replace toVectorOfArguments with toNativeArguments(info, 0) | 413 {# FIXME: replace toVectorOfArguments with toNativeArguments(info, 0) |
409 and delete toVectorOfArguments #} | 414 and delete toVectorOfArguments #} |
410 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 415 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
411 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na
me}}", info.Length(), loggerArgs.data()); | 416 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na
me}}", info.Length(), loggerArgs.data()); |
412 } | 417 } |
413 {% endif %} | 418 {% endif %} |
414 {% if method.is_custom %} | 419 {% if method.is_custom %} |
415 {{v8_class}}::{{method.name}}MethodCustom(info); | 420 {{v8_class}}::{{method.name}}MethodCustom(info); |
416 {% else %} | 421 {% else %} |
417 {{cpp_class}}V8Internal::{{method.name}}Method{{world_suffix}}(info); | 422 {{cpp_class}}V8Internal::{{method.name}}Method{{world_suffix}}(info); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 {% endif %} | 561 {% endif %} |
557 {{constructor.cpp_type}} impl = {{cpp_class}}::createForJSConstructor({{cons
tructor.argument_list | join(', ')}}); | 562 {{constructor.cpp_type}} impl = {{cpp_class}}::createForJSConstructor({{cons
tructor.argument_list | join(', ')}}); |
558 {% if is_constructor_raises_exception %} | 563 {% if is_constructor_raises_exception %} |
559 if (exceptionState.throwIfNeeded()) | 564 if (exceptionState.throwIfNeeded()) |
560 return; | 565 return; |
561 {% endif %} | 566 {% endif %} |
562 | 567 |
563 {{generate_constructor_wrapper(constructor) | indent}} | 568 {{generate_constructor_wrapper(constructor) | indent}} |
564 } | 569 } |
565 {% endmacro %} | 570 {% endmacro %} |
OLD | NEW |