mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
Move CSP code into one entrypoint (#37604)
This refactoring moves various CSP-related methods away from GlobalScope and Document into a dedicated entrypoint. It also reduces the amount of imports of the CSP crate, so that types are consolidated into this one entrypoint. That way, we control how CSP code interacts with the script crate. For reviewing purposes, I split up the refactoring into separate distinct commits that all move 1 method(group) into the new file. Testing: no change in behavior, only a build improvement + code cleanup --------- Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com> Signed-off-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
2265570c88
commit
fc20d8b2e1
@@ -5,7 +5,6 @@
|
||||
use std::io::{Read, Seek, Write};
|
||||
use std::sync::atomic::AtomicBool;
|
||||
|
||||
use content_security_policy as csp;
|
||||
use cssparser::SourceLocation;
|
||||
use encoding_rs::UTF_8;
|
||||
use mime::{self, Mime};
|
||||
@@ -32,6 +31,7 @@ use crate::dom::bindings::inheritance::Castable;
|
||||
use crate::dom::bindings::refcounted::Trusted;
|
||||
use crate::dom::bindings::reflector::DomGlobal;
|
||||
use crate::dom::bindings::root::DomRoot;
|
||||
use crate::dom::csp::{GlobalCspReporting, Violation};
|
||||
use crate::dom::document::Document;
|
||||
use crate::dom::element::Element;
|
||||
use crate::dom::eventtarget::EventTarget;
|
||||
@@ -296,7 +296,7 @@ impl FetchResponseListener for StylesheetContext {
|
||||
network_listener::submit_timing(self, CanGc::note())
|
||||
}
|
||||
|
||||
fn process_csp_violations(&mut self, _request_id: RequestId, violations: Vec<csp::Violation>) {
|
||||
fn process_csp_violations(&mut self, _request_id: RequestId, violations: Vec<Violation>) {
|
||||
let global = &self.resource_timing_global();
|
||||
global.report_csp_violations(violations, None);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user