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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 393 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
394 {% if not method.overloads %}{# Overloaded methods are measured in overload_
resolution_method() #} | 394 {% if not method.overloads %}{# Overloaded methods are measured in overload_
resolution_method() #} |
395 {% if method.measure_as %} | 395 {% if method.measure_as %} |
396 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{
method.measure_as}}); | 396 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{
method.measure_as}}); |
397 {% endif %} | 397 {% endif %} |
398 {% if method.deprecate_as %} | 398 {% if method.deprecate_as %} |
399 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use
Counter::{{method.deprecate_as}}); | 399 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use
Counter::{{method.deprecate_as}}); |
400 {% endif %} | 400 {% endif %} |
401 {% endif %}{# not method.overloads #} | 401 {% endif %}{# not method.overloads #} |
402 {% if world_suffix in method.activity_logging_world_list %} | 402 {% if world_suffix in method.activity_logging_world_list %} |
403 DOMWrapperWorld& world = DOMWrapperWorld::current(info.GetIsolate()); | 403 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
404 if (world.activityLogger()) { | 404 if (contextData && contextData->activityLogger()) { |
405 {# FIXME: replace toVectorOfArguments with toNativeArguments(info, 0) | 405 {# FIXME: replace toVectorOfArguments with toNativeArguments(info, 0) |
406 and delete toVectorOfArguments #} | 406 and delete toVectorOfArguments #} |
407 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 407 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
408 world.activityLogger()->logMethod("{{interface_name}}.{{method.name}}",
info.Length(), loggerArgs.data()); | 408 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na
me}}", info.Length(), loggerArgs.data()); |
409 } | 409 } |
410 {% endif %} | 410 {% endif %} |
411 {% if method.is_custom %} | 411 {% if method.is_custom %} |
412 {{v8_class}}::{{method.name}}MethodCustom(info); | 412 {{v8_class}}::{{method.name}}MethodCustom(info); |
413 {% else %} | 413 {% else %} |
414 {{cpp_class}}V8Internal::{{method.name}}Method{{world_suffix}}(info); | 414 {{cpp_class}}V8Internal::{{method.name}}Method{{world_suffix}}(info); |
415 {% endif %} | 415 {% endif %} |
416 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 416 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
417 } | 417 } |
418 {% endfilter %} | 418 {% endfilter %} |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 {% endif %} | 553 {% endif %} |
554 {{constructor.cpp_type}} impl = {{cpp_class}}::createForJSConstructor({{cons
tructor.argument_list | join(', ')}}); | 554 {{constructor.cpp_type}} impl = {{cpp_class}}::createForJSConstructor({{cons
tructor.argument_list | join(', ')}}); |
555 {% if is_constructor_raises_exception %} | 555 {% if is_constructor_raises_exception %} |
556 if (exceptionState.throwIfNeeded()) | 556 if (exceptionState.throwIfNeeded()) |
557 return; | 557 return; |
558 {% endif %} | 558 {% endif %} |
559 | 559 |
560 {{generate_constructor_wrapper(constructor) | indent}} | 560 {{generate_constructor_wrapper(constructor) | indent}} |
561 } | 561 } |
562 {% endmacro %} | 562 {% endmacro %} |
OLD | NEW |