2018-11-30 19:52:05 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
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/. */
|
2001-03-29 02:11:48 +00:00
|
|
|
|
|
|
|
#ifndef nsPermission_h__
|
|
|
|
#define nsPermission_h__
|
|
|
|
|
|
|
|
#include "nsIPermission.h"
|
2019-04-26 22:31:57 +00:00
|
|
|
#include "nsCOMPtr.h"
|
2003-03-22 01:24:51 +00:00
|
|
|
#include "nsString.h"
|
2001-03-29 02:11:48 +00:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2003-06-18 00:52:59 +00:00
|
|
|
class nsPermission : public nsIPermission {
|
2001-03-29 02:11:48 +00:00
|
|
|
public:
|
|
|
|
// nsISupports
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIPERMISSION
|
|
|
|
|
2019-04-18 13:43:10 +00:00
|
|
|
static already_AddRefed<nsPermission> Create(
|
|
|
|
nsIPrincipal* aPrincipal, const nsACString& aType, uint32_t aCapability,
|
|
|
|
uint32_t aExpireType, int64_t aExpireTime, int64_t aModificationTime);
|
2016-09-20 08:35:21 +00:00
|
|
|
|
2019-04-15 10:26:09 +00:00
|
|
|
// This method creates a new nsIPrincipal with a stripped OriginAttributes (no
|
2019-07-08 16:37:45 +00:00
|
|
|
// userContextId) and a content principal equal to the origin of 'aPrincipal'.
|
2019-04-15 10:26:09 +00:00
|
|
|
static already_AddRefed<nsIPrincipal> ClonePrincipalForPermission(
|
|
|
|
nsIPrincipal* aPrincipal);
|
|
|
|
|
2016-09-20 08:35:21 +00:00
|
|
|
protected:
|
2015-06-10 16:48:22 +00:00
|
|
|
nsPermission(nsIPrincipal* aPrincipal, const nsACString& aType,
|
2019-04-18 13:43:10 +00:00
|
|
|
uint32_t aCapability, uint32_t aExpireType, int64_t aExpireTime,
|
|
|
|
int64_t aModificationTime);
|
2009-10-16 21:01:04 +00:00
|
|
|
|
2012-08-23 18:37:31 +00:00
|
|
|
virtual ~nsPermission(){};
|
|
|
|
|
2015-06-10 16:48:22 +00:00
|
|
|
nsCOMPtr<nsIPrincipal> mPrincipal;
|
2003-07-09 00:20:57 +00:00
|
|
|
nsCString mType;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mCapability;
|
|
|
|
uint32_t mExpireType;
|
|
|
|
int64_t mExpireTime;
|
2019-04-18 13:43:10 +00:00
|
|
|
int64_t mModificationTime;
|
2001-03-29 02:11:48 +00:00
|
|
|
};
|
|
|
|
|
2003-06-18 00:52:59 +00:00
|
|
|
#endif // nsPermission_h__
|