Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsAppStartup_h__ |
michael@0 | 7 | #define nsAppStartup_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsIAppStartup.h" |
michael@0 | 10 | #include "nsIWindowCreator2.h" |
michael@0 | 11 | #include "nsIObserver.h" |
michael@0 | 12 | #include "nsWeakReference.h" |
michael@0 | 13 | |
michael@0 | 14 | #include "nsINativeAppSupport.h" |
michael@0 | 15 | #include "nsIAppShell.h" |
michael@0 | 16 | #include "mozilla/Attributes.h" |
michael@0 | 17 | |
michael@0 | 18 | #if defined(XP_WIN) |
michael@0 | 19 | //XPerf-backed probes |
michael@0 | 20 | #include "mozilla/perfprobe.h" |
michael@0 | 21 | #include "nsAutoPtr.h" |
michael@0 | 22 | #endif //defined(XP_WIN) |
michael@0 | 23 | |
michael@0 | 24 | |
michael@0 | 25 | struct PLEvent; |
michael@0 | 26 | |
michael@0 | 27 | // {7DD4D320-C84B-4624-8D45-7BB9B2356977} |
michael@0 | 28 | #define NS_TOOLKIT_APPSTARTUP_CID \ |
michael@0 | 29 | { 0x7dd4d320, 0xc84b, 0x4624, { 0x8d, 0x45, 0x7b, 0xb9, 0xb2, 0x35, 0x69, 0x77 } } |
michael@0 | 30 | |
michael@0 | 31 | |
michael@0 | 32 | class nsAppStartup MOZ_FINAL : public nsIAppStartup, |
michael@0 | 33 | public nsIWindowCreator2, |
michael@0 | 34 | public nsIObserver, |
michael@0 | 35 | public nsSupportsWeakReference |
michael@0 | 36 | { |
michael@0 | 37 | public: |
michael@0 | 38 | NS_DECL_THREADSAFE_ISUPPORTS |
michael@0 | 39 | NS_DECL_NSIAPPSTARTUP |
michael@0 | 40 | NS_DECL_NSIWINDOWCREATOR |
michael@0 | 41 | NS_DECL_NSIWINDOWCREATOR2 |
michael@0 | 42 | NS_DECL_NSIOBSERVER |
michael@0 | 43 | |
michael@0 | 44 | nsAppStartup(); |
michael@0 | 45 | nsresult Init(); |
michael@0 | 46 | |
michael@0 | 47 | private: |
michael@0 | 48 | ~nsAppStartup() { } |
michael@0 | 49 | |
michael@0 | 50 | void CloseAllWindows(); |
michael@0 | 51 | |
michael@0 | 52 | friend class nsAppExitEvent; |
michael@0 | 53 | |
michael@0 | 54 | nsCOMPtr<nsIAppShell> mAppShell; |
michael@0 | 55 | |
michael@0 | 56 | int32_t mConsiderQuitStopper; // if > 0, Quit(eConsiderQuit) fails |
michael@0 | 57 | bool mRunning; // Have we started the main event loop? |
michael@0 | 58 | bool mShuttingDown; // Quit method reentrancy check |
michael@0 | 59 | bool mStartingUp; // Have we passed final-ui-startup? |
michael@0 | 60 | bool mAttemptingQuit; // Quit(eAttemptQuit) still trying |
michael@0 | 61 | bool mRestart; // Quit(eRestart) |
michael@0 | 62 | bool mInterrupted; // Was startup interrupted by an interactive prompt? |
michael@0 | 63 | bool mIsSafeModeNecessary; // Whether safe mode is necessary |
michael@0 | 64 | bool mStartupCrashTrackingEnded; // Whether startup crash tracking has already ended |
michael@0 | 65 | bool mRestartTouchEnvironment; // Quit (eRestartTouchEnvironment) |
michael@0 | 66 | |
michael@0 | 67 | #if defined(XP_WIN) |
michael@0 | 68 | //Interaction with OS-provided profiling probes |
michael@0 | 69 | typedef mozilla::probes::ProbeManager ProbeManager; |
michael@0 | 70 | typedef mozilla::probes::Probe Probe; |
michael@0 | 71 | nsRefPtr<ProbeManager> mProbesManager; |
michael@0 | 72 | nsRefPtr<Probe> mPlacesInitCompleteProbe; |
michael@0 | 73 | nsRefPtr<Probe> mSessionWindowRestoredProbe; |
michael@0 | 74 | nsRefPtr<Probe> mXPCOMShutdownProbe; |
michael@0 | 75 | #endif |
michael@0 | 76 | }; |
michael@0 | 77 | |
michael@0 | 78 | #endif // nsAppStartup_h__ |