mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
Bug 936630 - Timeline event sessionRestoreInit. r=ttaubert, r=froydnj
This commit is contained in:
parent
88f4fc7a77
commit
8516b9af8c
@ -81,6 +81,8 @@ SessionStartup.prototype = {
|
||||
* Initialize the component
|
||||
*/
|
||||
init: function sss_init() {
|
||||
Services.obs.notifyObservers(null, "sessionstore-init-started", null);
|
||||
|
||||
// do not need to initialize anything in auto-started private browsing sessions
|
||||
if (PrivateBrowsingUtils.permanentPrivateBrowsing) {
|
||||
this._initialized = true;
|
||||
|
@ -242,6 +242,15 @@ add_task(function formdata() {
|
||||
}
|
||||
});
|
||||
|
||||
add_task(function* test_sessionRestoreInit() {
|
||||
let info = Cc["@mozilla.org/toolkit/app-startup;1"].
|
||||
getService(Ci.nsIAppStartup).
|
||||
getStartupInfo();
|
||||
ok(info.sessionRestoreInit > info.process, "sessionRestoreInit is after process creation");
|
||||
ok(info.sessionRestoreInit <
|
||||
Date.now() + 10000 /* Date.now() is non-monotonic, let's play it paranoid*/,
|
||||
"sessionRestoreInit is before now");
|
||||
});
|
||||
|
||||
/**
|
||||
* Get the latest statistics.
|
||||
|
@ -13,6 +13,7 @@ mozilla_StartupTimeline_Event(AFTER_PROFILE_LOCKED, "afterProfileLocked")
|
||||
mozilla_StartupTimeline_Event(STARTUP_CRASH_DETECTION_BEGIN, "startupCrashDetectionBegin")
|
||||
mozilla_StartupTimeline_Event(STARTUP_CRASH_DETECTION_END, "startupCrashDetectionEnd")
|
||||
mozilla_StartupTimeline_Event(FIRST_PAINT, "firstPaint")
|
||||
mozilla_StartupTimeline_Event(SESSION_RESTORE_INIT, "sessionRestoreInit")
|
||||
mozilla_StartupTimeline_Event(SESSION_RESTORED, "sessionRestored")
|
||||
mozilla_StartupTimeline_Event(CREATE_TOP_LEVEL_WINDOW, "createTopLevelWindow")
|
||||
mozilla_StartupTimeline_Event(LINKER_INITIALIZED, "linkerInitialized")
|
||||
|
@ -161,6 +161,7 @@ nsAppStartup::Init()
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
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);
|
||||
@ -705,6 +706,8 @@ nsAppStartup::Observe(nsISupports *aSubject,
|
||||
mPlacesInitCompleteProbe->Trigger();
|
||||
}
|
||||
#endif //defined(XP_WIN)
|
||||
} else if (!strcmp(aTopic, "sessionstore-init-started")) {
|
||||
StartupTimeline::Record(StartupTimeline::SESSION_RESTORE_INIT);
|
||||
} else if (!strcmp(aTopic, "xpcom-shutdown")) {
|
||||
Telemetry::EnteringShutdownStage();
|
||||
#if defined(XP_WIN)
|
||||
|
Loading…
Reference in New Issue
Block a user