1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/components/startup/nsAppStartup.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,78 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#ifndef nsAppStartup_h__ 1.10 +#define nsAppStartup_h__ 1.11 + 1.12 +#include "nsIAppStartup.h" 1.13 +#include "nsIWindowCreator2.h" 1.14 +#include "nsIObserver.h" 1.15 +#include "nsWeakReference.h" 1.16 + 1.17 +#include "nsINativeAppSupport.h" 1.18 +#include "nsIAppShell.h" 1.19 +#include "mozilla/Attributes.h" 1.20 + 1.21 +#if defined(XP_WIN) 1.22 +//XPerf-backed probes 1.23 +#include "mozilla/perfprobe.h" 1.24 +#include "nsAutoPtr.h" 1.25 +#endif //defined(XP_WIN) 1.26 + 1.27 + 1.28 +struct PLEvent; 1.29 + 1.30 +// {7DD4D320-C84B-4624-8D45-7BB9B2356977} 1.31 +#define NS_TOOLKIT_APPSTARTUP_CID \ 1.32 +{ 0x7dd4d320, 0xc84b, 0x4624, { 0x8d, 0x45, 0x7b, 0xb9, 0xb2, 0x35, 0x69, 0x77 } } 1.33 + 1.34 + 1.35 +class nsAppStartup MOZ_FINAL : public nsIAppStartup, 1.36 + public nsIWindowCreator2, 1.37 + public nsIObserver, 1.38 + public nsSupportsWeakReference 1.39 +{ 1.40 +public: 1.41 + NS_DECL_THREADSAFE_ISUPPORTS 1.42 + NS_DECL_NSIAPPSTARTUP 1.43 + NS_DECL_NSIWINDOWCREATOR 1.44 + NS_DECL_NSIWINDOWCREATOR2 1.45 + NS_DECL_NSIOBSERVER 1.46 + 1.47 + nsAppStartup(); 1.48 + nsresult Init(); 1.49 + 1.50 +private: 1.51 + ~nsAppStartup() { } 1.52 + 1.53 + void CloseAllWindows(); 1.54 + 1.55 + friend class nsAppExitEvent; 1.56 + 1.57 + nsCOMPtr<nsIAppShell> mAppShell; 1.58 + 1.59 + int32_t mConsiderQuitStopper; // if > 0, Quit(eConsiderQuit) fails 1.60 + bool mRunning; // Have we started the main event loop? 1.61 + bool mShuttingDown; // Quit method reentrancy check 1.62 + bool mStartingUp; // Have we passed final-ui-startup? 1.63 + bool mAttemptingQuit; // Quit(eAttemptQuit) still trying 1.64 + bool mRestart; // Quit(eRestart) 1.65 + bool mInterrupted; // Was startup interrupted by an interactive prompt? 1.66 + bool mIsSafeModeNecessary; // Whether safe mode is necessary 1.67 + bool mStartupCrashTrackingEnded; // Whether startup crash tracking has already ended 1.68 + bool mRestartTouchEnvironment; // Quit (eRestartTouchEnvironment) 1.69 + 1.70 +#if defined(XP_WIN) 1.71 + //Interaction with OS-provided profiling probes 1.72 + typedef mozilla::probes::ProbeManager ProbeManager; 1.73 + typedef mozilla::probes::Probe Probe; 1.74 + nsRefPtr<ProbeManager> mProbesManager; 1.75 + nsRefPtr<Probe> mPlacesInitCompleteProbe; 1.76 + nsRefPtr<Probe> mSessionWindowRestoredProbe; 1.77 + nsRefPtr<Probe> mXPCOMShutdownProbe; 1.78 +#endif 1.79 +}; 1.80 + 1.81 +#endif // nsAppStartup_h__