Bug 1888590 - Mark some subtests on trusted-types-event-handlers.html as failing...
[gecko.git] / extensions / permissions / Permission.h
blob0d304a48c75a0b06d6629c09f3414893603b262b
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"
10 #include "nsCOMPtr.h"
11 #include "nsString.h"
13 namespace mozilla {
15 ////////////////////////////////////////////////////////////////////////////////
17 class Permission : public nsIPermission {
18 public:
19 // nsISupports
20 NS_DECL_ISUPPORTS
21 NS_DECL_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);
32 protected:
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;
40 nsCString mType;
41 uint32_t mCapability;
42 uint32_t mExpireType;
43 int64_t mExpireTime;
44 int64_t mModificationTime;
47 } // namespace mozilla
49 #endif // mozilla_Permission_h