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
|
|
|
|
2018-07-17 22:38:19 +03:00
|
|
|
#ifndef mozilla_SystemPrincipal_h
|
|
|
|
#define mozilla_SystemPrincipal_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 \
|
2018-11-30 13:46:48 +03:00
|
|
|
{ \
|
2000-01-06 03:59:18 +03:00
|
|
|
0x4a6212db, 0xaccb, 0x11d3, { \
|
|
|
|
0xb7, 0x65, 0x0, 0x60, 0xb0, 0xb6, 0xce, 0xcb \
|
|
|
|
} \
|
2018-11-30 13:46:48 +03:00
|
|
|
}
|
2001-07-31 23:05:34 +04:00
|
|
|
#define NS_SYSTEMPRINCIPAL_CONTRACTID "@mozilla.org/systemprincipal;1"
|
2000-01-06 03:59:18 +03:00
|
|
|
|
2019-06-03 15:37:12 +03:00
|
|
|
namespace Json {
|
|
|
|
class Value;
|
|
|
|
}
|
|
|
|
|
2018-07-17 22:38:19 +03:00
|
|
|
namespace mozilla {
|
1999-09-01 04:54:35 +04:00
|
|
|
|
2018-07-17 22:38:19 +03:00
|
|
|
class SystemPrincipal final : public BasePrincipal {
|
2017-02-25 01:02:24 +03:00
|
|
|
SystemPrincipal() : BasePrincipal(eSystemPrincipal) {}
|
|
|
|
|
1999-09-01 04:54:35 +04:00
|
|
|
public:
|
2017-03-22 13:39:08 +03:00
|
|
|
static already_AddRefed<SystemPrincipal> Create();
|
2017-02-25 01:02:24 +03:00
|
|
|
|
2017-04-16 23:32:42 +03:00
|
|
|
static PrincipalKind Kind() { return eSystemPrincipal; }
|
|
|
|
|
2015-05-12 00:36:56 +03:00
|
|
|
NS_DECL_NSISERIALIZABLE
|
|
|
|
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) override;
|
2018-11-20 04:17:52 +03:00
|
|
|
uint32_t GetHashValue() override;
|
2015-05-12 00:36:56 +03:00
|
|
|
NS_IMETHOD GetURI(nsIURI** aURI) override;
|
|
|
|
NS_IMETHOD GetDomain(nsIURI** aDomain) override;
|
|
|
|
NS_IMETHOD SetDomain(nsIURI* aDomain) override;
|
|
|
|
NS_IMETHOD GetBaseDomain(nsACString& aBaseDomain) override;
|
2016-11-06 08:38:17 +03:00
|
|
|
NS_IMETHOD GetAddonId(nsAString& aAddonId) override;
|
2019-12-05 19:04:53 +03:00
|
|
|
NS_IMETHOD GetIsOriginPotentiallyTrustworthy(bool* aResult) override;
|
2015-05-12 00:36:56 +03:00
|
|
|
|
2016-08-30 07:22:04 +03:00
|
|
|
virtual nsresult GetScriptLocation(nsACString& aStr) override;
|
2012-03-09 13:48:50 +04:00
|
|
|
|
2018-09-11 12:01:14 +03:00
|
|
|
nsresult GetSiteIdentifier(SiteIdentifier& aSite) override {
|
|
|
|
aSite.Init(this);
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2003-10-22 02:11:49 +04:00
|
|
|
protected:
|
2017-03-22 13:39:08 +03:00
|
|
|
virtual ~SystemPrincipal(void) {}
|
2015-05-14 21:15:56 +03:00
|
|
|
|
2017-03-22 13:39:08 +03:00
|
|
|
bool SubsumesInternal(nsIPrincipal* aOther,
|
|
|
|
DocumentDomainConsideration aConsideration) override {
|
2015-05-14 21:15:56 +03:00
|
|
|
return true;
|
|
|
|
}
|
2015-10-01 06:03:36 +03:00
|
|
|
|
|
|
|
bool MayLoadInternal(nsIURI* aURI) override { return true; }
|
1999-09-01 04:54:35 +04:00
|
|
|
};
|
|
|
|
|
2018-07-17 22:38:19 +03:00
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_SystemPrincipal_h
|