Changeset 122628 in webkit
- Timestamp:
- Jul 13, 2012 1:45:55 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r122626 r122628 1 2012-07-13 Vineet Chaudhary <rgf748@motorola.com> 2 3 Restructure V8Utilities::extractTransferables() with help of toV8Sequence() 4 https://bugs.webkit.org/show_bug.cgi?id=91208 5 6 Reviewed by Kentaro Hara. 7 8 We can remove the specialised check for MessagePort from V8Utilities::extractTransferables() 9 using toV8Sequence() as it validates the passed object for sequence type per WebIDL spec. 10 Removing port specific expected results. 11 12 * platform/chromium-win/fast/workers/worker-context-multi-port-expected.txt: Removed. 13 * platform/chromium-win/fast/workers/worker-multi-port-expected.txt: Removed. 14 * platform/chromium/fast/dom/Window/window-postmessage-args-expected.txt: Removed. 15 * platform/chromium/fast/events/constructors/message-event-constructor-expected.txt: Removed. 16 * platform/chromium/fast/events/message-port-multi-expected.txt: Rebaselined. 17 1 18 2012-07-13 Vincent Scheib <scheib@chromium.org> 2 19 -
trunk/LayoutTests/platform/chromium/fast/events/message-port-multi-expected.txt
r109233 r122628 7 7 PASS channel.port1.postMessage("entangled port", [channel.port2]) threw exception Error: DATA_CLONE_ERR: DOM Exception 25. 8 8 PASS channel.port1.postMessage("null port", [channel3.port1, null, channel3.port2]) threw exception Error: DATA_CLONE_ERR: DOM Exception 25. 9 PASS channel.port1.postMessage("notAPort", [channel3.port1, {}, channel3.port2]) threw exception TypeError: T ransferArray argument must contain only Transferables.10 PASS channel.port1.postMessage("notAnArray", channel3.port1) threw exception TypeError: T ransferArray argument has no length attribute.11 PASS channel.port1.postMessage("notASequence", [{length: 3}]) threw exception TypeError: T ransferArray argument must contain only Transferables.9 PASS channel.port1.postMessage("notAPort", [channel3.port1, {}, channel3.port2]) threw exception TypeError: Type error. 10 PASS channel.port1.postMessage("notAnArray", channel3.port1) threw exception TypeError: Type error. 11 PASS channel.port1.postMessage("notASequence", [{length: 3}]) threw exception TypeError: Type error. 12 12 PASS channel.port1.postMessage("largeSequence", largePortArray) threw exception Error: DATA_CLONE_ERR: DOM Exception 25. 13 13 PASS event.ports is non-null and zero length when no port sent -
trunk/Source/WebCore/ChangeLog
r122626 r122628 1 2012-07-13 Vineet Chaudhary <rgf748@motorola.com> 2 3 Restructure V8Utilities::extractTransferables() with help of toV8Sequence() 4 https://bugs.webkit.org/show_bug.cgi?id=91208 5 6 Reviewed by Kentaro Hara. 7 8 We can remove the specialised check for MessagePort from V8Utilities::extractTransferables() 9 using toV8Sequence() as it validates the passed object for sequence type per WebIDL spec. 10 11 No new test as just refactoring. 12 Existing tests under fast/dom/Window/window-* fast/dom/events/* 13 covers tests. 14 15 * bindings/v8/V8Utilities.cpp: 16 (WebCore::extractTransferables): 17 1 18 2012-07-13 Vincent Scheib <scheib@chromium.org> 2 19 -
trunk/Source/WebCore/bindings/v8/V8Utilities.cpp
r121538 r122628 93 93 } 94 94 95 if (!value->IsObject()) {96 V8Proxy::throwTypeError("TransferArray argument must be an object");97 return false;98 }99 95 uint32_t length = 0; 100 v8::Local<v8::Object> transferrables = v8::Local<v8::Object>::Cast(value);101 102 96 if (value->IsArray()) { 103 97 v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(value); 104 98 length = array->Length(); 105 99 } else { 106 // Sequence-type object - get the length attribute 107 v8::Local<v8::Value> sequenceLength = transferrables->Get(v8::String::New("length")); 108 if (!sequenceLength->IsNumber()) { 109 V8Proxy::throwTypeError("TransferArray argument has no length attribute"); 100 if (toV8Sequence(value, length).IsEmpty()) 110 101 return false; 111 112 length = sequenceLength->Uint32Value(); 113 }102 } 103 104 v8::Local<v8::Object> transferrables = v8::Local<v8::Object>::Cast(value); 114 105 115 106 // Validate the passed array of transferrables. … … 127 118 arrayBuffers.append(V8ArrayBuffer::toNative(v8::Handle<v8::Object>::Cast(transferrable))); 128 119 else { 129 V8Proxy::throwTypeError( "TransferArray argument must contain only Transferables");120 V8Proxy::throwTypeError(); 130 121 return false; 131 122 }
Note: See TracChangeset
for help on using the changeset viewer.