| Index: third_party/WebKit/Source/bindings/templates/methods.cpp
|
| diff --git a/third_party/WebKit/Source/bindings/templates/methods.cpp b/third_party/WebKit/Source/bindings/templates/methods.cpp
|
| index b9596505888cabb42b1751519a7984d0e83024a8..cac64f07fee5cdc6c7be5c8e52f4af89d0704ac3 100644
|
| --- a/third_party/WebKit/Source/bindings/templates/methods.cpp
|
| +++ b/third_party/WebKit/Source/bindings/templates/methods.cpp
|
| @@ -464,25 +464,20 @@ void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance, const v
|
| exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| - TransferableArray* transferables = new TransferableArray;
|
| + Transferables transferables;
|
| if (info.Length() > 1) {
|
| const int transferablesArgIndex = 1;
|
| - if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info[transferablesArgIndex], transferablesArgIndex, *transferables, exceptionState)) {
|
| + if (!SerializedScriptValue::extractTransferables(info.GetIsolate(), info[transferablesArgIndex], transferablesArgIndex, transferables, exceptionState)) {
|
| exceptionState.throwIfNeeded();
|
| return;
|
| }
|
| }
|
| - RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instance().create(info.GetIsolate(), info[0], transferables, exceptionState);
|
| + RefPtr<SerializedScriptValue> message = SerializedScriptValueFactory::instance().create(info.GetIsolate(), info[0], &transferables, exceptionState);
|
| if (exceptionState.throwIfNeeded())
|
| return;
|
| // FIXME: Only pass context/exceptionState if instance really requires it.
|
| ExecutionContext* context = currentExecutionContext(info.GetIsolate());
|
| - MessagePortArray* ports;
|
| - if (auto* messagePorts = TransferableMessagePort::get(*transferables))
|
| - ports = &(messagePorts->getArray());
|
| - else
|
| - ports = new MessagePortArray;
|
| - instance->postMessage(context, message.release(), ports, exceptionState);
|
| + instance->postMessage(context, message.release(), transferables.messagePorts, exceptionState);
|
| exceptionState.throwIfNeeded();
|
| }
|
| {% endmacro %}
|
|
|