mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
refactor: add CanGc as argument to create_buffer_source (#35597)
Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
This commit is contained in:
parent
35f21e426b
commit
245a39c07e
22 changed files with 169 additions and 96 deletions
|
@ -250,7 +250,7 @@ impl ReadableStream {
|
|||
UnderlyingSourceType::Memory(bytes.len()),
|
||||
can_gc,
|
||||
)?;
|
||||
stream.enqueue_native(bytes);
|
||||
stream.enqueue_native(bytes, can_gc);
|
||||
stream.controller_close_native();
|
||||
Ok(stream)
|
||||
}
|
||||
|
@ -375,12 +375,12 @@ impl ReadableStream {
|
|||
|
||||
/// Endpoint to enqueue chunks directly from Rust.
|
||||
/// Note: in other use cases this call happens via the controller.
|
||||
pub(crate) fn enqueue_native(&self, bytes: Vec<u8>) {
|
||||
pub(crate) fn enqueue_native(&self, bytes: Vec<u8>, can_gc: CanGc) {
|
||||
match self.controller {
|
||||
ControllerType::Default(ref controller) => controller
|
||||
.get()
|
||||
.expect("Stream should have controller.")
|
||||
.enqueue_native(bytes),
|
||||
.enqueue_native(bytes, can_gc),
|
||||
_ => unreachable!(
|
||||
"Enqueueing chunk to a stream from Rust on other than default controller"
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue