WindowDestroyedEvent.h (1088B)
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 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef WindowDestroyedEvent_h 8 #define WindowDestroyedEvent_h 9 10 #include "nsIWeakReferenceUtils.h" 11 #include "nsString.h" 12 #include "nsThreadUtils.h" 13 14 class nsGlobalWindowInner; 15 class nsGlobalWindowOuter; 16 17 namespace mozilla { 18 19 class WindowDestroyedEvent final : public Runnable { 20 public: 21 WindowDestroyedEvent(nsGlobalWindowInner* aWindow, uint64_t aID, 22 const char* aTopic); 23 WindowDestroyedEvent(nsGlobalWindowOuter* aWindow, uint64_t aID, 24 const char* aTopic); 25 26 enum class Phase { Destroying, Nuking }; 27 28 NS_IMETHOD Run() override; 29 30 private: 31 uint64_t mID; 32 Phase mPhase; 33 nsCString mTopic; 34 nsWeakPtr mWindow; 35 bool mIsInnerWindow; 36 }; 37 38 } // namespace mozilla 39 40 #endif // defined(WindowDestroyedEvent_h)