mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -67,6 +67,7 @@ impl ImageData {
|
|||
) -> Fallible<DomRoot<ImageData>> {
|
||||
let heap_typed_array = match new_initialized_heap_buffer_source::<ClampedU8>(
|
||||
HeapTypedArrayInit::Buffer(BufferSource::ArrayBufferView(Heap::boxed(jsobject))),
|
||||
can_gc,
|
||||
) {
|
||||
Ok(heap_typed_array) => heap_typed_array,
|
||||
Err(_) => return Err(Error::JSFailed),
|
||||
|
@ -121,14 +122,13 @@ impl ImageData {
|
|||
let cx = GlobalScope::get_cx();
|
||||
let len = width * height * 4;
|
||||
|
||||
let heap_typed_array =
|
||||
match new_initialized_heap_buffer_source::<ClampedU8>(HeapTypedArrayInit::Info {
|
||||
len,
|
||||
cx,
|
||||
}) {
|
||||
Ok(heap_typed_array) => heap_typed_array,
|
||||
Err(_) => return Err(Error::JSFailed),
|
||||
};
|
||||
let heap_typed_array = match new_initialized_heap_buffer_source::<ClampedU8>(
|
||||
HeapTypedArrayInit::Info { len, cx },
|
||||
can_gc,
|
||||
) {
|
||||
Ok(heap_typed_array) => heap_typed_array,
|
||||
Err(_) => return Err(Error::JSFailed),
|
||||
};
|
||||
let imagedata = Box::new(ImageData {
|
||||
reflector_: Reflector::new(),
|
||||
width,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue