mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
implement Writablestreamdefaultcontroller abortcontroller (#37511)
using abort signal and abortcontroller in Writablestreamdefaultcontroller Part of https://github.com/servo/servo/issues/34866 --------- Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
This commit is contained in:
parent
3ee339eb6d
commit
fc2135cc02
9 changed files with 63 additions and 119 deletions
|
@ -35,7 +35,7 @@ impl AbortController {
|
|||
}
|
||||
|
||||
/// <https://dom.spec.whatwg.org/#dom-abortcontroller-abortcontroller>
|
||||
fn new_with_proto(
|
||||
pub(crate) fn new_with_proto(
|
||||
global: &GlobalScope,
|
||||
proto: Option<HandleObject>,
|
||||
can_gc: CanGc,
|
||||
|
@ -52,10 +52,22 @@ impl AbortController {
|
|||
}
|
||||
|
||||
/// <https://dom.spec.whatwg.org/#abortcontroller-signal-abort>
|
||||
fn signal_abort(&self, cx: JSContext, reason: HandleValue, realm: InRealm, can_gc: CanGc) {
|
||||
pub(crate) fn signal_abort(
|
||||
&self,
|
||||
cx: JSContext,
|
||||
reason: HandleValue,
|
||||
realm: InRealm,
|
||||
can_gc: CanGc,
|
||||
) {
|
||||
// signal abort on controller’s signal with reason if it is given.
|
||||
self.signal.signal_abort(cx, reason, realm, can_gc);
|
||||
}
|
||||
|
||||
/// <https://dom.spec.whatwg.org/#abortcontroller-signal>
|
||||
pub(crate) fn signal(&self) -> DomRoot<AbortSignal> {
|
||||
// The signal getter steps are to return this’s signal.
|
||||
self.signal.as_rooted()
|
||||
}
|
||||
}
|
||||
|
||||
impl AbortControllerMethods<crate::DomTypeHolder> for AbortController {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue