NotificationChild.h (1478B)
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/. */ 6 7 #ifndef DOM_NOTIFICATION_NOTIFICATIONCHILD_H_ 8 #define DOM_NOTIFICATION_NOTIFICATIONCHILD_H_ 9 10 #include "mozilla/GlobalFreezeObserver.h" 11 #include "mozilla/WeakPtr.h" 12 #include "mozilla/dom/notification/PNotificationChild.h" 13 #include "nsISupportsImpl.h" 14 15 namespace mozilla::dom { 16 class Notification; 17 class WindowGlobalChild; 18 } // namespace mozilla::dom 19 20 namespace mozilla::dom::notification { 21 22 class NotificationChild final : public PNotificationChild, 23 public GlobalFreezeObserver, 24 public SupportsWeakPtr { 25 using IPCResult = mozilla::ipc::IPCResult; 26 27 NS_DECL_ISUPPORTS 28 29 public: 30 explicit NotificationChild(Notification* aNonPersistentNotification, 31 WindowGlobalChild* aWindow); 32 33 IPCResult RecvNotifyClick(); 34 35 void ActorDestroy(ActorDestroyReason aWhy) override; 36 void FrozenCallback(nsIGlobalObject* aOwner) override; 37 38 private: 39 ~NotificationChild() = default; 40 41 WeakPtr<Notification> mNonPersistentNotification; 42 WeakPtr<WindowGlobalChild> mWindow; 43 }; 44 45 } // namespace mozilla::dom::notification 46 47 #endif // DOM_NOTIFICATION_NOTIFICATIONCHILD_H_