Bug 1302960 - Remove dead code from `PlacesSyncUtils.bookmarks.order`. r=markh
authorKit Cambridge <kcambridge@mozilla.com>
Thu, 15 Sep 2016 01:14:30 -0700
changeset 355292 88610e4afc3166aee5a3807add1451429ebde36f
parent 355291 8be679eee5cf6785b027a4b8199bcc0f6b5a3305
child 355293 6e699b5ad3212f2016f274a7ead34201f5c989d1
push id6570
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:26:13 +0000
treeherdermozilla-beta@f455459b2ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs1302960
milestone51.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1302960 - Remove dead code from `PlacesSyncUtils.bookmarks.order`. r=markh MozReview-Commit-ID: GfvjfCYI6fw
toolkit/components/places/PlacesSyncUtils.jsm
--- a/toolkit/components/places/PlacesSyncUtils.jsm
+++ b/toolkit/components/places/PlacesSyncUtils.jsm
@@ -81,21 +81,16 @@ const BookmarkSyncUtils = PlacesSyncUtil
       return Promise.resolve();
     }
     return PlacesUtils.withConnectionWrapper("BookmarkSyncUtils: order",
       Task.async(function* (db) {
         let children = yield fetchAllChildren(db, parentGuid);
         if (!children.length) {
           return;
         }
-        for (let child of children) {
-          // Note the current index for notifying observers. This can
-          // be removed once we switch to `reorder`.
-          child.oldIndex = child.index;
-        }
 
         // Reorder the list, ignoring missing children.
         let delta = 0;
         for (let i = 0; i < childGuids.length; ++i) {
           let guid = childGuids[i];
           let child = findChildByGuid(children, guid);
           if (!child) {
             delta++;
@@ -276,34 +271,16 @@ function updateChildIndex(children, chil
 
   let sign = newIndex < child.index ? +1 : -1;
   for (let sibling of siblings) {
     sibling.index += sign;
   }
   child.index = newIndex;
 }
 
-/**
- * Sends a bookmarks notification through the given observers.
- *
- * @param observers
- *        array of nsINavBookmarkObserver objects.
- * @param notification
- *        the notification name.
- * @param args
- *        array of arguments to pass to the notification.
- */
-function notify(observers, notification, args) {
-  for (let observer of observers) {
-    try {
-      observer[notification](...args);
-    } catch (ex) {}
-  }
-}
-
 // A helper for whenever we want to know if a GUID doesn't exist in the places
 // database. Primarily used to detect orphans on incoming records.
 var GUIDMissing = Task.async(function* (guid) {
   try {
     yield PlacesUtils.promiseItemId(guid);
     return false;
   } catch (ex) {
     if (ex.message == "no item found for the given GUID") {