Bug 881667 - Implement nsIAppStartup::startingUp. r=bsmedberg

This commit is contained in:
David Rajchenbach-Teller 2013-10-11 12:00:19 -04:00
parent 14e29c220e
commit 9ddf4f6916
4 changed files with 35 additions and 1 deletions

View File

@ -137,6 +137,7 @@ nsAppStartup::nsAppStartup() :
mConsiderQuitStopper(0),
mRunning(false),
mShuttingDown(false),
mStartingUp(true),
mAttemptingQuit(false),
mRestart(false),
mInterrupted(false),
@ -516,6 +517,23 @@ nsAppStartup::GetShuttingDown(bool *aResult)
return NS_OK;
}
NS_IMETHODIMP
nsAppStartup::GetStartingUp(bool *aResult)
{
*aResult = mStartingUp;
return NS_OK;
}
NS_IMETHODIMP
nsAppStartup::DoneStartingUp()
{
// This must be called once at most
MOZ_ASSERT(mStartingUp);
mStartingUp = false;
return NS_OK;
}
NS_IMETHODIMP
nsAppStartup::GetRestarting(bool *aResult)
{

View File

@ -56,6 +56,7 @@ private:
int32_t mConsiderQuitStopper; // if > 0, Quit(eConsiderQuit) fails
bool mRunning; // Have we started the main event loop?
bool mShuttingDown; // Quit method reentrancy check
bool mStartingUp; // Have we passed final-ui-startup?
bool mAttemptingQuit; // Quit(eAttemptQuit) still trying
bool mRestart; // Quit(eRestart)
bool mInterrupted; // Was startup interrupted by an interactive prompt?

View File

@ -7,7 +7,7 @@
interface nsICmdLineService;
[scriptable, uuid(744d6ec0-115f-11e3-9c94-68fd99890b3c)]
[scriptable, uuid(9edef217-e664-4938-85a7-2fe84baa1755)]
interface nsIAppStartup : nsISupports
{
/**
@ -135,6 +135,20 @@ interface nsIAppStartup : nsISupports
*/
readonly attribute boolean shuttingDown;
/**
* True if the application is in the process of starting up.
*
* Startup is complete once all observers of final-ui-startup have returned.
*/
readonly attribute boolean startingUp;
/**
* Mark the startup as completed.
*
* Called at the end of startup by nsAppRunner.
*/
[noscript] void doneStartingUp();
/**
* True if the application is being restarted
*/

View File

@ -3851,6 +3851,7 @@ XREMain::XRE_mainRun()
if (obsService)
obsService->NotifyObservers(nullptr, "final-ui-startup", nullptr);
(void)appStartup->DoneStartingUp();
appStartup->GetShuttingDown(&mShuttingDown);
}