mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
refactor: add CanGc as argument to create_buffer_source_with_length (#35596)
Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
d72c9f3501
commit
89d7f874b2
2 changed files with 11 additions and 9 deletions
|
@ -52,6 +52,7 @@ pub(crate) enum BufferSource {
|
|||
|
||||
pub(crate) fn new_initialized_heap_buffer_source<T>(
|
||||
init: HeapTypedArrayInit,
|
||||
can_gc: CanGc,
|
||||
) -> Result<HeapBufferSource<T>, ()>
|
||||
where
|
||||
T: TypedArrayElement + TypedArrayElementCreator,
|
||||
|
@ -65,7 +66,7 @@ where
|
|||
HeapTypedArrayInit::Info { len, cx } => {
|
||||
rooted!(in (*cx) let mut array = ptr::null_mut::<JSObject>());
|
||||
let typed_array_result =
|
||||
create_buffer_source_with_length::<T>(cx, len as usize, array.handle_mut());
|
||||
create_buffer_source_with_length::<T>(cx, len as usize, array.handle_mut(), can_gc);
|
||||
if typed_array_result.is_err() {
|
||||
return Err(());
|
||||
}
|
||||
|
@ -371,6 +372,7 @@ fn create_buffer_source_with_length<T>(
|
|||
cx: JSContext,
|
||||
len: usize,
|
||||
dest: MutableHandleObject,
|
||||
_can_gc: CanGc,
|
||||
) -> Result<TypedArray<T, *mut JSObject>, ()>
|
||||
where
|
||||
T: TypedArrayElement + TypedArrayElementCreator,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue