| 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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 return; | 430 return; |
| 431 } | 431 } |
| 432 {# No match, throw error #} | 432 {# No match, throw error #} |
| 433 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); | 433 exceptionState.throwTypeError("No function was found that matched the signat
ure provided."); |
| 434 exceptionState.throwIfNeeded(); | 434 exceptionState.throwIfNeeded(); |
| 435 } | 435 } |
| 436 {% endmacro %} | 436 {% endmacro %} |
| 437 | 437 |
| 438 | 438 |
| 439 {##############################################################################} | 439 {##############################################################################} |
| 440 {% macro method_callback(method, world_suffix) %} | 440 {% macro method_callback(method, world_suffix, internal_namespace='') %} |
| 441 {% filter conditional(method.conditional_string) %} | 441 {% filter conditional(method.conditional_string) %} |
| 442 static void {{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCall
backInfo<v8::Value>& info) | 442 static void {{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCall
backInfo<v8::Value>& info) |
| 443 { | 443 { |
| 444 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | 444 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |
| 445 {% if not method.overloads %}{# Overloaded methods are measured in overload_
resolution_method() #} | 445 {% if not method.overloads %}{# Overloaded methods are measured in overload_
resolution_method() #} |
| 446 {% if method.measure_as %} | 446 {% if method.measure_as %} |
| 447 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{
method.measure_as}}); | 447 UseCounter::count(callingExecutionContext(info.GetIsolate()), UseCounter::{{
method.measure_as}}); |
| 448 {% endif %} | 448 {% endif %} |
| 449 {% if method.deprecate_as %} | 449 {% if method.deprecate_as %} |
| 450 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use
Counter::{{method.deprecate_as}}); | 450 UseCounter::countDeprecation(callingExecutionContext(info.GetIsolate()), Use
Counter::{{method.deprecate_as}}); |
| 451 {% endif %} | 451 {% endif %} |
| 452 {% endif %}{# not method.overloads #} | 452 {% endif %}{# not method.overloads #} |
| 453 {% if world_suffix in method.activity_logging_world_list %} | 453 {% if world_suffix in method.activity_logging_world_list %} |
| 454 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo
ntext()); | 454 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo
ntext()); |
| 455 V8PerContextData* contextData = scriptState->perContextData(); | 455 V8PerContextData* contextData = scriptState->perContextData(); |
| 456 {% if method.activity_logging_world_check %} | 456 {% if method.activity_logging_world_check %} |
| 457 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) | 457 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac
tivityLogger()) |
| 458 {% else %} | 458 {% else %} |
| 459 if (contextData && contextData->activityLogger()) { | 459 if (contextData && contextData->activityLogger()) { |
| 460 {% endif %} | 460 {% endif %} |
| 461 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 461 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
| 462 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na
me}}", info.Length(), loggerArgs.data()); | 462 contextData->activityLogger()->logMethod("{{interface_name}}.{{method.na
me}}", info.Length(), loggerArgs.data()); |
| 463 } | 463 } |
| 464 {% endif %} | 464 {% endif %} |
| 465 {% if method.is_custom %} | 465 {% if method.is_custom %} |
| 466 {{v8_class}}::{{method.name}}MethodCustom(info); | 466 {{v8_class}}::{{method.name}}MethodCustom(info); |
| 467 {% else %} | 467 {% else %} |
| 468 {{cpp_class}}V8Internal::{{method.name}}Method{{world_suffix}}(info); | 468 {{cpp_class}}V8Internal{{internal_namespace}}::{{method.name}}Method{{world_
suffix}}(info); |
| 469 {% endif %} | 469 {% endif %} |
| 470 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 470 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
| 471 } | 471 } |
| 472 {% endfilter %} | 472 {% endfilter %} |
| 473 {% endmacro %} | 473 {% endmacro %} |
| 474 | 474 |
| 475 | 475 |
| 476 {##############################################################################} | 476 {##############################################################################} |
| 477 {% macro origin_safe_method_getter(method, world_suffix) %} | 477 {% macro origin_safe_method_getter(method, world_suffix) %} |
| 478 static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::Prop
ertyCallbackInfo<v8::Value>& info) | 478 static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::Prop
ertyCallbackInfo<v8::Value>& info) |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 v8::Handle<v8::Object> wrapper = wrap(impl.get(), info.Holder(), info.GetIsolate
()); | 619 v8::Handle<v8::Object> wrapper = wrap(impl.get(), info.Holder(), info.GetIsolate
()); |
| 620 {% else %} | 620 {% else %} |
| 621 {% set constructor_class = v8_class + ('Constructor' | 621 {% set constructor_class = v8_class + ('Constructor' |
| 622 if constructor.is_named_constructor else | 622 if constructor.is_named_constructor else |
| 623 '') %} | 623 '') %} |
| 624 v8::Handle<v8::Object> wrapper = info.Holder(); | 624 v8::Handle<v8::Object> wrapper = info.Holder(); |
| 625 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{constr
uctor_class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), {{wrapper_configurat
ion}}); | 625 V8DOMWrapper::associateObjectWithWrapper<{{v8_class}}>(impl.release(), &{{constr
uctor_class}}::wrapperTypeInfo, wrapper, info.GetIsolate(), {{wrapper_configurat
ion}}); |
| 626 {% endif %} | 626 {% endif %} |
| 627 v8SetReturnValue(info, wrapper); | 627 v8SetReturnValue(info, wrapper); |
| 628 {% endmacro %} | 628 {% endmacro %} |
| OLD | NEW |