|
1 /* -*- Mode: C++; tab-width: 2; 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/. */ |
|
5 |
|
6 #ifndef nsAppStartup_h__ |
|
7 #define nsAppStartup_h__ |
|
8 |
|
9 #include "nsIAppStartup.h" |
|
10 #include "nsIWindowCreator2.h" |
|
11 #include "nsIObserver.h" |
|
12 #include "nsWeakReference.h" |
|
13 |
|
14 #include "nsINativeAppSupport.h" |
|
15 #include "nsIAppShell.h" |
|
16 #include "mozilla/Attributes.h" |
|
17 |
|
18 #if defined(XP_WIN) |
|
19 //XPerf-backed probes |
|
20 #include "mozilla/perfprobe.h" |
|
21 #include "nsAutoPtr.h" |
|
22 #endif //defined(XP_WIN) |
|
23 |
|
24 |
|
25 struct PLEvent; |
|
26 |
|
27 // {7DD4D320-C84B-4624-8D45-7BB9B2356977} |
|
28 #define NS_TOOLKIT_APPSTARTUP_CID \ |
|
29 { 0x7dd4d320, 0xc84b, 0x4624, { 0x8d, 0x45, 0x7b, 0xb9, 0xb2, 0x35, 0x69, 0x77 } } |
|
30 |
|
31 |
|
32 class nsAppStartup MOZ_FINAL : public nsIAppStartup, |
|
33 public nsIWindowCreator2, |
|
34 public nsIObserver, |
|
35 public nsSupportsWeakReference |
|
36 { |
|
37 public: |
|
38 NS_DECL_THREADSAFE_ISUPPORTS |
|
39 NS_DECL_NSIAPPSTARTUP |
|
40 NS_DECL_NSIWINDOWCREATOR |
|
41 NS_DECL_NSIWINDOWCREATOR2 |
|
42 NS_DECL_NSIOBSERVER |
|
43 |
|
44 nsAppStartup(); |
|
45 nsresult Init(); |
|
46 |
|
47 private: |
|
48 ~nsAppStartup() { } |
|
49 |
|
50 void CloseAllWindows(); |
|
51 |
|
52 friend class nsAppExitEvent; |
|
53 |
|
54 nsCOMPtr<nsIAppShell> mAppShell; |
|
55 |
|
56 int32_t mConsiderQuitStopper; // if > 0, Quit(eConsiderQuit) fails |
|
57 bool mRunning; // Have we started the main event loop? |
|
58 bool mShuttingDown; // Quit method reentrancy check |
|
59 bool mStartingUp; // Have we passed final-ui-startup? |
|
60 bool mAttemptingQuit; // Quit(eAttemptQuit) still trying |
|
61 bool mRestart; // Quit(eRestart) |
|
62 bool mInterrupted; // Was startup interrupted by an interactive prompt? |
|
63 bool mIsSafeModeNecessary; // Whether safe mode is necessary |
|
64 bool mStartupCrashTrackingEnded; // Whether startup crash tracking has already ended |
|
65 bool mRestartTouchEnvironment; // Quit (eRestartTouchEnvironment) |
|
66 |
|
67 #if defined(XP_WIN) |
|
68 //Interaction with OS-provided profiling probes |
|
69 typedef mozilla::probes::ProbeManager ProbeManager; |
|
70 typedef mozilla::probes::Probe Probe; |
|
71 nsRefPtr<ProbeManager> mProbesManager; |
|
72 nsRefPtr<Probe> mPlacesInitCompleteProbe; |
|
73 nsRefPtr<Probe> mSessionWindowRestoredProbe; |
|
74 nsRefPtr<Probe> mXPCOMShutdownProbe; |
|
75 #endif |
|
76 }; |
|
77 |
|
78 #endif // nsAppStartup_h__ |