Line data Source code
1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsIPrincipal.idl
3 : */
4 :
5 : #ifndef __gen_nsIPrincipal_h__
6 : #define __gen_nsIPrincipal_h__
7 :
8 :
9 : #ifndef __gen_nsISerializable_h__
10 : #include "nsISerializable.h"
11 : #endif
12 :
13 : #include "js/Value.h"
14 :
15 : #include "mozilla/Assertions.h"
16 : #include "mozilla/DebugOnly.h"
17 :
18 : /* For IDL files that don't want to include root IDL files. */
19 : #ifndef NS_NO_VTABLE
20 : #define NS_NO_VTABLE
21 : #endif
22 : struct JSPrincipals;
23 : #include "nsCOMPtr.h"
24 : #include "nsTArray.h"
25 : #include "mozilla/DebugOnly.h"
26 : namespace mozilla {
27 : class OriginAttributes;
28 : }
29 : /**
30 : * Some methods have a fast path for the case when we're comparing a principal
31 : * to itself. The situation may happen for example with about:blank documents.
32 : */
33 : #define DECL_FAST_INLINE_HELPER(method_) \
34 : inline bool method_(nsIPrincipal* aOther) \
35 : { \
36 : mozilla::DebugOnly<bool> val = false; \
37 : MOZ_ASSERT_IF(this == aOther, \
38 : NS_SUCCEEDED(method_(aOther, &val)) && val); \
39 : \
40 : bool retVal = false; \
41 : return \
42 : this == aOther || \
43 : (NS_SUCCEEDED(method_(aOther, &retVal)) && retVal); \
44 : }
45 : class nsIURI; /* forward declaration */
46 :
47 : class nsIContentSecurityPolicy; /* forward declaration */
48 :
49 : class nsIDOMDocument; /* forward declaration */
50 :
51 :
52 : /* starting interface: nsIPrincipal */
53 : #define NS_IPRINCIPAL_IID_STR "f75f502d-79fd-48be-a079-e5a7b8f80c8b"
54 :
55 : #define NS_IPRINCIPAL_IID \
56 : {0xf75f502d, 0x79fd, 0x48be, \
57 : { 0xa0, 0x79, 0xe5, 0xa7, 0xb8, 0xf8, 0x0c, 0x8b }}
58 :
59 343 : class nsIPrincipal : public nsISerializable {
60 : public:
61 :
62 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRINCIPAL_IID)
63 :
64 : /* boolean equals (in nsIPrincipal other); */
65 : NS_IMETHOD Equals(nsIPrincipal *other, bool *_retval) = 0;
66 :
67 : /* boolean equalsConsideringDomain (in nsIPrincipal other); */
68 : NS_IMETHOD EqualsConsideringDomain(nsIPrincipal *other, bool *_retval) = 0;
69 :
70 3 : DECL_FAST_INLINE_HELPER(Equals)
71 : DECL_FAST_INLINE_HELPER(EqualsConsideringDomain)
72 : /* [noscript] readonly attribute unsigned long hashValue; */
73 : NS_IMETHOD GetHashValue(uint32_t *aHashValue) = 0;
74 :
75 : /* readonly attribute nsIURI URI; */
76 : NS_IMETHOD GetURI(nsIURI * *aURI) = 0;
77 :
78 : /* [noscript] attribute nsIURI domain; */
79 : NS_IMETHOD GetDomain(nsIURI * *aDomain) = 0;
80 : NS_IMETHOD SetDomain(nsIURI *aDomain) = 0;
81 :
82 : /* boolean subsumes (in nsIPrincipal other); */
83 : NS_IMETHOD Subsumes(nsIPrincipal *other, bool *_retval) = 0;
84 :
85 : /* boolean subsumesConsideringDomain (in nsIPrincipal other); */
86 : NS_IMETHOD SubsumesConsideringDomain(nsIPrincipal *other, bool *_retval) = 0;
87 :
88 : /* boolean subsumesConsideringDomainIgnoringFPD (in nsIPrincipal other); */
89 : NS_IMETHOD SubsumesConsideringDomainIgnoringFPD(nsIPrincipal *other, bool *_retval) = 0;
90 :
91 108 : DECL_FAST_INLINE_HELPER(Subsumes)
92 628 : DECL_FAST_INLINE_HELPER(SubsumesConsideringDomain)
93 : DECL_FAST_INLINE_HELPER(SubsumesConsideringDomainIgnoringFPD)
94 : #undef DECL_FAST_INLINE_HELPER
95 : /* void checkMayLoad (in nsIURI uri, in boolean report, in boolean allowIfInheritsPrincipal); */
96 : NS_IMETHOD CheckMayLoad(nsIURI *uri, bool report, bool allowIfInheritsPrincipal) = 0;
97 :
98 : /* [noscript] attribute nsIContentSecurityPolicy csp; */
99 : NS_IMETHOD GetCsp(nsIContentSecurityPolicy * *aCsp) = 0;
100 : NS_IMETHOD SetCsp(nsIContentSecurityPolicy *aCsp) = 0;
101 :
102 : /* [noscript] nsIContentSecurityPolicy ensureCSP (in nsIDOMDocument aDocument); */
103 : NS_IMETHOD EnsureCSP(nsIDOMDocument *aDocument, nsIContentSecurityPolicy * *_retval) = 0;
104 :
105 : /* [noscript] readonly attribute nsIContentSecurityPolicy preloadCsp; */
106 : NS_IMETHOD GetPreloadCsp(nsIContentSecurityPolicy * *aPreloadCsp) = 0;
107 :
108 : /* [noscript] nsIContentSecurityPolicy ensurePreloadCSP (in nsIDOMDocument aDocument); */
109 : NS_IMETHOD EnsurePreloadCSP(nsIDOMDocument *aDocument, nsIContentSecurityPolicy * *_retval) = 0;
110 :
111 : /* readonly attribute AString cspJSON; */
112 : NS_IMETHOD GetCspJSON(nsAString & aCspJSON) = 0;
113 :
114 : /* [implicit_jscontext] readonly attribute jsval originAttributes; */
115 : NS_IMETHOD GetOriginAttributes(JSContext* cx, JS::MutableHandleValue aOriginAttributes) = 0;
116 :
117 : /* [binaryname(OriginAttributesRef),noscript,nostdcall,notxpcom] const_OriginAttributes OriginAttributesRef (); */
118 : virtual const mozilla::OriginAttributes & OriginAttributesRef(void) = 0;
119 :
120 : /* readonly attribute ACString origin; */
121 : NS_IMETHOD GetOrigin(nsACString & aOrigin) = 0;
122 :
123 : /* readonly attribute ACString originNoSuffix; */
124 : NS_IMETHOD GetOriginNoSuffix(nsACString & aOriginNoSuffix) = 0;
125 :
126 : /* readonly attribute AUTF8String originSuffix; */
127 : NS_IMETHOD GetOriginSuffix(nsACString & aOriginSuffix) = 0;
128 :
129 : /* readonly attribute ACString baseDomain; */
130 : NS_IMETHOD GetBaseDomain(nsACString & aBaseDomain) = 0;
131 :
132 : /* [infallible] readonly attribute unsigned long appId; */
133 : NS_IMETHOD GetAppId(uint32_t *aAppId) = 0;
134 25 : inline uint32_t GetAppId()
135 : {
136 : uint32_t result;
137 50 : mozilla::DebugOnly<nsresult> rv = GetAppId(&result);
138 25 : MOZ_ASSERT(NS_SUCCEEDED(rv));
139 50 : return result;
140 : }
141 :
142 : /* readonly attribute AString addonId; */
143 : NS_IMETHOD GetAddonId(nsAString & aAddonId) = 0;
144 :
145 : /* [infallible] readonly attribute unsigned long userContextId; */
146 : NS_IMETHOD GetUserContextId(uint32_t *aUserContextId) = 0;
147 0 : inline uint32_t GetUserContextId()
148 : {
149 : uint32_t result;
150 0 : mozilla::DebugOnly<nsresult> rv = GetUserContextId(&result);
151 0 : MOZ_ASSERT(NS_SUCCEEDED(rv));
152 0 : return result;
153 : }
154 :
155 : /* [infallible] readonly attribute unsigned long privateBrowsingId; */
156 : NS_IMETHOD GetPrivateBrowsingId(uint32_t *aPrivateBrowsingId) = 0;
157 3 : inline uint32_t GetPrivateBrowsingId()
158 : {
159 : uint32_t result;
160 6 : mozilla::DebugOnly<nsresult> rv = GetPrivateBrowsingId(&result);
161 3 : MOZ_ASSERT(NS_SUCCEEDED(rv));
162 6 : return result;
163 : }
164 :
165 : /* [infallible] readonly attribute boolean isInIsolatedMozBrowserElement; */
166 : NS_IMETHOD GetIsInIsolatedMozBrowserElement(bool *aIsInIsolatedMozBrowserElement) = 0;
167 23 : inline bool GetIsInIsolatedMozBrowserElement()
168 : {
169 : bool result;
170 46 : mozilla::DebugOnly<nsresult> rv = GetIsInIsolatedMozBrowserElement(&result);
171 23 : MOZ_ASSERT(NS_SUCCEEDED(rv));
172 46 : return result;
173 : }
174 :
175 : /* [infallible] readonly attribute boolean isNullPrincipal; */
176 : NS_IMETHOD GetIsNullPrincipal(bool *aIsNullPrincipal) = 0;
177 138 : inline bool GetIsNullPrincipal()
178 : {
179 : bool result;
180 276 : mozilla::DebugOnly<nsresult> rv = GetIsNullPrincipal(&result);
181 138 : MOZ_ASSERT(NS_SUCCEEDED(rv));
182 276 : return result;
183 : }
184 :
185 : /* [infallible] readonly attribute boolean isCodebasePrincipal; */
186 : NS_IMETHOD GetIsCodebasePrincipal(bool *aIsCodebasePrincipal) = 0;
187 8 : inline bool GetIsCodebasePrincipal()
188 : {
189 : bool result;
190 16 : mozilla::DebugOnly<nsresult> rv = GetIsCodebasePrincipal(&result);
191 8 : MOZ_ASSERT(NS_SUCCEEDED(rv));
192 16 : return result;
193 : }
194 :
195 : /* [infallible] readonly attribute boolean isExpandedPrincipal; */
196 : NS_IMETHOD GetIsExpandedPrincipal(bool *aIsExpandedPrincipal) = 0;
197 0 : inline bool GetIsExpandedPrincipal()
198 : {
199 : bool result;
200 0 : mozilla::DebugOnly<nsresult> rv = GetIsExpandedPrincipal(&result);
201 0 : MOZ_ASSERT(NS_SUCCEEDED(rv));
202 0 : return result;
203 : }
204 :
205 : /* [infallible] readonly attribute boolean isSystemPrincipal; */
206 : NS_IMETHOD GetIsSystemPrincipal(bool *aIsSystemPrincipal) = 0;
207 116 : inline bool GetIsSystemPrincipal()
208 : {
209 : bool result;
210 232 : mozilla::DebugOnly<nsresult> rv = GetIsSystemPrincipal(&result);
211 116 : MOZ_ASSERT(NS_SUCCEEDED(rv));
212 232 : return result;
213 : }
214 :
215 : };
216 :
217 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrincipal, NS_IPRINCIPAL_IID)
218 :
219 : /* Use this macro when declaring classes that implement this interface. */
220 : #define NS_DECL_NSIPRINCIPAL \
221 : NS_IMETHOD Equals(nsIPrincipal *other, bool *_retval) override; \
222 : NS_IMETHOD EqualsConsideringDomain(nsIPrincipal *other, bool *_retval) override; \
223 : NS_IMETHOD GetHashValue(uint32_t *aHashValue) override; \
224 : NS_IMETHOD GetURI(nsIURI * *aURI) override; \
225 : NS_IMETHOD GetDomain(nsIURI * *aDomain) override; \
226 : NS_IMETHOD SetDomain(nsIURI *aDomain) override; \
227 : NS_IMETHOD Subsumes(nsIPrincipal *other, bool *_retval) override; \
228 : NS_IMETHOD SubsumesConsideringDomain(nsIPrincipal *other, bool *_retval) override; \
229 : NS_IMETHOD SubsumesConsideringDomainIgnoringFPD(nsIPrincipal *other, bool *_retval) override; \
230 : NS_IMETHOD CheckMayLoad(nsIURI *uri, bool report, bool allowIfInheritsPrincipal) override; \
231 : NS_IMETHOD GetCsp(nsIContentSecurityPolicy * *aCsp) override; \
232 : NS_IMETHOD SetCsp(nsIContentSecurityPolicy *aCsp) override; \
233 : NS_IMETHOD EnsureCSP(nsIDOMDocument *aDocument, nsIContentSecurityPolicy * *_retval) override; \
234 : NS_IMETHOD GetPreloadCsp(nsIContentSecurityPolicy * *aPreloadCsp) override; \
235 : NS_IMETHOD EnsurePreloadCSP(nsIDOMDocument *aDocument, nsIContentSecurityPolicy * *_retval) override; \
236 : NS_IMETHOD GetCspJSON(nsAString & aCspJSON) override; \
237 : NS_IMETHOD GetOriginAttributes(JSContext* cx, JS::MutableHandleValue aOriginAttributes) override; \
238 : virtual const mozilla::OriginAttributes & OriginAttributesRef(void) override; \
239 : NS_IMETHOD GetOrigin(nsACString & aOrigin) override; \
240 : NS_IMETHOD GetOriginNoSuffix(nsACString & aOriginNoSuffix) override; \
241 : NS_IMETHOD GetOriginSuffix(nsACString & aOriginSuffix) override; \
242 : NS_IMETHOD GetBaseDomain(nsACString & aBaseDomain) override; \
243 : using nsIPrincipal::GetAppId; \
244 : NS_IMETHOD GetAppId(uint32_t *aAppId) override; \
245 : NS_IMETHOD GetAddonId(nsAString & aAddonId) override; \
246 : using nsIPrincipal::GetUserContextId; \
247 : NS_IMETHOD GetUserContextId(uint32_t *aUserContextId) override; \
248 : using nsIPrincipal::GetPrivateBrowsingId; \
249 : NS_IMETHOD GetPrivateBrowsingId(uint32_t *aPrivateBrowsingId) override; \
250 : using nsIPrincipal::GetIsInIsolatedMozBrowserElement; \
251 : NS_IMETHOD GetIsInIsolatedMozBrowserElement(bool *aIsInIsolatedMozBrowserElement) override; \
252 : using nsIPrincipal::GetIsNullPrincipal; \
253 : NS_IMETHOD GetIsNullPrincipal(bool *aIsNullPrincipal) override; \
254 : using nsIPrincipal::GetIsCodebasePrincipal; \
255 : NS_IMETHOD GetIsCodebasePrincipal(bool *aIsCodebasePrincipal) override; \
256 : using nsIPrincipal::GetIsExpandedPrincipal; \
257 : NS_IMETHOD GetIsExpandedPrincipal(bool *aIsExpandedPrincipal) override; \
258 : using nsIPrincipal::GetIsSystemPrincipal; \
259 : NS_IMETHOD GetIsSystemPrincipal(bool *aIsSystemPrincipal) override;
260 :
261 : /* Use this macro when declaring the members of this interface when the
262 : class doesn't implement the interface. This is useful for forwarding. */
263 : #define NS_DECL_NON_VIRTUAL_NSIPRINCIPAL \
264 : nsresult Equals(nsIPrincipal *other, bool *_retval); \
265 : nsresult EqualsConsideringDomain(nsIPrincipal *other, bool *_retval); \
266 : nsresult GetHashValue(uint32_t *aHashValue); \
267 : nsresult GetURI(nsIURI * *aURI); \
268 : nsresult GetDomain(nsIURI * *aDomain); \
269 : nsresult SetDomain(nsIURI *aDomain); \
270 : nsresult Subsumes(nsIPrincipal *other, bool *_retval); \
271 : nsresult SubsumesConsideringDomain(nsIPrincipal *other, bool *_retval); \
272 : nsresult SubsumesConsideringDomainIgnoringFPD(nsIPrincipal *other, bool *_retval); \
273 : nsresult CheckMayLoad(nsIURI *uri, bool report, bool allowIfInheritsPrincipal); \
274 : nsresult GetCsp(nsIContentSecurityPolicy * *aCsp); \
275 : nsresult SetCsp(nsIContentSecurityPolicy *aCsp); \
276 : nsresult EnsureCSP(nsIDOMDocument *aDocument, nsIContentSecurityPolicy * *_retval); \
277 : nsresult GetPreloadCsp(nsIContentSecurityPolicy * *aPreloadCsp); \
278 : nsresult EnsurePreloadCSP(nsIDOMDocument *aDocument, nsIContentSecurityPolicy * *_retval); \
279 : nsresult GetCspJSON(nsAString & aCspJSON); \
280 : nsresult GetOriginAttributes(JSContext* cx, JS::MutableHandleValue aOriginAttributes); \
281 : const mozilla::OriginAttributes & OriginAttributesRef(void); \
282 : nsresult GetOrigin(nsACString & aOrigin); \
283 : nsresult GetOriginNoSuffix(nsACString & aOriginNoSuffix); \
284 : nsresult GetOriginSuffix(nsACString & aOriginSuffix); \
285 : nsresult GetBaseDomain(nsACString & aBaseDomain); \
286 : using nsIPrincipal::GetAppId; \
287 : nsresult GetAppId(uint32_t *aAppId); \
288 : nsresult GetAddonId(nsAString & aAddonId); \
289 : using nsIPrincipal::GetUserContextId; \
290 : nsresult GetUserContextId(uint32_t *aUserContextId); \
291 : using nsIPrincipal::GetPrivateBrowsingId; \
292 : nsresult GetPrivateBrowsingId(uint32_t *aPrivateBrowsingId); \
293 : using nsIPrincipal::GetIsInIsolatedMozBrowserElement; \
294 : nsresult GetIsInIsolatedMozBrowserElement(bool *aIsInIsolatedMozBrowserElement); \
295 : using nsIPrincipal::GetIsNullPrincipal; \
296 : nsresult GetIsNullPrincipal(bool *aIsNullPrincipal); \
297 : using nsIPrincipal::GetIsCodebasePrincipal; \
298 : nsresult GetIsCodebasePrincipal(bool *aIsCodebasePrincipal); \
299 : using nsIPrincipal::GetIsExpandedPrincipal; \
300 : nsresult GetIsExpandedPrincipal(bool *aIsExpandedPrincipal); \
301 : using nsIPrincipal::GetIsSystemPrincipal; \
302 : nsresult GetIsSystemPrincipal(bool *aIsSystemPrincipal);
303 :
304 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
305 : #define NS_FORWARD_NSIPRINCIPAL(_to) \
306 : NS_IMETHOD Equals(nsIPrincipal *other, bool *_retval) override { return _to Equals(other, _retval); } \
307 : NS_IMETHOD EqualsConsideringDomain(nsIPrincipal *other, bool *_retval) override { return _to EqualsConsideringDomain(other, _retval); } \
308 : NS_IMETHOD GetHashValue(uint32_t *aHashValue) override { return _to GetHashValue(aHashValue); } \
309 : NS_IMETHOD GetURI(nsIURI * *aURI) override { return _to GetURI(aURI); } \
310 : NS_IMETHOD GetDomain(nsIURI * *aDomain) override { return _to GetDomain(aDomain); } \
311 : NS_IMETHOD SetDomain(nsIURI *aDomain) override { return _to SetDomain(aDomain); } \
312 : NS_IMETHOD Subsumes(nsIPrincipal *other, bool *_retval) override { return _to Subsumes(other, _retval); } \
313 : NS_IMETHOD SubsumesConsideringDomain(nsIPrincipal *other, bool *_retval) override { return _to SubsumesConsideringDomain(other, _retval); } \
314 : NS_IMETHOD SubsumesConsideringDomainIgnoringFPD(nsIPrincipal *other, bool *_retval) override { return _to SubsumesConsideringDomainIgnoringFPD(other, _retval); } \
315 : NS_IMETHOD CheckMayLoad(nsIURI *uri, bool report, bool allowIfInheritsPrincipal) override { return _to CheckMayLoad(uri, report, allowIfInheritsPrincipal); } \
316 : NS_IMETHOD GetCsp(nsIContentSecurityPolicy * *aCsp) override { return _to GetCsp(aCsp); } \
317 : NS_IMETHOD SetCsp(nsIContentSecurityPolicy *aCsp) override { return _to SetCsp(aCsp); } \
318 : NS_IMETHOD EnsureCSP(nsIDOMDocument *aDocument, nsIContentSecurityPolicy * *_retval) override { return _to EnsureCSP(aDocument, _retval); } \
319 : NS_IMETHOD GetPreloadCsp(nsIContentSecurityPolicy * *aPreloadCsp) override { return _to GetPreloadCsp(aPreloadCsp); } \
320 : NS_IMETHOD EnsurePreloadCSP(nsIDOMDocument *aDocument, nsIContentSecurityPolicy * *_retval) override { return _to EnsurePreloadCSP(aDocument, _retval); } \
321 : NS_IMETHOD GetCspJSON(nsAString & aCspJSON) override { return _to GetCspJSON(aCspJSON); } \
322 : NS_IMETHOD GetOriginAttributes(JSContext* cx, JS::MutableHandleValue aOriginAttributes) override { return _to GetOriginAttributes(cx, aOriginAttributes); } \
323 : virtual const mozilla::OriginAttributes & OriginAttributesRef(void) override { return _to OriginAttributesRef(); } \
324 : NS_IMETHOD GetOrigin(nsACString & aOrigin) override { return _to GetOrigin(aOrigin); } \
325 : NS_IMETHOD GetOriginNoSuffix(nsACString & aOriginNoSuffix) override { return _to GetOriginNoSuffix(aOriginNoSuffix); } \
326 : NS_IMETHOD GetOriginSuffix(nsACString & aOriginSuffix) override { return _to GetOriginSuffix(aOriginSuffix); } \
327 : NS_IMETHOD GetBaseDomain(nsACString & aBaseDomain) override { return _to GetBaseDomain(aBaseDomain); } \
328 : using nsIPrincipal::GetAppId; \
329 : NS_IMETHOD GetAppId(uint32_t *aAppId) override { return _to GetAppId(aAppId); } \
330 : NS_IMETHOD GetAddonId(nsAString & aAddonId) override { return _to GetAddonId(aAddonId); } \
331 : using nsIPrincipal::GetUserContextId; \
332 : NS_IMETHOD GetUserContextId(uint32_t *aUserContextId) override { return _to GetUserContextId(aUserContextId); } \
333 : using nsIPrincipal::GetPrivateBrowsingId; \
334 : NS_IMETHOD GetPrivateBrowsingId(uint32_t *aPrivateBrowsingId) override { return _to GetPrivateBrowsingId(aPrivateBrowsingId); } \
335 : using nsIPrincipal::GetIsInIsolatedMozBrowserElement; \
336 : NS_IMETHOD GetIsInIsolatedMozBrowserElement(bool *aIsInIsolatedMozBrowserElement) override { return _to GetIsInIsolatedMozBrowserElement(aIsInIsolatedMozBrowserElement); } \
337 : using nsIPrincipal::GetIsNullPrincipal; \
338 : NS_IMETHOD GetIsNullPrincipal(bool *aIsNullPrincipal) override { return _to GetIsNullPrincipal(aIsNullPrincipal); } \
339 : using nsIPrincipal::GetIsCodebasePrincipal; \
340 : NS_IMETHOD GetIsCodebasePrincipal(bool *aIsCodebasePrincipal) override { return _to GetIsCodebasePrincipal(aIsCodebasePrincipal); } \
341 : using nsIPrincipal::GetIsExpandedPrincipal; \
342 : NS_IMETHOD GetIsExpandedPrincipal(bool *aIsExpandedPrincipal) override { return _to GetIsExpandedPrincipal(aIsExpandedPrincipal); } \
343 : using nsIPrincipal::GetIsSystemPrincipal; \
344 : NS_IMETHOD GetIsSystemPrincipal(bool *aIsSystemPrincipal) override { return _to GetIsSystemPrincipal(aIsSystemPrincipal); }
345 :
346 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
347 : #define NS_FORWARD_SAFE_NSIPRINCIPAL(_to) \
348 : NS_IMETHOD Equals(nsIPrincipal *other, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Equals(other, _retval); } \
349 : NS_IMETHOD EqualsConsideringDomain(nsIPrincipal *other, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->EqualsConsideringDomain(other, _retval); } \
350 : NS_IMETHOD GetHashValue(uint32_t *aHashValue) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHashValue(aHashValue); } \
351 : NS_IMETHOD GetURI(nsIURI * *aURI) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetURI(aURI); } \
352 : NS_IMETHOD GetDomain(nsIURI * *aDomain) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDomain(aDomain); } \
353 : NS_IMETHOD SetDomain(nsIURI *aDomain) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDomain(aDomain); } \
354 : NS_IMETHOD Subsumes(nsIPrincipal *other, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Subsumes(other, _retval); } \
355 : NS_IMETHOD SubsumesConsideringDomain(nsIPrincipal *other, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SubsumesConsideringDomain(other, _retval); } \
356 : NS_IMETHOD SubsumesConsideringDomainIgnoringFPD(nsIPrincipal *other, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SubsumesConsideringDomainIgnoringFPD(other, _retval); } \
357 : NS_IMETHOD CheckMayLoad(nsIURI *uri, bool report, bool allowIfInheritsPrincipal) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CheckMayLoad(uri, report, allowIfInheritsPrincipal); } \
358 : NS_IMETHOD GetCsp(nsIContentSecurityPolicy * *aCsp) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCsp(aCsp); } \
359 : NS_IMETHOD SetCsp(nsIContentSecurityPolicy *aCsp) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCsp(aCsp); } \
360 : NS_IMETHOD EnsureCSP(nsIDOMDocument *aDocument, nsIContentSecurityPolicy * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->EnsureCSP(aDocument, _retval); } \
361 : NS_IMETHOD GetPreloadCsp(nsIContentSecurityPolicy * *aPreloadCsp) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPreloadCsp(aPreloadCsp); } \
362 : NS_IMETHOD EnsurePreloadCSP(nsIDOMDocument *aDocument, nsIContentSecurityPolicy * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->EnsurePreloadCSP(aDocument, _retval); } \
363 : NS_IMETHOD GetCspJSON(nsAString & aCspJSON) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCspJSON(aCspJSON); } \
364 : NS_IMETHOD GetOriginAttributes(JSContext* cx, JS::MutableHandleValue aOriginAttributes) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOriginAttributes(cx, aOriginAttributes); } \
365 : virtual const mozilla::OriginAttributes & OriginAttributesRef(void) override; \
366 : NS_IMETHOD GetOrigin(nsACString & aOrigin) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOrigin(aOrigin); } \
367 : NS_IMETHOD GetOriginNoSuffix(nsACString & aOriginNoSuffix) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOriginNoSuffix(aOriginNoSuffix); } \
368 : NS_IMETHOD GetOriginSuffix(nsACString & aOriginSuffix) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOriginSuffix(aOriginSuffix); } \
369 : NS_IMETHOD GetBaseDomain(nsACString & aBaseDomain) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBaseDomain(aBaseDomain); } \
370 : NS_IMETHOD GetAppId(uint32_t *aAppId) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAppId(aAppId); } \
371 : NS_IMETHOD GetAddonId(nsAString & aAddonId) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAddonId(aAddonId); } \
372 : NS_IMETHOD GetUserContextId(uint32_t *aUserContextId) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUserContextId(aUserContextId); } \
373 : NS_IMETHOD GetPrivateBrowsingId(uint32_t *aPrivateBrowsingId) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPrivateBrowsingId(aPrivateBrowsingId); } \
374 : NS_IMETHOD GetIsInIsolatedMozBrowserElement(bool *aIsInIsolatedMozBrowserElement) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsInIsolatedMozBrowserElement(aIsInIsolatedMozBrowserElement); } \
375 : NS_IMETHOD GetIsNullPrincipal(bool *aIsNullPrincipal) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsNullPrincipal(aIsNullPrincipal); } \
376 : NS_IMETHOD GetIsCodebasePrincipal(bool *aIsCodebasePrincipal) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsCodebasePrincipal(aIsCodebasePrincipal); } \
377 : NS_IMETHOD GetIsExpandedPrincipal(bool *aIsExpandedPrincipal) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsExpandedPrincipal(aIsExpandedPrincipal); } \
378 : NS_IMETHOD GetIsSystemPrincipal(bool *aIsSystemPrincipal) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsSystemPrincipal(aIsSystemPrincipal); }
379 :
380 : #if 0
381 : /* Use the code below as a template for the implementation class for this interface. */
382 :
383 : /* Header file */
384 : class nsPrincipal : public nsIPrincipal
385 : {
386 : public:
387 : NS_DECL_ISUPPORTS
388 : NS_DECL_NSIPRINCIPAL
389 :
390 : nsPrincipal();
391 :
392 : private:
393 : ~nsPrincipal();
394 :
395 : protected:
396 : /* additional members */
397 : };
398 :
399 : /* Implementation file */
400 : NS_IMPL_ISUPPORTS(nsPrincipal, nsIPrincipal)
401 :
402 : nsPrincipal::nsPrincipal()
403 : {
404 : /* member initializers and constructor code */
405 : }
406 :
407 : nsPrincipal::~nsPrincipal()
408 : {
409 : /* destructor code */
410 : }
411 :
412 : /* boolean equals (in nsIPrincipal other); */
413 : NS_IMETHODIMP nsPrincipal::Equals(nsIPrincipal *other, bool *_retval)
414 : {
415 : return NS_ERROR_NOT_IMPLEMENTED;
416 : }
417 :
418 : /* boolean equalsConsideringDomain (in nsIPrincipal other); */
419 : NS_IMETHODIMP nsPrincipal::EqualsConsideringDomain(nsIPrincipal *other, bool *_retval)
420 : {
421 : return NS_ERROR_NOT_IMPLEMENTED;
422 : }
423 :
424 : /* [noscript] readonly attribute unsigned long hashValue; */
425 : NS_IMETHODIMP nsPrincipal::GetHashValue(uint32_t *aHashValue)
426 : {
427 : return NS_ERROR_NOT_IMPLEMENTED;
428 : }
429 :
430 : /* readonly attribute nsIURI URI; */
431 : NS_IMETHODIMP nsPrincipal::GetURI(nsIURI * *aURI)
432 : {
433 : return NS_ERROR_NOT_IMPLEMENTED;
434 : }
435 :
436 : /* [noscript] attribute nsIURI domain; */
437 : NS_IMETHODIMP nsPrincipal::GetDomain(nsIURI * *aDomain)
438 : {
439 : return NS_ERROR_NOT_IMPLEMENTED;
440 : }
441 : NS_IMETHODIMP nsPrincipal::SetDomain(nsIURI *aDomain)
442 : {
443 : return NS_ERROR_NOT_IMPLEMENTED;
444 : }
445 :
446 : /* boolean subsumes (in nsIPrincipal other); */
447 : NS_IMETHODIMP nsPrincipal::Subsumes(nsIPrincipal *other, bool *_retval)
448 : {
449 : return NS_ERROR_NOT_IMPLEMENTED;
450 : }
451 :
452 : /* boolean subsumesConsideringDomain (in nsIPrincipal other); */
453 : NS_IMETHODIMP nsPrincipal::SubsumesConsideringDomain(nsIPrincipal *other, bool *_retval)
454 : {
455 : return NS_ERROR_NOT_IMPLEMENTED;
456 : }
457 :
458 : /* boolean subsumesConsideringDomainIgnoringFPD (in nsIPrincipal other); */
459 : NS_IMETHODIMP nsPrincipal::SubsumesConsideringDomainIgnoringFPD(nsIPrincipal *other, bool *_retval)
460 : {
461 : return NS_ERROR_NOT_IMPLEMENTED;
462 : }
463 :
464 : /* void checkMayLoad (in nsIURI uri, in boolean report, in boolean allowIfInheritsPrincipal); */
465 : NS_IMETHODIMP nsPrincipal::CheckMayLoad(nsIURI *uri, bool report, bool allowIfInheritsPrincipal)
466 : {
467 : return NS_ERROR_NOT_IMPLEMENTED;
468 : }
469 :
470 : /* [noscript] attribute nsIContentSecurityPolicy csp; */
471 : NS_IMETHODIMP nsPrincipal::GetCsp(nsIContentSecurityPolicy * *aCsp)
472 : {
473 : return NS_ERROR_NOT_IMPLEMENTED;
474 : }
475 : NS_IMETHODIMP nsPrincipal::SetCsp(nsIContentSecurityPolicy *aCsp)
476 : {
477 : return NS_ERROR_NOT_IMPLEMENTED;
478 : }
479 :
480 : /* [noscript] nsIContentSecurityPolicy ensureCSP (in nsIDOMDocument aDocument); */
481 : NS_IMETHODIMP nsPrincipal::EnsureCSP(nsIDOMDocument *aDocument, nsIContentSecurityPolicy * *_retval)
482 : {
483 : return NS_ERROR_NOT_IMPLEMENTED;
484 : }
485 :
486 : /* [noscript] readonly attribute nsIContentSecurityPolicy preloadCsp; */
487 : NS_IMETHODIMP nsPrincipal::GetPreloadCsp(nsIContentSecurityPolicy * *aPreloadCsp)
488 : {
489 : return NS_ERROR_NOT_IMPLEMENTED;
490 : }
491 :
492 : /* [noscript] nsIContentSecurityPolicy ensurePreloadCSP (in nsIDOMDocument aDocument); */
493 : NS_IMETHODIMP nsPrincipal::EnsurePreloadCSP(nsIDOMDocument *aDocument, nsIContentSecurityPolicy * *_retval)
494 : {
495 : return NS_ERROR_NOT_IMPLEMENTED;
496 : }
497 :
498 : /* readonly attribute AString cspJSON; */
499 : NS_IMETHODIMP nsPrincipal::GetCspJSON(nsAString & aCspJSON)
500 : {
501 : return NS_ERROR_NOT_IMPLEMENTED;
502 : }
503 :
504 : /* [implicit_jscontext] readonly attribute jsval originAttributes; */
505 : NS_IMETHODIMP nsPrincipal::GetOriginAttributes(JSContext* cx, JS::MutableHandleValue aOriginAttributes)
506 : {
507 : return NS_ERROR_NOT_IMPLEMENTED;
508 : }
509 :
510 : /* [binaryname(OriginAttributesRef),noscript,nostdcall,notxpcom] const_OriginAttributes OriginAttributesRef (); */
511 : const mozilla::OriginAttributes & nsPrincipal::OriginAttributesRef()
512 : {
513 : return NS_ERROR_NOT_IMPLEMENTED;
514 : }
515 :
516 : /* readonly attribute ACString origin; */
517 : NS_IMETHODIMP nsPrincipal::GetOrigin(nsACString & aOrigin)
518 : {
519 : return NS_ERROR_NOT_IMPLEMENTED;
520 : }
521 :
522 : /* readonly attribute ACString originNoSuffix; */
523 : NS_IMETHODIMP nsPrincipal::GetOriginNoSuffix(nsACString & aOriginNoSuffix)
524 : {
525 : return NS_ERROR_NOT_IMPLEMENTED;
526 : }
527 :
528 : /* readonly attribute AUTF8String originSuffix; */
529 : NS_IMETHODIMP nsPrincipal::GetOriginSuffix(nsACString & aOriginSuffix)
530 : {
531 : return NS_ERROR_NOT_IMPLEMENTED;
532 : }
533 :
534 : /* readonly attribute ACString baseDomain; */
535 : NS_IMETHODIMP nsPrincipal::GetBaseDomain(nsACString & aBaseDomain)
536 : {
537 : return NS_ERROR_NOT_IMPLEMENTED;
538 : }
539 :
540 : /* [infallible] readonly attribute unsigned long appId; */
541 : NS_IMETHODIMP nsPrincipal::GetAppId(uint32_t *aAppId)
542 : {
543 : return NS_ERROR_NOT_IMPLEMENTED;
544 : }
545 :
546 : /* readonly attribute AString addonId; */
547 : NS_IMETHODIMP nsPrincipal::GetAddonId(nsAString & aAddonId)
548 : {
549 : return NS_ERROR_NOT_IMPLEMENTED;
550 : }
551 :
552 : /* [infallible] readonly attribute unsigned long userContextId; */
553 : NS_IMETHODIMP nsPrincipal::GetUserContextId(uint32_t *aUserContextId)
554 : {
555 : return NS_ERROR_NOT_IMPLEMENTED;
556 : }
557 :
558 : /* [infallible] readonly attribute unsigned long privateBrowsingId; */
559 : NS_IMETHODIMP nsPrincipal::GetPrivateBrowsingId(uint32_t *aPrivateBrowsingId)
560 : {
561 : return NS_ERROR_NOT_IMPLEMENTED;
562 : }
563 :
564 : /* [infallible] readonly attribute boolean isInIsolatedMozBrowserElement; */
565 : NS_IMETHODIMP nsPrincipal::GetIsInIsolatedMozBrowserElement(bool *aIsInIsolatedMozBrowserElement)
566 : {
567 : return NS_ERROR_NOT_IMPLEMENTED;
568 : }
569 :
570 : /* [infallible] readonly attribute boolean isNullPrincipal; */
571 : NS_IMETHODIMP nsPrincipal::GetIsNullPrincipal(bool *aIsNullPrincipal)
572 : {
573 : return NS_ERROR_NOT_IMPLEMENTED;
574 : }
575 :
576 : /* [infallible] readonly attribute boolean isCodebasePrincipal; */
577 : NS_IMETHODIMP nsPrincipal::GetIsCodebasePrincipal(bool *aIsCodebasePrincipal)
578 : {
579 : return NS_ERROR_NOT_IMPLEMENTED;
580 : }
581 :
582 : /* [infallible] readonly attribute boolean isExpandedPrincipal; */
583 : NS_IMETHODIMP nsPrincipal::GetIsExpandedPrincipal(bool *aIsExpandedPrincipal)
584 : {
585 : return NS_ERROR_NOT_IMPLEMENTED;
586 : }
587 :
588 : /* [infallible] readonly attribute boolean isSystemPrincipal; */
589 : NS_IMETHODIMP nsPrincipal::GetIsSystemPrincipal(bool *aIsSystemPrincipal)
590 : {
591 : return NS_ERROR_NOT_IMPLEMENTED;
592 : }
593 :
594 : /* End of implementation class template. */
595 : #endif
596 :
597 :
598 : /* starting interface: nsIExpandedPrincipal */
599 : #define NS_IEXPANDEDPRINCIPAL_IID_STR "f3e177df-6a5e-489f-80a7-2dd1481471d8"
600 :
601 : #define NS_IEXPANDEDPRINCIPAL_IID \
602 : {0xf3e177df, 0x6a5e, 0x489f, \
603 : { 0x80, 0xa7, 0x2d, 0xd1, 0x48, 0x14, 0x71, 0xd8 }}
604 :
605 0 : class NS_NO_VTABLE nsIExpandedPrincipal : public nsISupports {
606 : public:
607 :
608 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IEXPANDEDPRINCIPAL_IID)
609 :
610 : /* [noscript] readonly attribute PrincipalArray whiteList; */
611 : NS_IMETHOD GetWhiteList(nsTArray<nsCOMPtr<nsIPrincipal> > **aWhiteList) = 0;
612 :
613 : };
614 :
615 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIExpandedPrincipal, NS_IEXPANDEDPRINCIPAL_IID)
616 :
617 : /* Use this macro when declaring classes that implement this interface. */
618 : #define NS_DECL_NSIEXPANDEDPRINCIPAL \
619 : NS_IMETHOD GetWhiteList(nsTArray<nsCOMPtr<nsIPrincipal> > **aWhiteList) override;
620 :
621 : /* Use this macro when declaring the members of this interface when the
622 : class doesn't implement the interface. This is useful for forwarding. */
623 : #define NS_DECL_NON_VIRTUAL_NSIEXPANDEDPRINCIPAL \
624 : nsresult GetWhiteList(nsTArray<nsCOMPtr<nsIPrincipal> > **aWhiteList);
625 :
626 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
627 : #define NS_FORWARD_NSIEXPANDEDPRINCIPAL(_to) \
628 : NS_IMETHOD GetWhiteList(nsTArray<nsCOMPtr<nsIPrincipal> > **aWhiteList) override { return _to GetWhiteList(aWhiteList); }
629 :
630 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
631 : #define NS_FORWARD_SAFE_NSIEXPANDEDPRINCIPAL(_to) \
632 : NS_IMETHOD GetWhiteList(nsTArray<nsCOMPtr<nsIPrincipal> > **aWhiteList) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetWhiteList(aWhiteList); }
633 :
634 : #if 0
635 : /* Use the code below as a template for the implementation class for this interface. */
636 :
637 : /* Header file */
638 : class nsExpandedPrincipal : public nsIExpandedPrincipal
639 : {
640 : public:
641 : NS_DECL_ISUPPORTS
642 : NS_DECL_NSIEXPANDEDPRINCIPAL
643 :
644 : nsExpandedPrincipal();
645 :
646 : private:
647 : ~nsExpandedPrincipal();
648 :
649 : protected:
650 : /* additional members */
651 : };
652 :
653 : /* Implementation file */
654 : NS_IMPL_ISUPPORTS(nsExpandedPrincipal, nsIExpandedPrincipal)
655 :
656 : nsExpandedPrincipal::nsExpandedPrincipal()
657 : {
658 : /* member initializers and constructor code */
659 : }
660 :
661 : nsExpandedPrincipal::~nsExpandedPrincipal()
662 : {
663 : /* destructor code */
664 : }
665 :
666 : /* [noscript] readonly attribute PrincipalArray whiteList; */
667 : NS_IMETHODIMP nsExpandedPrincipal::GetWhiteList(nsTArray<nsCOMPtr<nsIPrincipal> > **aWhiteList)
668 : {
669 : return NS_ERROR_NOT_IMPLEMENTED;
670 : }
671 :
672 : /* End of implementation class template. */
673 : #endif
674 :
675 :
676 : #endif /* __gen_nsIPrincipal_h__ */
|