2015-05-12 00:36:56 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-11-12 01:10:36 +03:00
|
|
|
|
1999-09-01 04:54:35 +04:00
|
|
|
/* The privileged system principal. */
|
1999-11-12 01:10:36 +03:00
|
|
|
|
2003-10-22 02:11:49 +04:00
|
|
|
#ifndef nsSystemPrincipal_h__
|
|
|
|
#define nsSystemPrincipal_h__
|
1999-09-01 04:54:35 +04:00
|
|
|
|
2003-10-22 02:11:49 +04:00
|
|
|
#include "nsIPrincipal.h"
|
|
|
|
#include "nsJSPrincipals.h"
|
1999-09-01 04:54:35 +04:00
|
|
|
|
2015-05-12 00:36:56 +03:00
|
|
|
#include "mozilla/BasePrincipal.h"
|
|
|
|
|
1999-09-01 04:54:35 +04:00
|
|
|
#define NS_SYSTEMPRINCIPAL_CID \
|
2000-01-06 03:59:18 +03:00
|
|
|
{ 0x4a6212db, 0xaccb, 0x11d3, \
|
|
|
|
{ 0xb7, 0x65, 0x0, 0x60, 0xb0, 0xb6, 0xce, 0xcb }}
|
2001-07-31 23:05:34 +04:00
|
|
|
#define NS_SYSTEMPRINCIPAL_CONTRACTID "@mozilla.org/systemprincipal;1"
|
2000-01-06 03:59:18 +03:00
|
|
|
|
1999-09-01 04:54:35 +04:00
|
|
|
|
2015-05-12 00:36:56 +03:00
|
|
|
class nsSystemPrincipal final : public mozilla::BasePrincipal
|
2003-10-22 02:11:49 +04:00
|
|
|
{
|
1999-09-01 04:54:35 +04:00
|
|
|
public:
|
2015-05-12 00:36:56 +03:00
|
|
|
NS_DECL_NSISERIALIZABLE
|
|
|
|
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override;
|
|
|
|
NS_IMETHOD GetHashValue(uint32_t* aHashValue) override;
|
|
|
|
NS_IMETHOD GetURI(nsIURI** aURI) override;
|
|
|
|
NS_IMETHOD GetDomain(nsIURI** aDomain) override;
|
|
|
|
NS_IMETHOD SetDomain(nsIURI* aDomain) override;
|
2015-05-16 00:54:21 +03:00
|
|
|
NS_IMETHOD GetCsp(nsIContentSecurityPolicy** aCsp) override;
|
|
|
|
NS_IMETHOD SetCsp(nsIContentSecurityPolicy* aCsp) override;
|
2015-11-15 06:28:23 +03:00
|
|
|
NS_IMETHOD GetPreloadCsp(nsIContentSecurityPolicy** aPreloadCSP) override;
|
|
|
|
NS_IMETHOD SetPreloadCsp(nsIContentSecurityPolicy* aPreloadCSP) override;
|
2015-05-12 00:36:56 +03:00
|
|
|
NS_IMETHOD GetBaseDomain(nsACString& aBaseDomain) override;
|
2015-05-15 02:50:44 +03:00
|
|
|
nsresult GetOriginInternal(nsACString& aOrigin) override;
|
2015-05-12 00:36:56 +03:00
|
|
|
|
|
|
|
nsSystemPrincipal() {}
|
|
|
|
|
|
|
|
virtual void GetScriptLocation(nsACString &aStr) override;
|
2012-03-09 13:48:50 +04:00
|
|
|
|
2003-10-22 02:11:49 +04:00
|
|
|
protected:
|
2015-05-12 00:36:56 +03:00
|
|
|
virtual ~nsSystemPrincipal(void) {}
|
2015-05-14 21:15:56 +03:00
|
|
|
|
|
|
|
bool SubsumesInternal(nsIPrincipal *aOther, DocumentDomainConsideration aConsideration) override
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2015-10-01 06:03:36 +03:00
|
|
|
|
|
|
|
bool MayLoadInternal(nsIURI* aURI) override
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2015-10-24 03:58:21 +03:00
|
|
|
|
|
|
|
PrincipalKind Kind() override { return eSystemPrincipal; }
|
1999-09-01 04:54:35 +04:00
|
|
|
};
|
|
|
|
|
2003-10-22 02:11:49 +04:00
|
|
|
#endif // nsSystemPrincipal_h__
|