Bug 1451719 - Add the failing type to a bookmarks error, and replace some xpcom interface usages with pure javascript ones. r=mak
authorMark Banner <standard8@mozilla.com>
Thu, 05 Apr 2018 13:36:08 +0100
changeset 411958 ef01b00805770490df8289e29c65b156923d1a12
parent 411957 d78f51ac7d96cd71d3d8579bb4bf33c6e09482eb
child 411959 7988c47de43d7e66bfb9afc260e10d77d53094c9
push id62229
push usermbanner@mozilla.com
push dateThu, 05 Apr 2018 17:59:38 +0000
treeherderautoland@ef01b0080577 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1451719
milestone61.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 1451719 - Add the failing type to a bookmarks error, and replace some xpcom interface usages with pure javascript ones. r=mak MozReview-Commit-ID: 1MSbFOsraLV
toolkit/components/places/PlacesUtils.jsm
--- a/toolkit/components/places/PlacesUtils.jsm
+++ b/toolkit/components/places/PlacesUtils.jsm
@@ -1751,46 +1751,46 @@ var PlacesUtils = {
         try {
           item.annos = await PlacesUtils.promiseAnnotationsForItem(itemId);
         } catch (ex) {
           Cu.reportError("Unexpected error while reading annotations " + ex);
         }
       }
 
       switch (type) {
-        case Ci.nsINavBookmarksService.TYPE_BOOKMARK:
+        case PlacesUtils.bookmarks.TYPE_BOOKMARK:
           item.type = PlacesUtils.TYPE_X_MOZ_PLACE;
           // If this throws due to an invalid url, the item will be skipped.
           item.uri = NetUtil.newURI(aRow.getResultByName("url")).spec;
           // Keywords are cached, so this should be decently fast.
           let entry = await PlacesUtils.keywords.fetch({ url: item.uri });
           if (entry) {
             item.keyword = entry.keyword;
             item.postData = entry.postData;
           }
           break;
-        case Ci.nsINavBookmarksService.TYPE_FOLDER:
+        case PlacesUtils.bookmarks.TYPE_FOLDER:
           item.type = PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER;
           // Mark root folders.
           if (itemId == PlacesUtils.placesRootId)
             item.root = "placesRoot";
           else if (itemId == PlacesUtils.bookmarksMenuFolderId)
             item.root = "bookmarksMenuFolder";
           else if (itemId == PlacesUtils.unfiledBookmarksFolderId)
             item.root = "unfiledBookmarksFolder";
           else if (itemId == PlacesUtils.toolbarFolderId)
             item.root = "toolbarFolder";
           else if (itemId == PlacesUtils.mobileFolderId)
             item.root = "mobileFolder";
           break;
-        case Ci.nsINavBookmarksService.TYPE_SEPARATOR:
+        case PlacesUtils.bookmarks.TYPE_SEPARATOR:
           item.type = PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR;
           break;
         default:
-          Cu.reportError("Unexpected bookmark type");
+          Cu.reportError(`Unexpected bookmark type ${type}`);
           break;
       }
       return item;
     };
 
     const QUERY_STR =
       `/* do not warn (bug no): cannot use an index */
        WITH RECURSIVE