Bug 1878973 [wpt PR 44428] - [wptserve] Move the TLS handshake to the per-accept...
[gecko.git] / dom / permission / PermissionObserver.h
blobf48f26e76a27d12470c39fc0c6038bdebb651159
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_PermissionObserver_h_
8 #define mozilla_dom_PermissionObserver_h_
10 #include "mozilla/dom/PermissionsBinding.h"
12 #include "nsIObserver.h"
13 #include "nsIPrincipal.h"
14 #include "nsTArray.h"
15 #include "nsWeakReference.h"
17 namespace mozilla::dom {
19 class PermissionStatus;
21 // Singleton that watches for perm-changed notifications in order to notify
22 // PermissionStatus objects.
23 class PermissionObserver final : public nsIObserver,
24 public nsSupportsWeakReference {
25 public:
26 NS_DECL_ISUPPORTS
27 NS_DECL_NSIOBSERVER
29 static already_AddRefed<PermissionObserver> GetInstance();
31 void AddSink(PermissionStatus* aObs);
32 void RemoveSink(PermissionStatus* aObs);
34 private:
35 PermissionObserver();
36 virtual ~PermissionObserver();
38 nsTArray<PermissionStatus*> mSinks;
41 } // namespace mozilla::dom
43 #endif