Bug 1344644 - Stop supporting outdated Edge bookmarks format to avoid hangs trying to open bookmarks database when Edge is open. r=dao, a=jcristau
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 07 Mar 2017 14:09:34 +0000
changeset 395153 ae18402a0a32402f34cb0455e9b56af2039f756d
parent 395152 1e9578bf86198083ff237d090ca264356bc6d4bb
child 395154 934d877fa6cd083a32b3d068c272eaed67ef4903
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, jcristau
bugs1344644
milestone54.0a2
Bug 1344644 - Stop supporting outdated Edge bookmarks format to avoid hangs trying to open bookmarks database when Edge is open. r=dao, a=jcristau 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);