Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / dom / base / WindowDestroyedEvent.h
blobd1c849b7aeca4a9d7a5d04a8c744d403d3d64175
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/. */
7 #ifndef WindowDestroyedEvent_h
8 #define WindowDestroyedEvent_h
10 #include "nsIWeakReferenceUtils.h"
11 #include "nsString.h"
12 #include "nsThreadUtils.h"
14 class nsGlobalWindowInner;
15 class nsGlobalWindowOuter;
17 namespace mozilla {
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);
26 enum class Phase { Destroying, Nuking };
28 NS_IMETHOD Run() override;
30 private:
31 uint64_t mID;
32 Phase mPhase;
33 nsCString mTopic;
34 nsWeakPtr mWindow;
35 bool mIsInnerWindow;
38 } // namespace mozilla
40 #endif // defined(WindowDestroyedEvent_h)