Bug 1344644 - stop supporting outdated Edge bookmarks format to avoid hangs trying to open bookmarks database when Edge is open, r?dao draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 07 Mar 2017 14:09:34 +0000
changeset 495390 6833df97135751bb2830b9cf3bd8ab88382f20ce
parent 490433 1bc2ad020aee2830e0a7941f10958dbec108c254
child 548358 5dc12b3394431fc3363836d8f8265fc3c982fefd
push id48312
push userbmo:gijskruitbosch+bugs@gmail.com
push dateWed, 08 Mar 2017 18:04:31 +0000
reviewersdao
bugs1344644
milestone54.0a1
Bug 1344644 - stop supporting outdated Edge bookmarks format to avoid hangs trying to open bookmarks database when Edge is open, r?dao MozReview-Commit-ID: 2KihobvE8nV
browser/components/migration/EdgeProfileMigrator.js
--- a/browser/components/migration/EdgeProfileMigrator.js
+++ b/browser/components/migration/EdgeProfileMigrator.js
@@ -229,42 +229,21 @@ EdgeBookmarksMigrator.prototype = {
   type: MigrationUtils.resourceTypes.BOOKMARKS,
 
   get db() { return this.dbOverride || gEdgeDatabase },
 
   get TABLE_NAME() { return "Favorites" },
 
   get exists() {
     if (!("_exists" in this)) {
-      this._exists = !!this.db && this._checkTableExists();
+      this._exists = !!this.db;
     }
     return this._exists;
   },
 
-  _checkTableExists() {
-    let database;
-    let rv;
-    try {
-      let logFile = this.db.parent;
-      logFile.append("LogFiles");
-      database = ESEDBReader.openDB(this.db.parent, this.db, logFile);
-
-      rv = database.tableExists(this.TABLE_NAME);
-    } catch (ex) {
-      Cu.reportError("Failed to check for table " + this.TABLE_NAME + " in Edge database at " +
-                     this.db.path + " due to the following error: " + ex);
-      return false;
-    } finally {
-      if (database) {
-        ESEDBReader.closeDB(database);
-      }
-    }
-    return rv;
-  },
-
   migrate(callback) {
     this._migrateBookmarks(PlacesUtils.bookmarks.menuGuid).then(
       () => callback(true),
       ex => {
         Cu.reportError(ex);
         callback(false);
       }
     );
@@ -398,22 +377,18 @@ function EdgeProfileMigrator() {
 
 EdgeProfileMigrator.prototype = Object.create(MigratorPrototype);
 
 EdgeProfileMigrator.prototype.getESEMigratorForTesting = function(dbOverride) {
   return new EdgeBookmarksMigrator(dbOverride);
 };
 
 EdgeProfileMigrator.prototype.getResources = function() {
-  let bookmarksMigrator = new EdgeBookmarksMigrator();
-  if (!bookmarksMigrator.exists) {
-    bookmarksMigrator = MSMigrationUtils.getBookmarksMigrator(MSMigrationUtils.MIGRATION_TYPE_EDGE);
-  }
   let resources = [
-    bookmarksMigrator,
+    new EdgeBookmarksMigrator(),
     MSMigrationUtils.getCookiesMigrator(MSMigrationUtils.MIGRATION_TYPE_EDGE),
     new EdgeTypedURLMigrator(),
     new EdgeReadingListMigrator(),
   ];
   let windowsVaultFormPasswordsMigrator =
     MSMigrationUtils.getWindowsVaultFormPasswordsMigrator();
   windowsVaultFormPasswordsMigrator.name = "EdgeVaultFormPasswords";
   resources.push(windowsVaultFormPasswordsMigrator);