Bug 896276 - Use Date.now() rather than nsIAppStartup.getStartupInfo().process to detect profiles that haven't been used for a while. r=mak
authorDão Gottwald <dao@mozilla.com>
Sat, 27 Jul 2013 17:22:56 +0200
changeset 140215 5f7ad1bfd200acd5b26c8c16a635e7645e8c95a9
parent 140214 1e1f3cd07479c0083b09917aa5964e2f2007b983
child 140216 0c80222426fe8757b91f9db09ded8697a1017479
push id1948
push userdgottwald@mozilla.com
push dateSat, 27 Jul 2013 15:23:17 +0000
treeherderfx-team@5f7ad1bfd200 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs896276
milestone25.0a1
Bug 896276 - Use Date.now() rather than nsIAppStartup.getStartupInfo().process to detect profiles that haven't been used for a while. r=mak
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -594,20 +594,19 @@ BrowserGlue.prototype = {
     }
 #endif
 
     SessionStore.init(aWindow);
     this._trackSlowStartup();
 
     // Offer to reset a user's profile if it hasn't been used for 60 days.
     const OFFER_PROFILE_RESET_INTERVAL_MS = 60 * 24 * 60 * 60 * 1000;
-    let processStartupTime = Services.startup.getStartupInfo().process;
     let lastUse = Services.appinfo.replacedLockTime;
-    if (processStartupTime && lastUse &&
-        processStartupTime.getTime() - lastUse >= OFFER_PROFILE_RESET_INTERVAL_MS) {
+    if (lastUse &&
+        Date.now() - lastUse >= OFFER_PROFILE_RESET_INTERVAL_MS) {
       this._resetUnusedProfileNotification();
     }
   },
 
   /**
    * Profile shutdown handler (contains profile cleanup routines).
    * All components depending on Places should be shut down in
    * _onPlacesShutdown() and not here.