Bug 1221050 - part 4: write a backup to desktop, r=ttaubert

--HG--
extra : commitid : F8n6To0pgLb
extra : rebase_source : bf747527cbff79efc53d758ed453a122f5005aaf
This commit is contained in:
Gijs Kruitbosch 2015-12-01 10:48:09 +00:00
parent 32e0a1a6b1
commit c3904f5023

View File

@ -13,6 +13,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown", "resource://gre/modules/AsyncShutdown.jsm");
XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() {
@ -128,7 +129,11 @@ this.TabGroupsMigrator = {
},
_createBackup(stateStr) {
// TODO
let dest = Services.dirsvc.get("Desk", Ci.nsIFile);
dest.append("Firefox-tabgroups-backup.json");
let promise = OS.File.writeAtomic(dest.path, stateStr, {encoding: "utf-8"});
AsyncShutdown.webWorkersShutdown.addBlocker("TabGroupsMigrator", promise);
return promise;
},
_bookmarkAllGroupsFromState: Task.async(function*(groupData) {