OLD | NEW |
1 {% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_l
ocal_cpp_value %} | 1 {% from 'conversions.cpp' import declare_enum_validation_variable, v8_value_to_l
ocal_cpp_value %} |
2 | 2 |
3 | 3 |
4 {##############################################################################} | 4 {##############################################################################} |
5 {% macro generate_method(method, world_suffix) %} | 5 {% macro generate_method(method, world_suffix) %} |
6 {% filter conditional(method.conditional_string) %} | 6 {% filter conditional(method.conditional_string) %} |
7 {% if method.returns_promise and method.has_exception_state %} | 7 {% if method.returns_promise and method.has_exception_state %} |
8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis
e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat
e) | 8 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}Promis
e(const v8::FunctionCallbackInfo<v8::Value>& info, ExceptionState& exceptionStat
e) |
9 {% else %} | 9 {% else %} |
10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) | 10 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
v8::FunctionCallbackInfo<v8::Value>& info) |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance, const v
8::FunctionCallbackInfo<v8::Value>& info) | 451 void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance, const v
8::FunctionCallbackInfo<v8::Value>& info) |
452 { | 452 { |
453 ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage
", interfaceName, info.Holder(), info.GetIsolate()); | 453 ExceptionState exceptionState(ExceptionState::ExecutionContext, "postMessage
", interfaceName, info.Holder(), info.GetIsolate()); |
454 if (UNLIKELY(info.Length() < 1)) { | 454 if (UNLIKELY(info.Length() < 1)) { |
455 setMinimumArityTypeError(exceptionState, 1, info.Length()); | 455 setMinimumArityTypeError(exceptionState, 1, info.Length()); |
456 exceptionState.throwIfNeeded(); | 456 exceptionState.throwIfNeeded(); |
457 return; | 457 return; |
458 } | 458 } |
459 OwnPtrWillBeRawPtr<MessagePortArray> ports = adoptPtrWillBeNoop(new MessageP
ortArray); | 459 OwnPtrWillBeRawPtr<MessagePortArray> ports = adoptPtrWillBeNoop(new MessageP
ortArray); |
460 ArrayBufferArray arrayBuffers; | 460 ArrayBufferArray arrayBuffers; |
| 461 ImageBitmapArray imageBitmaps; |
461 if (info.Length() > 1) { | 462 if (info.Length() > 1) { |
462 const int transferablesArgIndex = 1; | 463 const int transferablesArgIndex = 1; |
463 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info
[transferablesArgIndex], transferablesArgIndex, *ports, arrayBuffers, exceptionS
tate)) { | 464 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info
[transferablesArgIndex], transferablesArgIndex, *ports, arrayBuffers, imageBitma
ps, exceptionState)) { |
464 exceptionState.throwIfNeeded(); | 465 exceptionState.throwIfNeeded(); |
465 return; | 466 return; |
466 } | 467 } |
467 } | 468 } |
468 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan
ce().create(info.GetIsolate(), info[0], ports.get(), &arrayBuffers, exceptionSta
te); | 469 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan
ce().create(info.GetIsolate(), info[0], ports.get(), &arrayBuffers, &imageBitmap
s, exceptionState); |
469 if (exceptionState.throwIfNeeded()) | 470 if (exceptionState.throwIfNeeded()) |
470 return; | 471 return; |
471 // FIXME: Only pass context/exceptionState if instance really requires it. | 472 // FIXME: Only pass context/exceptionState if instance really requires it. |
472 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); | 473 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); |
473 instance->postMessage(context, message.release(), ports.get(), exceptionStat
e); | 474 instance->postMessage(context, message.release(), ports.get(), exceptionStat
e); |
474 exceptionState.throwIfNeeded(); | 475 exceptionState.throwIfNeeded(); |
475 } | 476 } |
476 {% endmacro %} | 477 {% endmacro %} |
477 | 478 |
478 {##############################################################################} | 479 {##############################################################################} |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all | 685 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all |
685 if method.overloads else | 686 if method.overloads else |
686 method.runtime_enabled_function) %} | 687 method.runtime_enabled_function) %} |
687 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration
= {{method_configuration(method)}}; | 688 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration
= {{method_configuration(method)}}; |
688 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prototypeObj
ect, interfaceObject, defaultSignature, {{method.name}}MethodConfiguration); | 689 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prototypeObj
ect, interfaceObject, defaultSignature, {{method.name}}MethodConfiguration); |
689 {% endfilter %}{# runtime_enabled() #} | 690 {% endfilter %}{# runtime_enabled() #} |
690 {% endfilter %}{# exposed() #} | 691 {% endfilter %}{# exposed() #} |
691 {% endfor %} | 692 {% endfor %} |
692 {% endif %} | 693 {% endif %} |
693 {%- endmacro %} | 694 {%- endmacro %} |
OLD | NEW |