Bug 1440804 - Fix unused variables in `PlacesSyncUtils`. r?standard8 draft
authorKit Cambridge <kit@yakshaving.ninja>
Fri, 23 Feb 2018 14:22:38 -0800
changeset 759246 1fab96d66c2a686c4e3194a5340569eb162b366b
parent 758142 994a684a7564c2735d98d6910a78d079a68f0b25
push id100316
push userbmo:kit@mozilla.com
push dateFri, 23 Feb 2018 22:25:23 +0000
reviewersstandard8
bugs1440804
milestone60.0a1
Bug 1440804 - Fix unused variables in `PlacesSyncUtils`. r?standard8 MozReview-Commit-ID: 2h1R48JUsyN
toolkit/components/places/PlacesSyncUtils.jsm
--- a/toolkit/components/places/PlacesSyncUtils.jsm
+++ b/toolkit/components/places/PlacesSyncUtils.jsm
@@ -70,17 +70,17 @@ XPCOMUtils.defineLazyGetter(this, "ROOT_
   [PlacesUtils.bookmarks.unfiledGuid]: "unfiled",
   [PlacesUtils.bookmarks.mobileGuid]: "mobile",
 }));
 
 XPCOMUtils.defineLazyGetter(this, "ROOTS", () =>
   Object.keys(ROOT_RECORD_ID_TO_GUID)
 );
 
-const HistorySyncUtils = PlacesSyncUtils.history = Object.freeze({
+PlacesSyncUtils.history = Object.freeze({
   /**
    * Clamps a history visit date between the current date and the earliest
    * sensible date.
    *
    * @param {Date} visitDate
    *        The visit date.
    * @return {Date} The clamped visit date.
    */
@@ -605,21 +605,18 @@ const BookmarkSyncUtils = PlacesSyncUtil
               UPDATE moz_bookmarks
               SET syncChangeCounter = MAX(syncChangeCounter - :syncChangeDelta, 0),
                   syncStatus = :syncStatus
               WHERE guid = :guid`,
               updateParams);
 
             // Unconditionally delete tombstones, in case the GUID exists in
             // `moz_bookmarks` and `moz_bookmarks_deleted` (bug 1405563).
-            let deleteParams = updateParams.map(({ guid }) => ({ guid }));
-            await db.executeCached(`
-              DELETE FROM moz_bookmarks_deleted
-              WHERE guid = :guid`,
-              deleteParams);
+            let tombstoneGuidsToRemove = updateParams.map(({ guid }) => guid);
+            await removeTombstones(db, tombstoneGuidsToRemove);
           });
         }
 
         BookmarkSyncLog.debug(`pushChanges: Processed change records`,
                               { weak: weakCount,
                                 skipped: skippedCount,
                                 updated: updateParams.length });
       }