mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
ReadableStream: remove the use of get_js_stream and use DomRoot<ReadableStream> (#34836)
* Remove the use of get_js_stream and use DomRoot<ReadableStream> Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> * return an error instead of Option Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
This commit is contained in:
parent
15eb405f36
commit
bcad0d50e9
9 changed files with 43 additions and 52 deletions
|
@ -564,7 +564,7 @@ impl XMLHttpRequestMethods<crate::DomTypeHolder> for XMLHttpRequest {
|
|||
};
|
||||
let total_bytes = bytes.len();
|
||||
let global = self.global();
|
||||
let stream = ReadableStream::new_from_bytes(&global, bytes, can_gc);
|
||||
let stream = ReadableStream::new_from_bytes(&global, bytes, can_gc)?;
|
||||
Some(ExtractedBody {
|
||||
stream,
|
||||
total_bytes: Some(total_bytes),
|
||||
|
@ -601,7 +601,7 @@ impl XMLHttpRequestMethods<crate::DomTypeHolder> for XMLHttpRequest {
|
|||
let bytes = typedarray.to_vec();
|
||||
let total_bytes = bytes.len();
|
||||
let global = self.global();
|
||||
let stream = ReadableStream::new_from_bytes(&global, bytes, can_gc);
|
||||
let stream = ReadableStream::new_from_bytes(&global, bytes, can_gc)?;
|
||||
Some(ExtractedBody {
|
||||
stream,
|
||||
total_bytes: Some(total_bytes),
|
||||
|
@ -613,7 +613,7 @@ impl XMLHttpRequestMethods<crate::DomTypeHolder> for XMLHttpRequest {
|
|||
let bytes = typedarray.to_vec();
|
||||
let total_bytes = bytes.len();
|
||||
let global = self.global();
|
||||
let stream = ReadableStream::new_from_bytes(&global, bytes, can_gc);
|
||||
let stream = ReadableStream::new_from_bytes(&global, bytes, can_gc)?;
|
||||
Some(ExtractedBody {
|
||||
stream,
|
||||
total_bytes: Some(total_bytes),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue