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 140259 5f7ad1bfd200acd5b26c8c16a635e7645e8c95a9
parent 140258 1e1f3cd07479c0083b09917aa5964e2f2007b983
child 140260 0c80222426fe8757b91f9db09ded8697a1017479
push id25021
push userryanvm@gmail.com
push dateSun, 28 Jul 2013 01:51:56 +0000
treeherdermozilla-central@015135250e06 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs896276
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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.