OLD | NEW |
1 {% from 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc
al_cpp_value, check_origin_trial %} | 1 {% from 'utilities.cpp' import declare_enum_validation_variable, v8_value_to_loc
al_cpp_value, check_origin_trial %} |
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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 {##############################################################################} | 457 {##############################################################################} |
458 {% macro generate_post_message_impl() %} | 458 {% macro generate_post_message_impl() %} |
459 void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance, const v
8::FunctionCallbackInfo<v8::Value>& info) | 459 void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance, const v
8::FunctionCallbackInfo<v8::Value>& info) |
460 { | 460 { |
461 ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage
", interfaceName, info.Holder(), info.GetIsolate()); | 461 ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage
", interfaceName, info.Holder(), info.GetIsolate()); |
462 if (UNLIKELY(info.Length() < 1)) { | 462 if (UNLIKELY(info.Length() < 1)) { |
463 setMinimumArityTypeError(exceptionState, 1, info.Length()); | 463 setMinimumArityTypeError(exceptionState, 1, info.Length()); |
464 exceptionState.throwIfNeeded(); | 464 exceptionState.throwIfNeeded(); |
465 return; | 465 return; |
466 } | 466 } |
467 Transferables transferables; | 467 Transferables* transferables = SerializedScriptValueFactory::instance().crea
teTransferables(); |
468 if (info.Length() > 1) { | 468 if (info.Length() > 1) { |
469 const int transferablesArgIndex = 1; | 469 const int transferablesArgIndex = 1; |
470 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info
[transferablesArgIndex], transferablesArgIndex, transferables, exceptionState))
{ | 470 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info
[transferablesArgIndex], transferablesArgIndex, *transferables, exceptionState))
{ |
471 exceptionState.throwIfNeeded(); | 471 exceptionState.throwIfNeeded(); |
472 return; | 472 return; |
473 } | 473 } |
474 } | 474 } |
475 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan
ce().create(info.GetIsolate(), info[0], &transferables, exceptionState); | 475 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan
ce().create(info.GetIsolate(), info[0], transferables, exceptionState); |
476 if (exceptionState.throwIfNeeded()) | 476 if (exceptionState.throwIfNeeded()) |
477 return; | 477 return; |
478 // FIXME: Only pass context/exceptionState if instance really requires it. | 478 // FIXME: Only pass context/exceptionState if instance really requires it. |
479 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); | 479 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); |
480 instance->postMessage(context, message.release(), transferables.messagePorts
, exceptionState); | 480 instance->postMessage(context, message.release(), transferables->messagePort
s, exceptionState); |
481 exceptionState.throwIfNeeded(); | 481 exceptionState.throwIfNeeded(); |
482 } | 482 } |
483 {% endmacro %} | 483 {% endmacro %} |
484 | 484 |
485 {##############################################################################} | 485 {##############################################################################} |
486 {% macro method_callback(method, world_suffix) %} | 486 {% macro method_callback(method, world_suffix) %} |
487 static void {{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCall
backInfo<v8::Value>& info) | 487 static void {{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCall
backInfo<v8::Value>& info) |
488 { | 488 { |
489 {% if not method.overloads %}{# Overloaded methods are measured in overload_
resolution_method() #} | 489 {% if not method.overloads %}{# Overloaded methods are measured in overload_
resolution_method() #} |
490 {% if method.measure_as %} | 490 {% if method.measure_as %} |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all | 688 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all |
689 if method.overloads else | 689 if method.overloads else |
690 method.runtime_enabled_function) %} | 690 method.runtime_enabled_function) %} |
691 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration
= {{method_configuration(method)}}; | 691 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration
= {{method_configuration(method)}}; |
692 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), proto
typeObject, interfaceObject, signature, {{method.name}}MethodConfiguration); | 692 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), proto
typeObject, interfaceObject, signature, {{method.name}}MethodConfiguration); |
693 {% endfilter %}{# runtime_enabled() #} | 693 {% endfilter %}{# runtime_enabled() #} |
694 {% endfilter %}{# exposed() #} | 694 {% endfilter %}{# exposed() #} |
695 {% endfor %} | 695 {% endfor %} |
696 {% endif %} | 696 {% endif %} |
697 {%- endmacro %} | 697 {%- endmacro %} |
OLD | NEW |