aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/document_loader.rs
diff options
context:
space:
mode:
authorAndriy Sultanov <53952748+last-genius@users.noreply.github.com>2024-09-09 23:38:01 +0100
committerGitHub <noreply@github.com>2024-09-09 22:38:01 +0000
commite5150dbda1f89ff07294dbd1ca4e8f4f08cf4874 (patch)
treee77fae25f33905e1c8c626cf532e7222f521335c /components/script/document_loader.rs
parent10e5bb72d9e16655b625b8971e346ff479b17fd2 (diff)
downloadservo-e5150dbda1f89ff07294dbd1ca4e8f4f08cf4874.tar.gz
servo-e5150dbda1f89ff07294dbd1ca4e8f4f08cf4874.zip
Propagate `CanGc` from `Document::new()` (#33386)
* Add canGc as a parameter to autogenerated trait methods Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com> * Propagate CanGc from Document::new() Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com> --------- Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>
Diffstat (limited to 'components/script/document_loader.rs')
-rw-r--r--components/script/document_loader.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/components/script/document_loader.rs b/components/script/document_loader.rs
index 2d369697303..0b2a0ab8139 100644
--- a/components/script/document_loader.rs
+++ b/components/script/document_loader.rs
@@ -14,6 +14,7 @@ use servo_url::ServoUrl;
use crate::dom::bindings::root::Dom;
use crate::dom::document::Document;
use crate::fetch::FetchCanceller;
+use crate::script_runtime::CanGc;
#[derive(Clone, Debug, JSTraceable, MallocSizeOf, PartialEq)]
pub enum LoadType {
@@ -48,9 +49,9 @@ impl LoadBlocker {
}
/// Remove this load from the associated document's list of blocking loads.
- pub fn terminate(blocker: &mut Option<LoadBlocker>) {
+ 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());
+ this.doc.finish_load(this.load.take().unwrap(), can_gc);
}
*blocker = None;
}
@@ -59,7 +60,7 @@ impl LoadBlocker {
impl Drop for LoadBlocker {
fn drop(&mut self) {
if let Some(load) = self.load.take() {
- self.doc.finish_load(load);
+ self.doc.finish_load(load, CanGc::note());
}
}
}