diff options
author | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2018-09-20 17:06:02 +0200 |
---|---|---|
committer | Fernando Jiménez Moreno <ferjmoreno@gmail.com> | 2018-10-08 16:12:02 +0200 |
commit | da0e92d7f830b4f1e09d9e3099ae39cf2b62fd10 (patch) | |
tree | 9a1a5f84787e15837363160baf74377634d226ba /components/script/dom/htmlmediaelement.rs | |
parent | b656ae195fc0784e9582e4fe7a19eddaba2debf0 (diff) | |
download | servo-da0e92d7f830b4f1e09d9e3099ae39cf2b62fd10.tar.gz servo-da0e92d7f830b4f1e09d9e3099ae39cf2b62fd10.zip |
Cancel fetch in some media data processing steps
Diffstat (limited to 'components/script/dom/htmlmediaelement.rs')
-rw-r--r-- | components/script/dom/htmlmediaelement.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/components/script/dom/htmlmediaelement.rs b/components/script/dom/htmlmediaelement.rs index 311f1ed779c..60ba9632285 100644 --- a/components/script/dom/htmlmediaelement.rs +++ b/components/script/dom/htmlmediaelement.rs @@ -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(); } } @@ -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), |