Changeset 101118 in webkit
- Timestamp:
- Nov 23, 2011 9:14:24 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r101114 r101118 1 2011-11-23 Dmitry Lomov <dslomov@google.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=73054 4 [V8][Chromium] Add list of transferred ArrayBuffers to SerializedScriptValue::create. 5 Tests rebaselined to reflect new error message. 6 7 Reviewed by David Levin. 8 9 * platform/chromium/fast/dom/Window/window-postmessage-args-expected.txt: 10 * platform/chromium/fast/events/constructors/message-event-constructor-expected.txt: 11 1 12 2011-11-23 Joshua Bell <jsbell@chromium.org> 2 13 -
trunk/LayoutTests/platform/chromium/fast/dom/Window/window-postmessage-args-expected.txt
r98175 r101118 1 1 Test that the second argument of window.postMessage is ignored or triggers an error if it is not a message port. You should see PASS message '1' through '7', followed by 'done', with messages 4-7 received below. 2 2 3 PASS: Posting message ('1', 1): threw exception TypeError: MessagePortArray argument must be an object4 PASS: Posting message ('1', 1): threw exception TypeError: MessagePortArray argument must be an object5 PASS: Posting message ('2', ): threw exception TypeError: MessagePortArray argument must be an object6 PASS: Posting message ('2', ): threw exception TypeError: MessagePortArray argument must be an object7 PASS: Posting message ('3', [object Object]): threw exception TypeError: MessagePortArray argument has no length attribute8 PASS: Posting message ('3', [object Object]): threw exception TypeError: MessagePortArray argument has no length attribute3 PASS: Posting message ('1', 1): threw exception TypeError: TransferArray argument must be an object 4 PASS: Posting message ('1', 1): threw exception TypeError: TransferArray argument must be an object 5 PASS: Posting message ('2', ): threw exception TypeError: TransferArray argument must be an object 6 PASS: Posting message ('2', ): threw exception TypeError: TransferArray argument must be an object 7 PASS: Posting message ('3', [object Object]): threw exception TypeError: TransferArray argument has no length attribute 8 PASS: Posting message ('3', [object Object]): threw exception TypeError: TransferArray argument has no length attribute 9 9 PASS: Posting message ('4', [object DOMWindow]) did not throw an exception 10 10 PASS: Posting message ('4', [object DOMWindow]) did not throw an exception -
trunk/LayoutTests/platform/chromium/fast/events/constructors/message-event-constructor-expected.txt
r97955 r101118 81 81 PASS new MessageEvent('eventType', { ports: undefined }).ports is [] 82 82 PASS new MessageEvent('eventType', { ports: null }).ports is [] 83 PASS new MessageEvent('eventType', { ports: [1, 2, 3] }).ports[2] threw exception TypeError: MessagePortArray argument must contain only MessagePorts.84 PASS new MessageEvent('eventType', { ports: test_object }).ports threw exception TypeError: MessagePortArray argument has no length attribute.85 PASS new MessageEvent('eventType', { ports: document }).ports threw exception TypeError: MessagePortArray argument has no length attribute.86 PASS new MessageEvent('eventType', { ports: false }).ports threw exception TypeError: MessagePortArray argument must be an object.87 PASS new MessageEvent('eventType', { ports: true }).ports threw exception TypeError: MessagePortArray argument must be an object.88 PASS new MessageEvent('eventType', { ports: '' }).ports threw exception TypeError: MessagePortArray argument must be an object.89 PASS new MessageEvent('eventType', { ports: 'chocolate' }).ports threw exception TypeError: MessagePortArray argument must be an object.90 PASS new MessageEvent('eventType', { ports: 12345 }).ports threw exception TypeError: MessagePortArray argument must be an object.91 PASS new MessageEvent('eventType', { ports: 18446744073709551615 }).ports threw exception TypeError: MessagePortArray argument must be an object.92 PASS new MessageEvent('eventType', { ports: NaN }).ports threw exception TypeError: MessagePortArray argument must be an object.93 PASS new MessageEvent('eventType', { get ports() { return 123; } }).ports threw exception TypeError: MessagePortArray argument must be an object.83 PASS new MessageEvent('eventType', { ports: [1, 2, 3] }).ports[2] threw exception TypeError: TransferArray argument must contain only Transferables. 84 PASS new MessageEvent('eventType', { ports: test_object }).ports threw exception TypeError: TransferArray argument has no length attribute. 85 PASS new MessageEvent('eventType', { ports: document }).ports threw exception TypeError: TransferArray argument has no length attribute. 86 PASS new MessageEvent('eventType', { ports: false }).ports threw exception TypeError: TransferArray argument must be an object. 87 PASS new MessageEvent('eventType', { ports: true }).ports threw exception TypeError: TransferArray argument must be an object. 88 PASS new MessageEvent('eventType', { ports: '' }).ports threw exception TypeError: TransferArray argument must be an object. 89 PASS new MessageEvent('eventType', { ports: 'chocolate' }).ports threw exception TypeError: TransferArray argument must be an object. 90 PASS new MessageEvent('eventType', { ports: 12345 }).ports threw exception TypeError: TransferArray argument must be an object. 91 PASS new MessageEvent('eventType', { ports: 18446744073709551615 }).ports threw exception TypeError: TransferArray argument must be an object. 92 PASS new MessageEvent('eventType', { ports: NaN }).ports threw exception TypeError: TransferArray argument must be an object. 93 PASS new MessageEvent('eventType', { get ports() { return 123; } }).ports threw exception TypeError: TransferArray argument must be an object. 94 94 PASS new MessageEvent('eventType', { get ports() { throw 'MessageEvent Error'; } }) threw exception MessageEvent Error. 95 PASS new MessageEvent('eventType', { ports: {valueOf: function () { return [channel.port1, channel.port2, channel.port2]; } } }).ports[0] threw exception TypeError: MessagePortArray argument has no length attribute.95 PASS new MessageEvent('eventType', { ports: {valueOf: function () { return [channel.port1, channel.port2, channel.port2]; } } }).ports[0] threw exception TypeError: TransferArray argument has no length attribute. 96 96 PASS new MessageEvent('eventType', { bubbles: true, cancelable: true, data: test_object, origin: 'wonderful', lastEventId: 'excellent', source: window, ports: [channel.port1, channel.port2, channel.port2] }).bubbles is true 97 97 PASS new MessageEvent('eventType', { bubbles: true, cancelable: true, data: test_object, origin: 'wonderful', lastEventId: 'excellent', source: window, ports: [channel.port1, channel.port2, channel.port2] }).cancelable is true -
trunk/Source/WebCore/ChangeLog
r101117 r101118 1 2011-11-23 Dmitry Lomov <dslomov@google.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=73054 4 [V8][Chromium] Add list of transferred ArrayBuffers to SerializedScriptValue::create. 5 6 Reviewed by David Levin. 7 8 * bindings/scripts/CodeGeneratorV8.pm: 9 (GenerateParametersCheck): 10 * bindings/scripts/test/V8/V8TestObj.cpp: 11 (WebCore::TestObjInternal::serializedValueCallback): 12 * bindings/v8/OptionsObject.cpp: 13 * bindings/v8/SerializedScriptValue.cpp: 14 (WebCore::SerializedScriptValue::create): 15 * bindings/v8/SerializedScriptValue.h: 16 * bindings/v8/V8Utilities.cpp: 17 (WebCore::extractTransferables): 18 (WebCore::getMessagePortArray): 19 * bindings/v8/V8Utilities.h: 20 * bindings/v8/custom/V8DOMWindowCustom.cpp: 21 (WebCore::handlePostMessageCallback): 22 * bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp: 23 (WebCore::handlePostMessageCallback): 24 * bindings/v8/custom/V8HistoryCustom.cpp: 25 (WebCore::V8History::pushStateCallback): 26 (WebCore::V8History::replaceStateCallback): 27 * bindings/v8/custom/V8MessageEventCustom.cpp: 28 * bindings/v8/custom/V8MessagePortCustom.cpp: 29 (WebCore::handlePostMessageCallback): 30 * bindings/v8/custom/V8MessagePortCustom.h: Removed. 31 * bindings/v8/custom/V8WorkerCustom.cpp: 32 (WebCore::handlePostMessageCallback): 33 1 34 2011-11-23 Rafael Weinstein <rafaelw@chromium.org> 2 35 -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
r101102 r101118 1473 1473 AddToImplIncludes("SerializedScriptValue.h"); 1474 1474 $parameterCheckString .= " bool ${parameterName}DidThrow = false;\n"; 1475 $parameterCheckString .= " $nativeType $parameterName = SerializedScriptValue::create(args[$paramIndex], 0, ${parameterName}DidThrow);\n";1475 $parameterCheckString .= " $nativeType $parameterName = SerializedScriptValue::create(args[$paramIndex], 0, 0, ${parameterName}DidThrow);\n"; 1476 1476 $parameterCheckString .= " if (${parameterName}DidThrow)\n"; 1477 1477 $parameterCheckString .= " return v8::Undefined();\n"; -
trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
r101102 r101118 800 800 TestObj* imp = V8TestObj::toNative(args.Holder()); 801 801 bool serializedArgDidThrow = false; 802 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(args[0], 0, serializedArgDidThrow);802 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(args[0], 0, 0, serializedArgDidThrow); 803 803 if (serializedArgDidThrow) 804 804 return v8::Undefined(); -
trunk/Source/WebCore/bindings/v8/OptionsObject.cpp
r99992 r101118 30 30 #include "V8Binding.h" 31 31 #include "V8DOMWindow.h" 32 #include "V8 MessagePortCustom.h"32 #include "V8Utilities.h" 33 33 #include <wtf/MathExtras.h> 34 34 -
trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp
r100239 r101118 1989 1989 } 1990 1990 1991 PassRefPtr<SerializedScriptValue> SerializedScriptValue::create(v8::Handle<v8::Value> value, MessagePortArray* messagePorts, bool& didThrow) 1991 PassRefPtr<SerializedScriptValue> SerializedScriptValue::create(v8::Handle<v8::Value> value, 1992 MessagePortArray* messagePorts, ArrayBufferArray*, 1993 bool& didThrow) 1992 1994 { 1993 1995 return adoptRef(new SerializedScriptValue(value, messagePorts, didThrow)); -
trunk/Source/WebCore/bindings/v8/SerializedScriptValue.h
r99229 r101118 36 36 #include <wtf/Threading.h> 37 37 38 namespace WTF { 39 class ArrayBuffer; 40 } 41 38 42 namespace WebCore { 39 43 … … 41 45 42 46 typedef Vector<RefPtr<MessagePort>, 1> MessagePortArray; 47 typedef Vector<RefPtr<WTF::ArrayBuffer>, 1> ArrayBufferArray; 43 48 44 49 class SerializedScriptValue : public ThreadSafeRefCounted<SerializedScriptValue> { … … 54 59 // the caller must not invoke any V8 operations until control returns to 55 60 // V8. When serialization is successful, |didThrow| is false. 56 static PassRefPtr<SerializedScriptValue> create(v8::Handle<v8::Value>, MessagePortArray*, bool& didThrow); 61 static PassRefPtr<SerializedScriptValue> create(v8::Handle<v8::Value>, 62 MessagePortArray*, ArrayBufferArray*, 63 bool& didThrow); 57 64 static PassRefPtr<SerializedScriptValue> create(v8::Handle<v8::Value>); 58 65 static PassRefPtr<SerializedScriptValue> createFromWire(const String& data); -
trunk/Source/WebCore/bindings/v8/V8Utilities.cpp
r95901 r101118 32 32 #include "V8Utilities.h" 33 33 34 #include <v8.h> 35 34 #include "ArrayBuffer.h" 36 35 #include "Document.h" 36 #include "ExceptionCode.h" 37 37 #include "Frame.h" 38 #include "MessagePort.h" 38 39 #include "ScriptExecutionContext.h" 39 40 #include "ScriptState.h" 41 #include "V8ArrayBuffer.h" 40 42 #include "V8Binding.h" 41 43 #include "V8BindingState.h" 44 #include "V8MessagePort.h" 42 45 #include "V8Proxy.h" 43 46 #include "WorkerContext.h" … … 46 49 #include <wtf/Assertions.h> 47 50 #include "Frame.h" 51 52 #include <v8.h> 48 53 49 54 namespace WebCore { … … 75 80 v8::Local<v8::Array> cacheArray = v8::Local<v8::Array>::Cast(cache); 76 81 cacheArray->Set(v8::Integer::New(cacheArray->Length()), value); 82 } 83 84 bool extractTransferables(v8::Local<v8::Value> value, MessagePortArray& ports, ArrayBufferArray& arrayBuffers) 85 { 86 if (isUndefinedOrNull(value)) { 87 ports.resize(0); 88 arrayBuffers.resize(0); 89 return true; 90 } 91 92 if (!value->IsObject()) { 93 throwError("TransferArray argument must be an object"); 94 return false; 95 } 96 uint32_t length = 0; 97 v8::Local<v8::Object> transferrables = v8::Local<v8::Object>::Cast(value); 98 99 if (value->IsArray()) { 100 v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(value); 101 length = array->Length(); 102 } else { 103 // Sequence-type object - get the length attribute 104 v8::Local<v8::Value> sequenceLength = transferrables->Get(v8::String::New("length")); 105 if (!sequenceLength->IsNumber()) { 106 throwError("TransferArray argument has no length attribute"); 107 return false; 108 } 109 length = sequenceLength->Uint32Value(); 110 } 111 112 // Validate the passed array of transferrables. 113 for (unsigned int i = 0; i < length; ++i) { 114 v8::Local<v8::Value> transferrable = transferrables->Get(i); 115 // Validation of non-null objects, per HTML5 spec 10.3.3. 116 if (isUndefinedOrNull(transferrable)) { 117 throwError(DATA_CLONE_ERR); 118 return false; 119 } 120 // Validation of Objects implementing an interface, per WebIDL spec 4.1.15. 121 if (V8MessagePort::HasInstance(transferrable)) 122 ports.append(V8MessagePort::toNative(v8::Handle<v8::Object>::Cast(transferrable))); 123 else if (V8ArrayBuffer::HasInstance(transferrable)) 124 arrayBuffers.append(V8ArrayBuffer::toNative(v8::Handle<v8::Object>::Cast(transferrable))); 125 else { 126 throwError("TransferArray argument must contain only Transferables"); 127 return false; 128 } 129 } 130 return true; 131 } 132 133 bool getMessagePortArray(v8::Local<v8::Value> value, MessagePortArray& ports) 134 { 135 ArrayBufferArray arrayBuffers; 136 bool result = extractTransferables(value, ports, arrayBuffers); 137 if (!result) 138 return false; 139 if (arrayBuffers.size() > 0) { 140 throwError("MessagePortArray argument must contain only MessagePorts"); 141 return false; 142 } 143 return true; 77 144 } 78 145 -
trunk/Source/WebCore/bindings/v8/V8Utilities.h
r95901 r101118 37 37 #include "OwnHandle.h" 38 38 39 namespace WTF { 40 class ArrayBuffer; 41 } 42 39 43 namespace WebCore { 40 44 … … 42 46 class Frame; 43 47 class KURL; 48 class MessagePort; 44 49 class ScriptExecutionContext; 45 50 class ScriptState; … … 75 80 }; 76 81 82 typedef WTF::Vector<RefPtr<MessagePort>, 1> MessagePortArray; 83 typedef WTF::Vector<RefPtr<ArrayBuffer>, 1> ArrayBufferArray; 84 85 // Helper function which pulls the values out of a JS sequence and into a MessagePortArray. 86 // Also validates the elements per sections 4.1.13 and 4.1.15 of the WebIDL spec and section 8.3.3 87 // of the HTML5 spec and generates exceptions as appropriate. 88 // Returns true if the array was filled, or false if the passed value was not of an appropriate type. 89 bool extractTransferables(v8::Local<v8::Value>, MessagePortArray&, ArrayBufferArray&); 90 bool getMessagePortArray(v8::Local<v8::Value>, MessagePortArray&); 91 77 92 // 'FunctionOnly' is assumed for the created callback. 78 93 template <typename V8CallbackType> -
trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
r100740 r101118 32 32 #include "V8DOMWindow.h" 33 33 34 #include "ArrayBuffer.h" 34 35 #include "Chrome.h" 35 36 #include "ContentSecurityPolicy.h" … … 43 44 #include "HTMLDocument.h" 44 45 #include "MediaPlayer.h" 46 #include "MessagePort.h" 45 47 #include "Page.h" 46 48 #include "PlatformScreen.h" … … 58 60 #include "V8HiddenPropertyName.h" 59 61 #include "V8HTMLCollection.h" 60 #include "V8MessagePortCustom.h"61 62 #include "V8Node.h" 62 63 #include "V8Proxy.h" … … 298 299 // postMessage(message, targetOrigin); 299 300 MessagePortArray portArray; 301 ArrayBufferArray arrayBufferArray; 300 302 String targetOrigin; 301 303 { 302 304 v8::TryCatch tryCatch; 303 305 if (args.Length() > 2) { 304 if (! getMessagePortArray(args[1], portArray))306 if (!extractTransferables(args[1], portArray, arrayBufferArray)) 305 307 return v8::Undefined(); 306 308 targetOrigin = toWebCoreStringWithNullOrUndefinedCheck(args[2]); … … 314 316 315 317 bool didThrow = false; 316 RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(args[0], doTransfer ? &portArray : 0, didThrow); 318 RefPtr<SerializedScriptValue> message = 319 SerializedScriptValue::create(args[0], 320 doTransfer ? &portArray : 0, 321 doTransfer ? &arrayBufferArray : 0, 322 didThrow); 317 323 if (didThrow) 318 324 return v8::Undefined(); -
trunk/Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp
r97516 r101118 34 34 #include "V8DedicatedWorkerContext.h" 35 35 36 #include "ArrayBuffer.h" 36 37 #include "DedicatedWorkerContext.h" 37 38 #include "WorkerContextExecutionProxy.h" 38 39 #include "V8Binding.h" 39 #include "V8MessagePortCustom.h"40 40 #include "V8Proxy.h" 41 #include "V8Utilities.h" 41 42 #include "V8WorkerContextEventListener.h" 42 43 … … 46 47 { 47 48 DedicatedWorkerContext* workerContext = V8DedicatedWorkerContext::toNative(args.Holder()); 48 MessagePortArray portArray; 49 MessagePortArray ports; 50 ArrayBufferArray arrayBuffers; 49 51 if (args.Length() > 1) { 50 if (! getMessagePortArray(args[1], portArray))52 if (!extractTransferables(args[1], ports, arrayBuffers)) 51 53 return v8::Undefined(); 52 54 } 53 55 bool didThrow = false; 54 RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(args[0], doTransfer ? &portArray : 0, didThrow); 56 RefPtr<SerializedScriptValue> message = 57 SerializedScriptValue::create(args[0], 58 doTransfer ? &ports : 0, 59 doTransfer ? &arrayBuffers : 0, 60 didThrow); 55 61 if (didThrow) 56 62 return v8::Undefined(); 57 58 workerContext->postMessage(message.release(), &port Array, ec);63 ExceptionCode ec = 0; 64 workerContext->postMessage(message.release(), &ports, ec); 59 65 return throwError(ec); 60 66 } -
trunk/Source/WebCore/bindings/v8/custom/V8HistoryCustom.cpp
r97516 r101118 45 45 { 46 46 bool didThrow = false; 47 RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(args[0], 0, didThrow);47 RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(args[0], 0, 0, didThrow); 48 48 if (didThrow) 49 49 return v8::Undefined(); … … 69 69 { 70 70 bool didThrow = false; 71 RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(args[0], 0, didThrow);71 RefPtr<SerializedScriptValue> historyState = SerializedScriptValue::create(args[0], 0, 0, didThrow); 72 72 if (didThrow) 73 73 return v8::Undefined(); -
trunk/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp
r98934 r101118 40 40 #include "V8DOMWindow.h" 41 41 #include "V8MessagePort.h" 42 #include "V8MessagePortCustom.h"43 42 #include "V8Proxy.h" 44 43 -
trunk/Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp
r97516 r101118 31 31 #include "config.h" 32 32 33 #include "ArrayBuffer.h" 33 34 #include "ExceptionCode.h" 34 35 #include "MessagePort.h" 35 36 #include "SerializedScriptValue.h" 36 37 #include "V8Binding.h" 37 #include "V8MessagePortCustom.h"38 38 #include "V8MessagePort.h" 39 39 #include "V8Proxy.h" … … 47 47 MessagePort* messagePort = V8MessagePort::toNative(args.Holder()); 48 48 MessagePortArray portArray; 49 ArrayBufferArray arrayBufferArray; 49 50 if (args.Length() > 1) { 50 if (! getMessagePortArray(args[1], portArray))51 if (!extractTransferables(args[1], portArray, arrayBufferArray)) 51 52 return v8::Undefined(); 52 53 } 53 54 bool didThrow = false; 54 RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(args[0], doTransfer ? &portArray : 0, didThrow); 55 RefPtr<SerializedScriptValue> message = 56 SerializedScriptValue::create(args[0], 57 doTransfer ? &portArray : 0, 58 doTransfer ? &arrayBufferArray : 0, 59 didThrow); 55 60 if (didThrow) 56 61 return v8::Undefined(); … … 72 77 } 73 78 74 bool getMessagePortArray(v8::Local<v8::Value> value, MessagePortArray& portArray)75 {76 if (isUndefinedOrNull(value)) {77 portArray.resize(0);78 return true;79 }80 81 if (!value->IsObject()) {82 throwError("MessagePortArray argument must be an object");83 return false;84 }85 uint32_t length = 0;86 v8::Local<v8::Object> ports = v8::Local<v8::Object>::Cast(value);87 88 if (value->IsArray()) {89 v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(value);90 length = array->Length();91 } else {92 // Sequence-type object - get the length attribute93 v8::Local<v8::Value> sequenceLength = ports->Get(v8::String::New("length"));94 if (!sequenceLength->IsNumber()) {95 throwError("MessagePortArray argument has no length attribute");96 return false;97 }98 length = sequenceLength->Uint32Value();99 }100 101 // Validate the passed array of ports.102 for (unsigned int i = 0; i < length; ++i) {103 v8::Local<v8::Value> port = ports->Get(i);104 // Validation of non-null objects, per HTML5 spec 10.3.3.105 if (isUndefinedOrNull(port)) {106 throwError(DATA_CLONE_ERR);107 return false;108 }109 // Validation of Objects implementing an interface, per WebIDL spec 4.1.15.110 if (!V8MessagePort::HasInstance(port)) {111 throwError("MessagePortArray argument must contain only MessagePorts");112 return false;113 }114 portArray.append(V8MessagePort::toNative(v8::Handle<v8::Object>::Cast(port)));115 }116 return true;117 }118 119 79 } // namespace WebCore -
trunk/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp
r97516 r101118 36 36 #include "Worker.h" 37 37 38 #include "ArrayBuffer.h" 38 39 #include "ExceptionCode.h" 39 40 #include "Frame.h" 40 41 #include "SerializedScriptValue.h" 41 42 #include "V8Binding.h" 42 #include "V8MessagePortCustom.h"43 43 #include "V8Proxy.h" 44 44 #include "V8Utilities.h" … … 52 52 INC_STATS("DOM.Worker.postMessage"); 53 53 Worker* worker = V8Worker::toNative(args.Holder()); 54 MessagePortArray portArray; 54 MessagePortArray ports; 55 ArrayBufferArray arrayBuffers; 55 56 if (args.Length() > 1) { 56 if (! getMessagePortArray(args[1], portArray))57 if (!extractTransferables(args[1], ports, arrayBuffers)) 57 58 return v8::Undefined(); 58 59 } 59 60 bool didThrow = false; 60 RefPtr<SerializedScriptValue> message = SerializedScriptValue::create(args[0], doTransfer ? &portArray : 0, didThrow); 61 RefPtr<SerializedScriptValue> message = 62 SerializedScriptValue::create(args[0], 63 doTransfer ? &ports : 0, 64 doTransfer ? &arrayBuffers : 0, 65 didThrow); 61 66 if (didThrow) 62 67 return v8::Undefined(); 63 68 ExceptionCode ec = 0; 64 worker->postMessage(message.release(), &port Array, ec);69 worker->postMessage(message.release(), &ports, ec); 65 70 return throwError(ec); 66 71 } -
trunk/Source/WebKit/chromium/ChangeLog
r101115 r101118 1 2011-11-23 Dmitry Lomov <dslomov@google.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=73054 4 [V8][Chromium] Add list of transferred ArrayBuffers to SerializedScriptValue::create. 5 6 Reviewed by David Levin. 7 8 * src/WebSerializedScriptValue.cpp: 9 (WebKit::WebSerializedScriptValue::serialize): 10 1 11 2011-11-23 Ami Fischman <fischman@chromium.org> 2 12 -
trunk/Source/WebKit/chromium/src/WebSerializedScriptValue.cpp
r97516 r101118 48 48 { 49 49 bool didThrow; 50 WebSerializedScriptValue serializedValue = SerializedScriptValue::create(value, 0, didThrow);50 WebSerializedScriptValue serializedValue = SerializedScriptValue::create(value, 0, 0, didThrow); 51 51 if (didThrow) 52 52 return createInvalid();
Note: See TracChangeset
for help on using the changeset viewer.