| 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; | |
| 462 if (info.Length() > 1) { | 461 if (info.Length() > 1) { |
| 463 const int transferablesArgIndex = 1; | 462 const int transferablesArgIndex = 1; |
| 464 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info
[transferablesArgIndex], transferablesArgIndex, *ports, arrayBuffers, imageBitma
ps, exceptionState)) { | 463 if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info
[transferablesArgIndex], transferablesArgIndex, *ports, arrayBuffers, exceptionS
tate)) { |
| 465 exceptionState.throwIfNeeded(); | 464 exceptionState.throwIfNeeded(); |
| 466 return; | 465 return; |
| 467 } | 466 } |
| 468 } | 467 } |
| 469 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan
ce().create(info.GetIsolate(), info[0], ports.get(), &arrayBuffers, &imageBitmap
s, exceptionState); | 468 RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instan
ce().create(info.GetIsolate(), info[0], ports.get(), &arrayBuffers, exceptionSta
te); |
| 470 if (exceptionState.throwIfNeeded()) | 469 if (exceptionState.throwIfNeeded()) |
| 471 return; | 470 return; |
| 472 // FIXME: Only pass context/exceptionState if instance really requires it. | 471 // FIXME: Only pass context/exceptionState if instance really requires it. |
| 473 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); | 472 ExecutionContext* context = currentExecutionContext(info.GetIsolate()); |
| 474 instance->postMessage(context, message.release(), ports.get(), exceptionStat
e); | 473 instance->postMessage(context, message.release(), ports.get(), exceptionStat
e); |
| 475 exceptionState.throwIfNeeded(); | 474 exceptionState.throwIfNeeded(); |
| 476 } | 475 } |
| 477 {% endmacro %} | 476 {% endmacro %} |
| 478 | 477 |
| 479 {##############################################################################} | 478 {##############################################################################} |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all | 684 {% filter runtime_enabled(method.overloads.runtime_enabled_function_all |
| 686 if method.overloads else | 685 if method.overloads else |
| 687 method.runtime_enabled_function) %} | 686 method.runtime_enabled_function) %} |
| 688 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration
= {{method_configuration(method)}}; | 687 const V8DOMConfiguration::MethodConfiguration {{method.name}}MethodConfiguration
= {{method_configuration(method)}}; |
| 689 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prototypeObj
ect, interfaceObject, defaultSignature, {{method.name}}MethodConfiguration); | 688 V8DOMConfiguration::installMethod(isolate, v8::Local<v8::Object>(), prototypeObj
ect, interfaceObject, defaultSignature, {{method.name}}MethodConfiguration); |
| 690 {% endfilter %}{# runtime_enabled() #} | 689 {% endfilter %}{# runtime_enabled() #} |
| 691 {% endfilter %}{# exposed() #} | 690 {% endfilter %}{# exposed() #} |
| 692 {% endfor %} | 691 {% endfor %} |
| 693 {% endif %} | 692 {% endif %} |
| 694 {%- endmacro %} | 693 {%- endmacro %} |
| OLD | NEW |