mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Implement PolicyContainer and update the default ReferrerPolicy (#33977)
* Implement PolicyContainer Signed-off-by: Shane Handley <shanehandley@fastmail.com> * implement small parts of fetch that interact with policy container Signed-off-by: Shane Handley <shanehandley@fastmail.com> * fix: allow policy container's csp list to be unset Signed-off-by: Shane Handley <shanehandley@fastmail.com> * fix: use the correct default policy when parsing from a token Signed-off-by: Shane Handley <shanehandley@fastmail.com> --------- Signed-off-by: Shane Handley <shanehandley@fastmail.com>
This commit is contained in:
parent
4f6283d7fe
commit
6451767428
201 changed files with 210 additions and 5178 deletions
|
@ -17,6 +17,7 @@ use ipc_channel::ipc::IpcSender;
|
|||
use js::jsval::UndefinedValue;
|
||||
use js::panic::maybe_resume_unwind;
|
||||
use js::rust::{HandleValue, MutableHandleValue, ParentRuntime};
|
||||
use net_traits::policy_container::PolicyContainer;
|
||||
use net_traits::request::{
|
||||
CredentialsMode, Destination, ParserMetadata, RequestBuilder as NetRequestInit,
|
||||
};
|
||||
|
@ -109,6 +110,9 @@ pub struct WorkerGlobalScope {
|
|||
runtime: DomRefCell<Option<Runtime>>,
|
||||
location: MutNullableDom<WorkerLocation>,
|
||||
navigator: MutNullableDom<WorkerNavigator>,
|
||||
#[no_trace]
|
||||
/// <https://html.spec.whatwg.org/multipage/#the-workerglobalscope-common-interface:policy-container>
|
||||
policy_container: DomRefCell<PolicyContainer>,
|
||||
|
||||
#[ignore_malloc_size_of = "Defined in ipc-channel"]
|
||||
#[no_trace]
|
||||
|
@ -171,6 +175,7 @@ impl WorkerGlobalScope {
|
|||
runtime: DomRefCell::new(Some(runtime)),
|
||||
location: Default::default(),
|
||||
navigator: Default::default(),
|
||||
policy_container: Default::default(),
|
||||
devtools_receiver,
|
||||
_devtools_sender: init.from_devtools_sender,
|
||||
navigation_start: CrossProcessInstant::now(),
|
||||
|
@ -230,6 +235,10 @@ impl WorkerGlobalScope {
|
|||
pub fn pipeline_id(&self) -> PipelineId {
|
||||
self.globalscope.pipeline_id()
|
||||
}
|
||||
|
||||
pub fn policy_container(&self) -> Ref<PolicyContainer> {
|
||||
self.policy_container.borrow()
|
||||
}
|
||||
}
|
||||
|
||||
impl WorkerGlobalScopeMethods for WorkerGlobalScope {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue