WebIDL: Use ArrayBuffer instead of raw JSObject in bindings (#31202)

* WebIDL: Use ArrayBuffer instead of raw JSObject in bindings

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Convert GPUBufferMapInfo mapping to Arc<Mutex>

* Remove #[allow(unsafe_code)] from GPUBuffer

* Add doc comments

* Implement trace for Arc<Mutex<Vec<T>>>

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Use #[no_trace] for GPUBufferMapInfo.mapping

* Make create_new_external_array_buffer generic

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Address review comments

* Remove HeapTypedArray::new and avoid cloning Arc

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Use expect for GetMappedRange and ReadAsArrayBuffer

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Use doc comments for FileReaderSyncMethods

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Return for Error::JsFailed GetMappedRange and ReadAsArrayBuffer

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Fix detached_internal implementation and comments

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* format code

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Update expectations

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Taym Haddadi 2024-02-13 08:58:48 +01:00 committed by GitHub
parent e6baa26ff8
commit 9be989146d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 121 additions and 75 deletions

View file

@ -15676,9 +15676,6 @@
expected: FAIL
[cts.https.html?q=webgpu:api,validation,buffer,mapping:getMappedRange,state,unmapped:*]
expected: CRASH
[cts.https.html?q=webgpu:api,validation,buffer,mapping:unmap,state,mappingPending:*]
expected: CRASH
@ -31996,9 +31993,6 @@
[cts.https.html?q=webgpu:shader,validation,parse,var_and_let:initializer_type:*]
expected: CRASH
[cts.https.html?q=webgpu:api,validation,buffer,mapping:getMappedRange,state,destroyed:*]
expected: CRASH
[cts.https.html?q=webgpu:api,operation,buffers,map_detach:while_mapped:*]
[:]
expected: FAIL