1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_Permission_h
7 #define mozilla_Permission_h
9 #include "nsIPermission.h"
15 ////////////////////////////////////////////////////////////////////////////////
17 class Permission
: public nsIPermission
{
23 static already_AddRefed
<Permission
> Create(
24 nsIPrincipal
* aPrincipal
, const nsACString
& aType
, uint32_t aCapability
,
25 uint32_t aExpireType
, int64_t aExpireTime
, int64_t aModificationTime
);
27 // This method creates a new nsIPrincipal with a stripped OriginAttributes (no
28 // userContextId) and a content principal equal to the origin of 'aPrincipal'.
29 static already_AddRefed
<nsIPrincipal
> ClonePrincipalForPermission(
30 nsIPrincipal
* aPrincipal
);
33 Permission(nsIPrincipal
* aPrincipal
, const nsACString
& aType
,
34 uint32_t aCapability
, uint32_t aExpireType
, int64_t aExpireTime
,
35 int64_t aModificationTime
);
37 virtual ~Permission() = default;
39 nsCOMPtr
<nsIPrincipal
> mPrincipal
;
44 int64_t mModificationTime
;
47 } // namespace mozilla
49 #endif // mozilla_Permission_h