From cebc9c00e5a47a77bdd7334401135a7669008682 Mon Sep 17 00:00:00 2001 From: Matthew Noorenberghe Date: Wed, 14 Mar 2012 17:08:59 -0700 Subject: [PATCH] Bug 731613 - Don't track startup crashes when XRE_PROFILE_PATH is set (from restart or profile manager). r=Mossop --HG-- extra : rebase_source : c16c158eeec49521f60b1afdfa32a64e9dbda2c7 --- toolkit/components/startup/nsAppStartup.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/toolkit/components/startup/nsAppStartup.cpp b/toolkit/components/startup/nsAppStartup.cpp index 7b22c9a7fd84..b3cf8f604ca4 100644 --- a/toolkit/components/startup/nsAppStartup.cpp +++ b/toolkit/components/startup/nsAppStartup.cpp @@ -872,6 +872,15 @@ nsAppStartup::TrackStartupCrashBegin(bool *aIsSafeModeNecessary) Preferences::GetInt(kPrefRecentCrashes, &recentCrashes); mIsSafeModeNecessary = (recentCrashes > maxResumedCrashes && maxResumedCrashes != -1); + // Bug 731613 - Don't check if the last startup was a crash if XRE_PROFILE_PATH is set. After + // profile manager, the profile lock's mod. time has been changed so can't be used on this startup. + // After a restart, it's safe to assume the last startup was successful. + char *xreProfilePath = PR_GetEnv("XRE_PROFILE_PATH"); + if (xreProfilePath) { + GetAutomaticSafeModeNecessary(aIsSafeModeNecessary); + return NS_ERROR_NOT_AVAILABLE; + } + // time of last successful startup PRInt32 lastSuccessfulStartup; rv = Preferences::GetInt(kPrefLastSuccess, &lastSuccessfulStartup);