Skip to content

Commit

Permalink
Cancel fetch in some media data processing steps
Browse files Browse the repository at this point in the history
  • Loading branch information
ferjm committed Oct 8, 2018
1 parent b656ae1 commit da0e92d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions components/script/dom/htmlmediaelement.rs
Expand Up @@ -1193,9 +1193,9 @@ impl FetchResponseListener for HTMLMediaElementContext {
// Ensure that the element doesn't receive any further notifications
// of the aborted fetch.
self.ignore_response = true;
self.elem
.root()
.queue_dedicated_media_source_failure_steps();
let elem = self.elem.root();
elem.fetch_canceller.borrow_mut().cancel();
elem.queue_dedicated_media_source_failure_steps();
}
}

Expand Down Expand Up @@ -1264,6 +1264,9 @@ impl FetchResponseListener for HTMLMediaElementContext {
}
// => "If the connection is interrupted after some media data has been received..."
else if elem.ready_state.get() != ReadyState::HaveNothing {
// Step 1
elem.fetch_canceller.borrow_mut().cancel();

// Step 2
elem.error.set(Some(&*MediaError::new(
&*window_from_node(&*elem),
Expand Down

0 comments on commit da0e92d

Please sign in to comment.