Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Impl ReadableStream support #25827

Closed
wants to merge 9 commits into from

impl locked

  • Loading branch information
gterzian committed Feb 23, 2020
commit d1b9bf4f9d2e0a5c7d3c07d4ee59c49c793c1847
@@ -74,6 +74,17 @@ impl ReadableStreamMethods for ReadableStream {
fn GetReader(&self, cx: SafeJSContext) -> Fallible<NonNull<JSObject>> {
get_stream_reader(cx, &self.stream)
}

#[allow(unsafe_code)]
fn Locked(&self) -> bool {
let mut is_locked = false;
unsafe {
let stream = self.stream.handle();
let is_locked_ptr = &mut is_locked as *mut _;
ReadableStreamIsLocked(*self.global().get_cx(), stream, is_locked_ptr);
}
is_locked
}
}

#[allow(unsafe_code)]
@@ -10,6 +10,7 @@ interface ReadableStream {
constructor(object underlyingSource, Function size, HighWatermark highWaterMark, object proto);
[Throws] Promise<DOMString> cancel(DOMString reason);
[Throws] object getReader();
readonly attribute boolean locked;
};

typedef double HighWatermark;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.