aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/document_loader.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/document_loader.rs')
-rw-r--r--components/script/document_loader.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/components/script/document_loader.rs b/components/script/document_loader.rs
index dd9d74403ef..5d07cea0930 100644
--- a/components/script/document_loader.rs
+++ b/components/script/document_loader.rs
@@ -11,6 +11,7 @@ use net_traits::request::RequestBuilder;
use net_traits::{fetch_async, BoxedFetchCallback, ResourceThreads};
use servo_url::ServoUrl;
+use crate::dom::bindings::cell::DomRefCell;
use crate::dom::bindings::root::Dom;
use crate::dom::document::Document;
use crate::fetch::FetchCanceller;
@@ -49,11 +50,12 @@ impl LoadBlocker {
}
/// Remove this load from the associated document's list of blocking loads.
- pub fn terminate(blocker: &mut Option<LoadBlocker>, can_gc: CanGc) {
- if let Some(this) = blocker.as_mut() {
- this.doc.finish_load(this.load.take().unwrap(), can_gc);
+ pub fn terminate(blocker: &DomRefCell<Option<LoadBlocker>>, can_gc: CanGc) {
+ if let Some(this) = blocker.borrow().as_ref() {
+ let load_data = this.load.clone().unwrap();
+ this.doc.finish_load(load_data, can_gc);
}
- *blocker = None;
+ *blocker.borrow_mut() = None;
}
}