Changeset 272215 in webkit
- Timestamp:
- Feb 2, 2021 9:45:21 AM (18 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/storage/indexeddb/resources/structured-clone.js (modified) (1 diff)
-
LayoutTests/storage/indexeddb/structured-clone-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/bindings/js/SerializedScriptValue.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r272206 r272215 1 2021-02-02 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Support BigInt64Array/BigUint64Array in structured-cloning 4 https://bugs.webkit.org/show_bug.cgi?id=221247 5 6 Reviewed by Alexey Shvayka. 7 8 * storage/indexeddb/resources/structured-clone.js: 9 * storage/indexeddb/structured-clone-expected.txt: 10 1 11 2021-02-02 Youenn Fablet <youenn@apple.com> 2 12 -
trunk/LayoutTests/storage/indexeddb/resources/structured-clone.js
r264661 r272215 514 514 "new Uint8ClampedArray([0, 1, 254, 255])", 515 515 "new Float32Array([-Infinity, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, Infinity, NaN])", 516 "new Float64Array([-Infinity, -Number.MAX_VALUE, -Number.MIN_VALUE, 0, Number.MIN_VALUE, Number.MAX_VALUE, Infinity, NaN])" 516 "new Float64Array([-Infinity, -Number.MAX_VALUE, -Number.MIN_VALUE, 0, Number.MIN_VALUE, Number.MAX_VALUE, Infinity, NaN])", 517 "new BigInt64Array([0x7fffffffffffffffn, 1n, 0n, -1n, -0x8000000000000000n])", 518 "new BigUint64Array([0n, 0xffffffffffffffffn])", 517 519 ], callback); 518 520 } -
trunk/LayoutTests/storage/indexeddb/structured-clone-expected.txt
r264661 r272215 811 811 PASS is(test_data[6], result[6]) is true 812 812 PASS is(test_data[7], result[7]) is true 813 value = new BigInt64Array([0x7fffffffffffffffn, 1n, 0n, -1n, -0x8000000000000000n]) 814 transaction = db.transaction('storeName', 'readwrite') 815 store = transaction.objectStore('storeName') 816 store.put(value, 'key') 817 store.get('key') 818 PASS test_data !== result is true 819 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data) 820 PASS test_data.length === result.length is true 821 PASS is(test_data[0], result[0]) is true 822 PASS is(test_data[1], result[1]) is true 823 PASS is(test_data[2], result[2]) is true 824 PASS is(test_data[3], result[3]) is true 825 PASS is(test_data[4], result[4]) is true 826 value = new BigUint64Array([0n, 0xffffffffffffffffn]) 827 transaction = db.transaction('storeName', 'readwrite') 828 store = transaction.objectStore('storeName') 829 store.put(value, 'key') 830 store.get('key') 831 PASS test_data !== result is true 832 PASS Object.prototype.toString.call(result) is Object.prototype.toString.call(test_data) 833 PASS test_data.length === result.length is true 834 PASS is(test_data[0], result[0]) is true 835 PASS is(test_data[1], result[1]) is true 813 836 814 837 Testing Arrays -
trunk/Source/WebCore/ChangeLog
r272214 r272215 1 2021-02-02 Yusuke Suzuki <ysuzuki@apple.com> 2 3 Support BigInt64Array/BigUint64Array in structured-cloning 4 https://bugs.webkit.org/show_bug.cgi?id=221247 5 6 Reviewed by Alexey Shvayka. 7 8 This patch adds BigInt64Array/BigUint64Array support in structured-cloning so that 9 we can serialize and deserialize BigInt64Array/BigUint64Array. 10 11 * bindings/js/SerializedScriptValue.cpp: 12 (WebCore::typedArrayElementSize): 13 (WebCore::CloneSerializer::dumpArrayBufferView): 14 (WebCore::CloneDeserializer::readArrayBufferView): 15 1 16 2021-02-02 Chris Dumez <cdumez@apple.com> 2 17 -
trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp
r271269 r272215 200 200 Uint32ArrayTag = 7, 201 201 Float32ArrayTag = 8, 202 Float64ArrayTag = 9 202 Float64ArrayTag = 9, 203 BigInt64ArrayTag = 10, 204 BigUint64ArrayTag = 11, 203 205 }; 204 206 … … 219 221 return 4; 220 222 case Float64ArrayTag: 223 case BigInt64ArrayTag: 224 case BigUint64ArrayTag: 221 225 return 8; 222 226 default: … … 926 930 else if (obj->inherits<JSFloat64Array>(vm)) 927 931 write(Float64ArrayTag); 932 else if (obj->inherits<JSBigInt64Array>(vm)) 933 write(BigInt64ArrayTag); 934 else if (obj->inherits<JSBigUint64Array>(vm)) 935 write(BigUint64ArrayTag); 928 936 else 929 937 return false; … … 2401 2409 case Float64ArrayTag: 2402 2410 arrayBufferView = toJS(m_lexicalGlobalObject, m_globalObject, Float64Array::tryCreate(WTFMove(arrayBuffer), byteOffset, length).get()); 2411 return true; 2412 case BigInt64ArrayTag: 2413 arrayBufferView = toJS(m_lexicalGlobalObject, m_globalObject, BigInt64Array::tryCreate(WTFMove(arrayBuffer), byteOffset, length).get()); 2414 return true; 2415 case BigUint64ArrayTag: 2416 arrayBufferView = toJS(m_lexicalGlobalObject, m_globalObject, BigUint64Array::tryCreate(WTFMove(arrayBuffer), byteOffset, length).get()); 2403 2417 return true; 2404 2418 default:
Note: See TracChangeset
for help on using the changeset viewer.