Changeset 194625 in webkit
- Timestamp:
- Jan 5, 2016 6:08:23 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r194617 r194625 1 2016-01-05 Brady Eidson <beidson@apple.com> 2 3 Modern IDB: storage/indexeddb/structured-clone.html crashes. 4 https://bugs.webkit.org/show_bug.cgi?id=152763 5 6 Reviewed by Alex Christensen. 7 8 * platform/mac-wk1/TestExpectations: 9 * storage/indexeddb/clone-exception-expected.txt: 10 * storage/indexeddb/exceptions-expected.txt: 11 * storage/indexeddb/objectstore-basics-expected.txt: 12 * storage/indexeddb/structured-clone-expected.txt: 13 1 14 2016-01-05 Pranjal Jumde <pjumde@apple.com> 2 15 -
trunk/LayoutTests/platform/mac-wk1/TestExpectations
r194605 r194625 72 72 storage/indexeddb/key-generator.html [ Skip ] 73 73 storage/indexeddb/lazy-index-population.html [ Skip ] 74 75 # IDB tests that crash/assert in CloneDeserializer76 storage/indexeddb/structured-clone.html [ Skip ]77 74 78 75 # IDB tests that crash with GuardMalloc or ASan -
trunk/LayoutTests/storage/indexeddb/clone-exception-expected.txt
r164000 r194625 14 14 PASS code is 25 15 15 PASS ename is 'DataCloneError' 16 Exception message: DataCloneError: DOM Exception 2516 Exception message: Failed to store record in an IDBObjectStore: An object could not be cloned. 17 17 18 18 doSecondOpen(): … … 24 24 PASS code is 25 25 25 PASS ename is 'DataCloneError' 26 Exception message: DataCloneError: DOM Exception 2526 Exception message: Failed to store record in an IDBObjectStore: An object could not be cloned. 27 27 28 28 doThirdOpen(): … … 34 34 PASS code is 25 35 35 PASS ename is 'DataCloneError' 36 Exception message: DataCloneError: DOM Exception 2536 Exception message: Failed to store record in an IDBObjectStore: An object could not be cloned. 37 37 PASS successfullyParsed is true 38 38 -
trunk/LayoutTests/storage/indexeddb/exceptions-expected.txt
r193632 r194625 161 161 PASS Exception was thrown. 162 162 PASS code is DOMException.DATA_CLONE_ERR 163 Exception message: DataCloneError: DOM Exception 25163 Exception message: Failed to store record in an IDBObjectStore: An object could not be cloned. 164 164 165 165 IDBObjectStore.clear() … … 274 274 PASS Exception was thrown. 275 275 PASS code is DOMException.DATA_CLONE_ERR 276 Exception message: DataCloneError: DOM Exception 25276 Exception message: Failed to store record in an IDBObjectStore: An object could not be cloned. 277 277 db.close() 278 278 ro_transaction.oncomplete = transactionComplete … … 506 506 PASS Exception was thrown. 507 507 PASS code is DOMException.DATA_CLONE_ERR 508 Exception message: DataCloneError: DOM Exception 25508 Exception message: Failed to store record in an IDBObjectStore: An object could not be cloned. 509 509 The transaction this IDBCursor belongs to is not active. 510 510 Expecting exception from cursorFromInactiveTransaction.update({}) -
trunk/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
r193892 r194625 96 96 PASS Exception was thrown. 97 97 PASS code is DOMException.DATA_CLONE_ERR 98 Exception message: DataCloneError: DOM Exception 2598 Exception message: Failed to store record in an IDBObjectStore: An object could not be cloned. 99 99 Try to insert data where key path yields a Date key: 100 100 store.add({x: testDateB, y: 'value'}, 'key') -
trunk/LayoutTests/storage/indexeddb/structured-clone-expected.txt
r163963 r194625 784 784 PASS Exception was thrown. 785 785 PASS code is DOMException.DATA_CLONE_ERR 786 Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned.786 Exception message: Failed to store record in an IDBObjectStore: An object could not be cloned. 787 787 Expecting exception from store.put(new Function, 'key') 788 788 PASS Exception was thrown. 789 789 PASS code is DOMException.DATA_CLONE_ERR 790 Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned.790 Exception message: Failed to store record in an IDBObjectStore: An object could not be cloned. 791 791 792 792 Other host object types: … … 794 794 PASS Exception was thrown. 795 795 PASS code is DOMException.DATA_CLONE_ERR 796 Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned.796 Exception message: Failed to store record in an IDBObjectStore: An object could not be cloned. 797 797 Expecting exception from store.put(document, 'key') 798 798 PASS Exception was thrown. 799 799 PASS code is DOMException.DATA_CLONE_ERR 800 Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned.800 Exception message: Failed to store record in an IDBObjectStore: An object could not be cloned. 801 801 Expecting exception from store.put(document.body, 'key') 802 802 PASS Exception was thrown. 803 803 PASS code is DOMException.DATA_CLONE_ERR 804 Exception message: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned.804 Exception message: Failed to store record in an IDBObjectStore: An object could not be cloned. 805 805 PASS successfullyParsed is true 806 806 -
trunk/Source/WebCore/ChangeLog
r194617 r194625 1 2016-01-05 Brady Eidson <beidson@apple.com> 2 3 Modern IDB: storage/indexeddb/structured-clone.html crashes. 4 https://bugs.webkit.org/show_bug.cgi?id=152763 5 6 Reviewed by Alex Christensen. 7 8 No new tests (At least one failing test now passes). 9 10 A lot of SerializedScriptValue code incorrectly assumed the global object is a JSDOMGlobalObject, 11 which doesn't have to be true for native Javascript types like typed arrays. 12 13 Fixing that fixes the test. 14 15 * Modules/indexeddb/client/IDBObjectStoreImpl.cpp: 16 (WebCore::IDBClient::IDBObjectStore::putOrAdd): If serializing the script value caused an exception, 17 clear that exception and return a better IDB specific exception. 18 19 * bindings/js/JSDOMBinding.h: 20 (WebCore::toJS): Add a ArrayBufferView specialization for toJS that skips the need for a JSDOMGlobalObject. 21 22 * bindings/js/SerializedScriptValue.cpp: 23 (WebCore::CloneDeserializer::readArrayBufferView): Call toJS directly instead of getJSValue, which 24 incorrectly assumes the existence of a JSDOMGlobalObject (vs a JSGlobalObject) 25 (WebCore::CloneDeserializer::readTerminal): Instead of getJSValue, call JSArrayBuffer::create directly. 26 1 27 2016-01-05 Pranjal Jumde <pjumde@apple.com> 2 28 -
trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp
r194595 r194625 266 266 RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create(&state, value, nullptr, nullptr); 267 267 if (state.hadException()) { 268 // Clear the DOM exception from the serializer so we can give a more targeted exception. 269 state.clearException(); 270 268 271 ec.code = IDBDatabaseException::DataCloneError; 269 272 ec.message = ASCIILiteral("Failed to store record in an IDBObjectStore: An object could not be cloned."); -
trunk/Source/WebCore/bindings/js/JSDOMBinding.h
r194369 r194625 412 412 } 413 413 414 inline JSC::JSValue toJS(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, JSC::ArrayBufferView* view) 415 { 416 if (!view) 417 return JSC::jsNull(); 418 return view->wrap(exec, globalObject); 419 } 420 414 421 template<typename T> inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, RefPtr<T> ptr) 415 422 { -
trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp
r194496 r194625 1816 1816 return true; 1817 1817 case Int8ArrayTag: 1818 arrayBufferView = getJSValue(Int8Array::create(arrayBuffer, byteOffset, length).get());1818 arrayBufferView = toJS(m_exec, m_globalObject, Int8Array::create(arrayBuffer, byteOffset, length).get()); 1819 1819 return true; 1820 1820 case Uint8ArrayTag: 1821 arrayBufferView = getJSValue(Uint8Array::create(arrayBuffer, byteOffset, length).get());1821 arrayBufferView = toJS(m_exec, m_globalObject, Uint8Array::create(arrayBuffer, byteOffset, length).get()); 1822 1822 return true; 1823 1823 case Uint8ClampedArrayTag: 1824 arrayBufferView = getJSValue(Uint8ClampedArray::create(arrayBuffer, byteOffset, length).get());1824 arrayBufferView = toJS(m_exec, m_globalObject, Uint8ClampedArray::create(arrayBuffer, byteOffset, length).get()); 1825 1825 return true; 1826 1826 case Int16ArrayTag: 1827 arrayBufferView = getJSValue(Int16Array::create(arrayBuffer, byteOffset, length).get());1827 arrayBufferView = toJS(m_exec, m_globalObject, Int16Array::create(arrayBuffer, byteOffset, length).get()); 1828 1828 return true; 1829 1829 case Uint16ArrayTag: 1830 arrayBufferView = getJSValue(Uint16Array::create(arrayBuffer, byteOffset, length).get());1830 arrayBufferView = toJS(m_exec, m_globalObject, Uint16Array::create(arrayBuffer, byteOffset, length).get()); 1831 1831 return true; 1832 1832 case Int32ArrayTag: 1833 arrayBufferView = getJSValue(Int32Array::create(arrayBuffer, byteOffset, length).get());1833 arrayBufferView = toJS(m_exec, m_globalObject, Int32Array::create(arrayBuffer, byteOffset, length).get()); 1834 1834 return true; 1835 1835 case Uint32ArrayTag: 1836 arrayBufferView = getJSValue(Uint32Array::create(arrayBuffer, byteOffset, length).get());1836 arrayBufferView = toJS(m_exec, m_globalObject, Uint32Array::create(arrayBuffer, byteOffset, length).get()); 1837 1837 return true; 1838 1838 case Float32ArrayTag: 1839 arrayBufferView = getJSValue(Float32Array::create(arrayBuffer, byteOffset, length).get());1839 arrayBufferView = toJS(m_exec, m_globalObject, Float32Array::create(arrayBuffer, byteOffset, length).get()); 1840 1840 return true; 1841 1841 case Float64ArrayTag: 1842 arrayBufferView = getJSValue(Float64Array::create(arrayBuffer, byteOffset, length).get());1842 arrayBufferView = toJS(m_exec, m_globalObject, Float64Array::create(arrayBuffer, byteOffset, length).get()); 1843 1843 return true; 1844 1844 default: … … 2331 2331 return JSValue(); 2332 2332 } 2333 JSValue result = getJSValue(arrayBuffer.get());2333 JSValue result = JSArrayBuffer::create(m_exec->vm(), m_globalObject->arrayBufferStructure(), arrayBuffer.release()); 2334 2334 m_gcBuffer.append(result); 2335 2335 return result;
Note: See TracChangeset
for help on using the changeset viewer.