Bug 1312406 and bug 1255361 - part 2: remove tab groups backup, r?dolske draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 01 Nov 2016 16:12:19 +0000
changeset 432316 fdb866041d749f44053a9ab3f0782a0dc147d882
parent 432307 7cd2a35e7d0fd1726d19b787268541eece471c28
child 432317 384c90a9f87733201a01bd3a3067118b50c46678
push id34253
push userbmo:gijskruitbosch+bugs@gmail.com
push dateTue, 01 Nov 2016 16:14:46 +0000
reviewersdolske
bugs1312406, 1255361
milestone52.0a1
Bug 1312406 and bug 1255361 - part 2: remove tab groups backup, r?dolske MozReview-Commit-ID: 96AFjsXE1w0
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1768,17 +1768,17 @@ BrowserGlue.prototype = {
       if (topic != "alertclickcallback")
         return;
       this._openPreferences("sync");
     }
     AlertsService.showAlertNotification(null, title, body, true, null, clickCallback);
   },
 
   _migrateUI: function BG__migrateUI() {
-    const UI_VERSION = 41;
+    const UI_VERSION = 42;
     const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
 
     let currentUIVersion;
     if (Services.prefs.prefHasUserValue("browser.migration.version")) {
       currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
     } else {
       // This is a new profile, nothing to migrate.
       Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
@@ -2096,16 +2096,22 @@ BrowserGlue.prototype = {
       }
     }
 
     if (currentUIVersion < 41) {
       const Preferences = Cu.import("resource://gre/modules/Preferences.jsm", {}).Preferences;
       Preferences.resetBranch("loop.");
     }
 
+    if (currentUIVersion < 42) {
+      let backupFile = Services.dirsvc.get("ProfD", Ci.nsIFile);
+      backupFile.append("tabgroups-session-backup.json");
+      OS.File.remove(backupFile.path, {ignoreAbsent: true}).catch(ex => Cu.reportError(ex));
+    }
+
     // Update the migration version.
     Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
   },
 
   _hasExistingNotificationPermission: function BG__hasExistingNotificationPermission() {
     let enumerator = Services.perms.enumerator;
     while (enumerator.hasMoreElements()) {
       let permission = enumerator.getNext().QueryInterface(Ci.nsIPermission);