2015-05-11 21:36:56 +00: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 11:12:37 +00: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-11 22:10:36 +00:00
|
|
|
|
1999-09-01 00:54:35 +00:00
|
|
|
/* The privileged system principal. */
|
1999-11-11 22:10:36 +00:00
|
|
|
|
2003-10-21 22:11:49 +00:00
|
|
|
#ifndef nsSystemPrincipal_h__
|
|
|
|
#define nsSystemPrincipal_h__
|
1999-09-01 00:54:35 +00:00
|
|
|
|
2003-10-21 22:11:49 +00:00
|
|
|
#include "nsIPrincipal.h"
|
|
|
|
#include "nsJSPrincipals.h"
|
1999-09-01 00:54:35 +00:00
|
|
|
|
2015-05-11 21:36:56 +00:00
|
|
|
#include "mozilla/BasePrincipal.h"
|
|
|
|
|
1999-09-01 00:54:35 +00:00
|
|
|
#define NS_SYSTEMPRINCIPAL_CID \
|
2000-01-06 00:59:18 +00:00
|
|
|
{ 0x4a6212db, 0xaccb, 0x11d3, \
|
|
|
|
{ 0xb7, 0x65, 0x0, 0x60, 0xb0, 0xb6, 0xce, 0xcb }}
|
2001-07-31 19:05:34 +00:00
|
|
|
#define NS_SYSTEMPRINCIPAL_CONTRACTID "@mozilla.org/systemprincipal;1"
|
2000-01-06 00:59:18 +00:00
|
|
|
|
1999-09-01 00:54:35 +00:00
|
|
|
|
2015-05-11 21:36:56 +00:00
|
|
|
class nsSystemPrincipal final : public mozilla::BasePrincipal
|
2003-10-21 22:11:49 +00:00
|
|
|
{
|
1999-09-01 00:54:35 +00:00
|
|
|
public:
|
2015-05-11 21:36:56 +00: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;
|
|
|
|
NS_IMETHOD CheckMayLoad(nsIURI* uri, bool report, bool allowIfInheritsPrincipal) override;
|
2015-05-15 21:54:21 +00:00
|
|
|
NS_IMETHOD GetCsp(nsIContentSecurityPolicy** aCsp) override;
|
|
|
|
NS_IMETHOD SetCsp(nsIContentSecurityPolicy* aCsp) override;
|
2015-05-11 21:36:56 +00:00
|
|
|
NS_IMETHOD GetBaseDomain(nsACString& aBaseDomain) override;
|
2015-05-14 23:50:44 +00:00
|
|
|
nsresult GetOriginInternal(nsACString& aOrigin) override;
|
2015-05-11 21:36:56 +00:00
|
|
|
|
|
|
|
nsSystemPrincipal() {}
|
|
|
|
|
|
|
|
virtual void GetScriptLocation(nsACString &aStr) override;
|
2012-03-09 09:48:50 +00:00
|
|
|
|
2003-10-21 22:11:49 +00:00
|
|
|
protected:
|
2015-05-11 21:36:56 +00:00
|
|
|
virtual ~nsSystemPrincipal(void) {}
|
2015-05-14 18:15:56 +00:00
|
|
|
|
|
|
|
bool SubsumesInternal(nsIPrincipal *aOther, DocumentDomainConsideration aConsideration) override
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
1999-09-01 00:54:35 +00:00
|
|
|
};
|
|
|
|
|
2003-10-21 22:11:49 +00:00
|
|
|
#endif // nsSystemPrincipal_h__
|