Bug 1034514 - Record quit-application and profile-before-change in the timeline. r=froydnj

This commit is contained in:
David Rajchenbach-Teller 2014-08-22 07:27:00 +02:00
parent 152c74b8e9
commit 94631455e0
2 changed files with 10 additions and 0 deletions

View File

@ -19,6 +19,10 @@ mozilla_StartupTimeline_Event(CREATE_TOP_LEVEL_WINDOW, "createTopLevelWindow")
mozilla_StartupTimeline_Event(LINKER_INITIALIZED, "linkerInitialized")
mozilla_StartupTimeline_Event(LIBRARIES_LOADED, "librariesLoaded")
mozilla_StartupTimeline_Event(FIRST_LOAD_URI, "firstLoadURI")
// The following are actually shutdown events, used to monitor the duration of shutdown
mozilla_StartupTimeline_Event(QUIT_APPLICATION, "quitApplication")
mozilla_StartupTimeline_Event(PROFILE_BEFORE_CHANGE, "profileBeforeChange")
#else
#ifndef mozilla_StartupTimeline

View File

@ -161,12 +161,14 @@ nsAppStartup::Init()
if (!os)
return NS_ERROR_FAILURE;
os->AddObserver(this, "quit-application", true);
os->AddObserver(this, "quit-application-forced", true);
os->AddObserver(this, "sessionstore-init-started", true);
os->AddObserver(this, "sessionstore-windows-restored", true);
os->AddObserver(this, "profile-change-teardown", true);
os->AddObserver(this, "xul-window-registered", true);
os->AddObserver(this, "xul-window-destroyed", true);
os->AddObserver(this, "profile-before-change", true);
os->AddObserver(this, "xpcom-shutdown", true);
#if defined(XP_WIN)
@ -721,6 +723,10 @@ nsAppStartup::Observe(nsISupports *aSubject,
mXPCOMShutdownProbe->Trigger();
}
#endif // defined(XP_WIN)
} else if (!strcmp(aTopic, "quit-application")) {
StartupTimeline::Record(StartupTimeline::QUIT_APPLICATION);
} else if (!strcmp(aTopic, "profile-before-change")) {
StartupTimeline::Record(StartupTimeline::PROFILE_BEFORE_CHANGE);
} else {
NS_ERROR("Unexpected observer topic.");
}