Bug 731613 - Don't track startup crashes when XRE_PROFILE_PATH is set (from restart or profile manager). r=Mossop, a=akeybl
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Wed, 14 Mar 2012 17:08:59 -0700
changeset 90609 787aedcb98ebac868c462520d71916112419f6d4
parent 90608 99df4b894a0981d1c19acd66ebd3cdfaa501d3c9
child 90610 c6f1210231c1ffbde39bd822156ea6183edb4c16
push id1031
push usermozilla@noorenberghe.ca
push dateWed, 28 Mar 2012 22:18:21 +0000
treeherdermozilla-aurora@787aedcb98eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMossop, akeybl
bugs731613
milestone13.0a2
Bug 731613 - Don't track startup crashes when XRE_PROFILE_PATH is set (from restart or profile manager). r=Mossop, a=akeybl
toolkit/components/startup/nsAppStartup.cpp
--- a/toolkit/components/startup/nsAppStartup.cpp
+++ b/toolkit/components/startup/nsAppStartup.cpp
@@ -867,16 +867,25 @@ nsAppStartup::TrackStartupCrashBegin(boo
   PRInt32 maxResumedCrashes = -1;
   rv = Preferences::GetInt(kPrefMaxResumedCrashes, &maxResumedCrashes);
   NS_ENSURE_SUCCESS(rv, NS_OK);
 
   PRInt32 recentCrashes = 0;
   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);
   NS_ENSURE_SUCCESS(rv, rv);
 
   PRInt32 lockSeconds = (PRInt32)(replacedLockTime / PR_MSEC_PER_SEC);
 
   // started close enough to good startup so call it good