PBackgroundSharedTypes.ipdlh (2689B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 include "mozilla/dom/DomSecurityIPCUtils.h"; 6 7 using mozilla::OriginAttributes from "mozilla/ipc/BackgroundUtils.h"; 8 using struct mozilla::void_t from "mozilla/ipc/IPCCore.h"; 9 using nsIContentSecurityPolicy::RequireTrustedTypesForDirectiveState from "nsIContentSecurityPolicy.h"; 10 using mozilla::dom::IntegrityPolicy::Sources from "mozilla/dom/IntegrityPolicy.h"; 11 using mozilla::dom::IntegrityPolicy::Destinations from "mozilla/dom/IntegrityPolicy.h"; 12 13 namespace mozilla { 14 namespace ipc { 15 16 [Comparable] struct ContentSecurityPolicy 17 { 18 nsString policy; 19 bool reportOnlyFlag; 20 bool deliveredViaMetaTagFlag; 21 bool hasRequireTrustedTypesForDirective; 22 }; 23 24 [Comparable] struct ContentPrincipalInfo 25 { 26 OriginAttributes attrs; 27 28 // Origin is not simply a part of the spec. Based on the scheme of the URI 29 // spec, we generate different kind of origins: for instance any file: URL 30 // shares the same origin, about: URLs have the full spec as origin and so 31 // on. 32 // Another important reason why we have this attribute is that 33 // ContentPrincipalInfo is used out of the main-thread. Having this value 34 // here allows us to retrive the origin without creating a full nsIPrincipal. 35 nsCString originNoSuffix; 36 37 nsCString spec; 38 39 nsCString? domain; 40 41 // Like originNoSuffix, baseDomain is used out of the main-thread. 42 nsCString baseDomain; 43 }; 44 45 [Comparable] struct SystemPrincipalInfo 46 { }; 47 48 [Comparable] struct NullPrincipalInfo 49 { 50 OriginAttributes attrs; 51 nsCString spec; 52 }; 53 54 [Comparable] struct ExpandedPrincipalInfo 55 { 56 OriginAttributes attrs; 57 PrincipalInfo[] allowlist; 58 }; 59 60 [Comparable] union PrincipalInfo 61 { 62 ContentPrincipalInfo; 63 SystemPrincipalInfo; 64 NullPrincipalInfo; 65 ExpandedPrincipalInfo; 66 }; 67 68 [Comparable] struct CSPInfo 69 { 70 ContentSecurityPolicy[] policyInfos; 71 PrincipalInfo requestPrincipalInfo; 72 nsCString selfURISpec; 73 nsCString referrer; 74 uint64_t innerWindowID; 75 RequireTrustedTypesForDirectiveState requireTrustedTypesForDirectiveState; 76 bool skipAllowInlineStyleCheck; 77 }; 78 79 [Comparable] struct IntegrityPolicyEntry { 80 Sources sources; 81 Destinations destinations; 82 nsCString[] endpoints; 83 }; 84 85 [Comparable] struct IntegrityPolicyArgs 86 { 87 IntegrityPolicyEntry? enforcement; 88 IntegrityPolicyEntry? reportOnly; 89 }; 90 91 [Comparable] struct PolicyContainerArgs 92 { 93 CSPInfo? csp; 94 IntegrityPolicyArgs? integrityPolicy; 95 }; 96 97 [Comparable] struct WebTransportHash { 98 nsCString algorithm; 99 uint8_t[] value; 100 }; 101 102 } // namespace ipc 103 } // namespace mozilla