diff options
author | chickenleaf <lashwinib@gmail.com> | 2024-10-22 03:02:22 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-21 21:32:22 +0000 |
commit | ebfea9b352ef0ec00ad5213055392668e841a0e9 (patch) | |
tree | 43baab7b7e7a4bd6f1a8111bfb8fe598aeb2cf87 /components/script/security_manager.rs | |
parent | 1bf68567b8608d87e1817066f1dacb27edc5602a (diff) | |
download | servo-ebfea9b352ef0ec00ad5213055392668e841a0e9.tar.gz servo-ebfea9b352ef0ec00ad5213055392668e841a0e9.zip |
CanGc fixes in several files (#33958)
* few cangc fixes
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
* few cangc fixes
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
---------
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
Diffstat (limited to 'components/script/security_manager.rs')
-rw-r--r-- | components/script/security_manager.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/security_manager.rs b/components/script/security_manager.rs index 2040414384a..30ff4242b39 100644 --- a/components/script/security_manager.rs +++ b/components/script/security_manager.rs @@ -19,6 +19,7 @@ use crate::dom::event::{Event, EventBubbles, EventCancelable}; use crate::dom::eventtarget::EventTarget; use crate::dom::securitypolicyviolationevent::SecurityPolicyViolationEvent; use crate::dom::types::GlobalScope; +use crate::script_runtime::CanGc; use crate::task::TaskOnce; pub struct CSPViolationReporter { @@ -100,7 +101,7 @@ impl CSPViolationReporter { } } - fn fire_violation_event(&self) { + fn fire_violation_event(&self, can_gc: CanGc) { let target = self.target.root(); let global = &target.global(); let report = self.get_report(global); @@ -111,6 +112,7 @@ impl CSPViolationReporter { EventBubbles::Bubbles, EventCancelable::Cancelable, &report.into(), + can_gc, ); event.upcast::<Event>().fire(&target); @@ -142,7 +144,7 @@ impl TaskOnce for CSPViolationReporter { // > If target implements EventTarget, fire an event named securitypolicyviolation // > that uses the SecurityPolicyViolationEvent interface // > at target with its attributes initialized as follows: - self.fire_violation_event(); + self.fire_violation_event(CanGc::note()); // TODO: Support `report-to` directive that corresponds to 5.5.3.5. } } |