Bug 372508 part 2 - remove folderId getter. r=sspitzer.
authormozilla.mano@sent.com
Mon, 14 May 2007 14:56:38 -0700
changeset 1431 9713b3466c190d2c7587b23b47d3f8b6e0bc00f2
parent 1430 736a4fe7b3232657c35c2ac6507e1063cdf0ae97
child 1432 0c5b09051910dae8617c822daafd637f748acf42
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
reviewerssspitzer
bugs372508
milestone1.9a5pre
Bug 372508 part 2 - remove folderId getter. r=sspitzer.
browser/components/places/content/bookmarkProperties.js
browser/components/places/content/controller.js
browser/components/places/content/menu.xml
browser/components/places/content/moveBookmarks.js
browser/components/places/content/places.js
browser/components/places/content/toolbar.xml
browser/components/places/content/tree.xml
browser/components/places/content/utils.js
browser/components/places/src/nsPlacesImportExportService.cpp
toolkit/components/places/public/nsINavHistoryService.idl
toolkit/components/places/src/nsNavHistoryResult.cpp
toolkit/components/places/src/nsNavHistoryResult.h
--- a/browser/components/places/content/bookmarkProperties.js
+++ b/browser/components/places/content/bookmarkProperties.js
@@ -1069,17 +1069,17 @@ var BookmarkPropertiesPanel = {
     this._folderTree.selectFolders([this._getFolderIdFromMenuList()]);
   },
 
   onFolderTreeSelect: function BPP_onFolderTreeSelect() {
     var selectedNode = this._folderTree.selectedNode;
     if (!selectedNode)
       return;
 
-    var folderId = asFolder(selectedNode).folderId;
+    var folderId = selectedNode.itemId;
     // Don't set the selected item if the static item for the folder is
     // already selected
     var oldSelectedItem = this._folderMenuList.selectedItem;
     if ((oldSelectedItem.id == "toolbarFolderItem" &&
          folderId == PlacesUtils.bookmarks.toolbarFolder) ||
         (oldSelectedItem.id == "bookmarksRootItem" &&
          folderId == PlacesUtils.bookmarks.bookmarksRoot))
       return;
--- a/browser/components/places/content/controller.js
+++ b/browser/components/places/content/controller.js
@@ -65,34 +65,34 @@ const NEWLINE= "\n";
 #else
 // On other platforms, the transferable system converts "\r\n" to "\n".
 const NEWLINE = "\r\n";
 #endif
 
 /**
  * Represents an insertion point within a container where we can insert
  * items. 
- * @param   aFolderId
- *          The folderId of the parent container
+ * @param   aItemId
+ *          The identifier of the parent container
  * @param   aIndex
  *          The index within the container where we should insert
  * @param   aOrientation
  *          The orientation of the insertion. NOTE: the adjustments to the
  *          insertion point to accommodate the orientation should be done by
  *          the person who constructs the IP, not the user. The orientation
  *          is provided for informational purposes only!
  * @constructor
  */
-function InsertionPoint(aFolderId, aIndex, aOrientation) {
-  this.folderId = aFolderId;
+function InsertionPoint(aItemId, aIndex, aOrientation) {
+  this.itemId = aItemId;
   this.index = aIndex;
   this.orientation = aOrientation;
 }
 InsertionPoint.prototype.toString = function IP_toString() {
-  return "[object InsertionPoint(folder:" + this.folderId + ",index:" + this.index + ",orientation:" + this.orientation + ")]";
+  return "[object InsertionPoint(folder:" + this.itemId + ",index:" + this.index + ",orientation:" + this.orientation + ")]";
 };
 
 /**
  * Places Controller
  */
 
 function PlacesController(aView) {
   this._view = aView;
@@ -137,18 +137,17 @@ PlacesController.prototype = {
       // We can open multiple links if the current selection is either:
       //  a) a single folder which contains at least one link
       //  b) multiple links
       var node = this._view.selectedNode;
       if (!node)
         return false;
 
       if (this._view.hasSingleSelection && PlacesUtils.nodeIsFolder(node)) {
-        var contents = PlacesUtils.getFolderContents(asFolder(node).folderId,
-                                                     false, false);
+        var contents = PlacesUtils.getFolderContents(node.itemId, false, false);
         for (var i = 0; i < contents.childCount; ++i) {
           var child = contents.getChild(i);
           if (PlacesUtils.nodeIsURI(child))
             return true;
         }
       }
       else {
         var oneLinkIsSelected = false;
@@ -209,17 +208,17 @@ PlacesController.prototype = {
       var selectedNode = this._view.selectedNode;
       return selectedNode &&
              PlacesUtils.nodeIsFolder(selectedNode) &&
              !PlacesUtils.nodeIsReadOnly(selectedNode);
     case "placesCmd_setAsBookmarksToolbarFolder":
       if (this._view.hasSingleSelection) {
         var selectedNode = this._view.selectedNode;
         if (PlacesUtils.nodeIsFolder(selectedNode) &&
-            selectedNode.folderId != PlacesUtils.bookmarks.toolbarFolder) {
+            selectedNode.itemId != PlacesUtils.bookmarks.toolbarFolder) {
           return true;
         }
       }
       return false;
 #endif
     default:
       return false;
     }
@@ -333,18 +332,17 @@ PlacesController.prototype = {
 
     var btFolderId = PlacesUtils.toolbarFolderId;
     for (var i = 0; i < nodes.length; ++i) {
       // Disallow removing the view's root node 
       if (nodes[i] == root)
         return false;
 
       // Disallow removing the toolbar folder
-      if (PlacesUtils.nodeIsFolder(nodes[i]) &&
-          asFolder(nodes[i]).folderId == btFolderId)
+      if (PlacesUtils.nodeIsFolder(nodes[i]) && nodes[i].itemId == btFolderId)
         return false;
 
       // We don't call nodeIsReadOnly here, because nodeIsReadOnly means that
       // a node has children that cannot be edited, reordered or removed. Here,
       // we don't care if a node's children can't be reordered or edited, just
       // that they're removable. All history results have removable children
       // (based on the principle that any URL in the history table should be
       // removable), but some special bookmark folders may have non-removable
@@ -493,17 +491,17 @@ PlacesController.prototype = {
         case Ci.nsINavHistoryResultNode.RESULT_TYPE_QUERY:
           nodeData["query"] = true;
           break;
         case Ci.nsINavHistoryResultNode.RESULT_TYPE_REMOTE_CONTAINER:
           nodeData["remotecontainer"] = true;
           break;
         case Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER:
           nodeData["folder"] = true;
-          uri = PlacesUtils.bookmarks.getFolderURI(asFolder(node).folderId);
+          uri = PlacesUtils.bookmarks.getFolderURI(node.itemId);
 
           // See nodeIsRemoteContainer
           if (asContainer(node).remoteContainerType != "")
             nodeData["remotecontainer"] = true;
           break;
         case Ci.nsINavHistoryResultNode.RESULT_TYPE_HOST:
           nodeData["host"] = true;
           break;
@@ -727,17 +725,17 @@ PlacesController.prototype = {
    */
   showBookmarkPropertiesForSelection: 
   function PC_showBookmarkPropertiesForSelection() {
     var node = this._view.selectedNode;
     if (!node)
       return;
 
     if (PlacesUtils.nodeIsFolder(node))
-      PlacesUtils.showFolderProperties(asFolder(node).folderId);
+      PlacesUtils.showFolderProperties(node.itemId);
     else if (PlacesUtils.nodeIsBookmark(node))
       PlacesUtils.showBookmarkProperties(node.itemId);
   },
 
   /**
    * This method can be run on a URI parameter to ensure that it didn't
    * receive a string instead of an nsIURI object.
    */
@@ -758,26 +756,26 @@ PlacesController.prototype = {
 #ifdef EXTENDED_LIVEBOOKMARKS_UI
       if (selectedNode.uri.indexOf("livemark%2F") != -1) {
         PlacesUtils.livemarks.reloadAllLivemarks();
         return;
       }
 #endif
       var folder = null;
       if (PlacesUtils.nodeIsLivemarkContainer(selectedNode)) {
-        folder = asFolder(selectedNode);
+        folder = selectedNode;
       }
 #ifdef EXTENDED_LIVEBOOKMARKS_UI
       else if (PlacesUtils.nodeIsURI()) {
         if (PlacesUtils.nodeIsLivemarkItem(selectedNode))
-          folder = asFolder(selectedNode.parent);
+          folder = selectedNode.parent;
       }
 #endif
       if (folder)
-        PlacesUtils.livemarks.reloadLivemarkFolder(folder.folderId);
+        PlacesUtils.livemarks.reloadLivemarkFolder(folder.itemId);
     }
   },
 
   /**
    * Gives the user a chance to cancel loading lots of tabs at once
    */
   _confirmOpenTabs: function(numTabsToOpen) {
     var pref = Cc["@mozilla.org/preferences-service;1"].
@@ -858,18 +856,17 @@ PlacesController.prototype = {
             break;
         }
         ++firstIndex;
       }
 
       // Open each uri in the folder in a tab.
       var index = firstIndex;
       var urlsToOpen = [];
-      var contents = PlacesUtils.getFolderContents(asFolder(node).folderId,
-                                                   false, false);
+      var contents = PlacesUtils.getFolderContents(node.itemId, false, false);
       for (var i = 0; i < contents.childCount; ++i) {
         var child = contents.getChild(i);
         if (PlacesUtils.nodeIsURI(child))
           urlsToOpen.push(child.uri);
       }
 
       if (!this._confirmOpenTabs(urlsToOpen.length))
         return;
@@ -967,17 +964,17 @@ PlacesController.prototype = {
 
   /**
    * Create a new Bookmark separator somewhere.
    */
   newSeparator: function PC_newSeparator() {
     var ip = this._view.insertionPoint;
     if (!ip)
       throw Cr.NS_ERROR_NOT_AVAILABLE;
-    var txn = new PlacesCreateSeparatorTransaction(ip.folderId, ip.index);
+    var txn = new PlacesCreateSeparatorTransaction(ip.itemId, ip.index);
     PlacesUtils.tm.doTransaction(txn);
   },
 
   /**
    * Opens a dialog for moving the selected nodes.
    */
   moveSelectedBookmarks: function PC_moveBookmarks() {
     window.openDialog("chrome://browser/content/places/moveBookmarks.xul",
@@ -985,28 +982,29 @@ PlacesController.prototype = {
                       this._view.getSelectionNodes(), PlacesUtils.tm);
   },
 
   /**
    * Sort the selected folder by name
    */
   sortFolderByName: function PC_sortFolderByName() {
     var selectedNode = this._view.selectedNode;
-    var txn = new PlacesSortFolderByNameTransaction(selectedNode.folderId, selectedNode.bookmarkIndex);
+    var txn = new PlacesSortFolderByNameTransaction(selectedNode.itemId,
+                                                    selectedNode.bookmarkIndex);
     PlacesUtils.tm.doTransaction(txn);
   },
 
   /**
    * Makes the selected node the bookmarks toolbar folder.
    */
   setBookmarksToolbarFolder: function PC_setBookmarksToolbarFolder() {
     if (!this._view.hasSingleSelection)
       return false;
     var selectedNode = this._view.selectedNode;
-    var txn = new PlacesSetBookmarksToolbarTransaction(selectedNode.folderId);
+    var txn = new PlacesSetBookmarksToolbarTransaction(selectedNode.itemId);
     PlacesUtils.tm.doTransaction(txn);
   },
 
 
   /**
    * Creates a set of transactions for the removal of a range of items. A range is 
    * an array of adjacent nodes in a view.
    * @param   range
@@ -1056,29 +1054,29 @@ PlacesController.prototype = {
 
     for (var i = 0; i < range.length; ++i) {
       var node = range[i];
       if (shouldSkipNode(node))
         continue;
 
       if (PlacesUtils.nodeIsFolder(node)) {
         // TODO -- node.parent might be a query and not a folder.  See bug 324948
-        var folder = asFolder(node);
+        var folder = node;
         removedFolders.push(folder);
-        transactions.push(new PlacesRemoveFolderTransaction(folder.folderId));
+        transactions.push(new PlacesRemoveFolderTransaction(folder.itemId));
       }
       else if (PlacesUtils.nodeIsSeparator(node)) {
         // A Bookmark separator.
         transactions.push(new PlacesRemoveSeparatorTransaction(
-          asFolder(node.parent).folderId, index));
+          node.parent.itemId, index));
       }
       else if (PlacesUtils.nodeIsFolder(node.parent)) {
         // A Bookmark in a Bookmark Folder.
         transactions.push(new PlacesRemoveItemTransaction(node.itemId,
-          PlacesUtils._uri(node.uri), asFolder(node.parent).folderId, index));
+          PlacesUtils._uri(node.uri), node.parent.itemId, index));
       }
     }
   },
 
   /**
    * Removes the set of selected ranges from bookmarks.
    * @param   txnName
    *          See |remove|.
@@ -1165,17 +1163,17 @@ PlacesController.prototype = {
         // Look up this node's place: URI in the annotation service to see if 
         // it is a special, non-movable folder. 
         // XXXben: TODO
 
         addData(PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER);
 
         // Allow dropping the feed uri of live-bookmark folders
         if (PlacesUtils.nodeIsLivemarkContainer(node)) {
-          var uri = PlacesUtils.livemarks.getFeedURI(asFolder(node).folderId);
+          var uri = PlacesUtils.livemarks.getFeedURI(node.itemId);
           addURIData(uri.spec);
         }
 
       }
       else if (PlacesUtils.nodeIsSeparator(node)) {
         addData(PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR);
       }
       else {
@@ -1213,17 +1211,17 @@ PlacesController.prototype = {
         unicodeString += generateChunk(PlacesUtils.TYPE_UNICODE, overrideURI);
       }
 
       if (PlacesUtils.nodeIsFolder(node) || PlacesUtils.nodeIsQuery(node)) {
         pcString += generateChunk(PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER);
 
         // Also copy the feed URI for live-bookmark folders
         if (PlacesUtils.nodeIsLivemarkContainer(node)) {
-          var uri = PlacesUtils.livemarks.getFeedURI(asFolder(node).folderId);
+          var uri = PlacesUtils.livemarks.getFeedURI(node.itemId);
           generateURIChunks(uri.spec);
         }
       }
       else if (PlacesUtils.nodeIsSeparator(node))
         psString += generateChunk(PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR);
       else {
         placeString += generateChunk(PlacesUtils.TYPE_X_MOZ_PLACE);
         generateURIChunks();
@@ -1312,17 +1310,18 @@ PlacesController.prototype = {
       var data = { }, type = { };
       try {
         xferable.getAnyTransferData(type, data, { });
         data = data.value.QueryInterface(Ci.nsISupportsString).data;
         var items = PlacesUtils.unwrapNodes(data, type.value);
         var transactions = [];
         for (var i = 0; i < items.length; ++i) {
           transactions.push(PlacesUtils.makeTransaction(items[i], type.value, 
-                                                        ip.folderId, ip.index, true));
+                                                        ip.itemId, ip.index,
+                                                        true));
         }
         return transactions;
       }
       catch (e) {
         // getAnyTransferData will throw if there is no data of the specified
         // type on the clipboard. 
         // unwrapNodes will throw if the data that is present is malformed in
         // some way. 
@@ -1464,17 +1463,17 @@ var PlacesControllerDragHelper = {
       var data = { }, flavor = { };
       xferable.getAnyTransferData(flavor, data, { });
       data.value.QueryInterface(Ci.nsISupportsString);
       
       // There's only ever one in the D&D case. 
       var unwrapped = PlacesUtils.unwrapNodes(data.value.data, 
                                               flavor.value)[0];
       transactions.push(PlacesUtils.makeTransaction(unwrapped, 
-                        flavor.value, insertionPoint.folderId, 
+                        flavor.value, insertionPoint.itemId, 
                         insertionPoint.index, copy));
     }
 
     var txn = new PlacesAggregateTransaction("DropItems", transactions);
     PlacesUtils.tm.doTransaction(txn);
   }
 };
 
@@ -1836,36 +1835,30 @@ PlacesMoveItemTransaction.prototype = {
 function PlacesRemoveFolderTransaction(id) {
   this._removeTxn = this.bookmarks.getRemoveFolderTransaction(id);
   this._id = id;
   this._transactions = []; // A set of transactions to remove content.
   this.redoTransaction = this.doTransaction;
 }
 PlacesRemoveFolderTransaction.prototype = {
   __proto__: PlacesBaseTransaction.prototype, 
-  getFolderContents:
-  function(aFolderId, aExcludeItems, aExpandQueries) {
-    return PlacesUtils.getFolderContents(aFolderId, aExcludeItems, aExpandQueries);
-  },
-
   /**
    * Create a flat, ordered list of transactions for a depth-first recreation
    * of items within this folder.
    */
   _saveFolderContents: function PRFT__saveFolderContents() {
     this._transactions = [];
-    var contents = this.getFolderContents(this._id, false, false);
+    var contents = this.utils.getFolderContents(this._id, false, false);
     var ios = Cc["@mozilla.org/network/io-service;1"].
               getService(Ci.nsIIOService);  
     for (var i = 0; i < contents.childCount; ++i) {
       var child = contents.getChild(i);
       var txn;
       if (child.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER) {
-        var folder = asFolder(child);
-        txn = new PlacesRemoveFolderTransaction(folder.folderId);
+        txn = new PlacesRemoveFolderTransaction(child.itemId);
       }
       else if (child.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR) {
         txn = new PlacesRemoveSeparatorTransaction(this._id, i);
       }
       else {
         txn = new PlacesRemoveItemTransaction(child.itemId,
                                               ios.newURI(child.uri, null, null),
                                               this._id, i);
--- a/browser/components/places/content/menu.xml
+++ b/browser/components/places/content/menu.xml
@@ -233,17 +233,17 @@
               else if (PlacesUtils.nodeIsContainer(child)) {
                 element = document.createElementNS(XULNS, "menu");
                 element.setAttribute("type", "menu");
                 element.setAttribute("container", "true");
                 element.setAttribute("label", child.title);
 
                 if (PlacesUtils.nodeIsLivemarkContainer(child)) {
                   element.setAttribute("livemark", "true");
-                  var folder = asFolder(child).folderId;
+                  var folder = child.itemId;
                   var siteURI = PlacesUtils.livemarks.getSiteURI(folder);
                   if (siteURI) {            
                     element.setAttribute("siteURI", siteURI.spec);
                   }
                 }
 
                 var popup = document.createElementNS(XULNS, "menupopup");
                 popup.setAttribute("type", "places");
@@ -398,23 +398,23 @@
       
       <!-- nsIPlacesView -->
       <property name="insertionPoint">
         <getter><![CDATA[ 
           // By default, the insertion point is at the top level, at the end. 
           var index = -1;
           var folderId = 0;
           if (PlacesUtils.nodeIsFolder(this._resultNode))
-            folderId = this._resultNode.QueryInterface(Ci.nsINavHistoryFolderResultNode).folderId;
+            folderId = this._resultNode.itemId;
           
           if (this.hasSelection) {
-            if(PlacesUtils.nodeIsFolder(this.selectedNode)) {
+            if (PlacesUtils.nodeIsFolder(this.selectedNode)) {
               // If there is a folder selected, the insertion point is the
               // end of the folder.
-              folderId = this.selectedNode.QueryInterface(Ci.nsINavHistoryFolderResultNode).folderId;
+              folderId = this.selectedNode.itemId;
             } else {
               // If there is another type of node selected, the insertion point
               // is after that node.
               index = PlacesUtils.getIndexOfNode(this.selectedNode)
             }
           }
           return new InsertionPoint(folderId, index);
         ]]></getter>
@@ -540,17 +540,16 @@
         // dragging over this menu--insertion point, child index to drop
         // before, and folder to drop into.
         _getDropPoint: function TBV_DO_getDropPoint(event) {
           // Can't drop if the menu isn't a folder
           var resultNode = this._self._resultNode;
           if (!PlacesUtils.nodeIsFolder(this._self._result.root) ||
               !PlacesUtils.nodeIsFolder(resultNode))
             return null;
-          asFolder(resultNode);
           
           var dropPoint = { ip: null, beforeIndex: null, folderNode: null };
           // Loop through all the nodes to see which one this should
           // get dropped in/above/below.
           // Ignore static content at the top and bottom of the menu.
           var start = (this._self._startMarker != -1) ? (this._self._startMarker + 1) : 0;
           var end = (this._self._endMarker != -1) ? this._self._endMarker : this._self.childNodes.length;
           for (var i = start; i < end; i++) {
@@ -560,40 +559,41 @@
             if (xulNode.node &&
                 PlacesUtils.nodeIsFolder(xulNode.node) &&
                 !PlacesUtils.nodeIsReadOnly(xulNode.node)) {
               // This is a folder. If the mouse is in the top 25% of the
               // node, drop above the folder.  If it's in the middle
               // 50%, drop into the folder.  If it's past that, drop below.
               if (event.clientY < nodeY + (nodeHeight * 0.25)) {
                 // Drop above this folder.
-                dropPoint.ip = new InsertionPoint(resultNode.folderId, i - start, -1);
+                dropPoint.ip = new InsertionPoint(resultNode.itemId, i - start,
+                                                  -1);
                 dropPoint.beforeIndex = i;
                 return dropPoint;
               }
               else if (event.clientY < nodeY + (nodeHeight * 0.75)) {
                 // Drop inside this folder.
-                dropPoint.ip = new InsertionPoint(asFolder(xulNode.node).folderId, -1, 1);
+                dropPoint.ip = new InsertionPoint(xulNode.node.itemId, -1, 1);
                 dropPoint.beforeIndex = i;
                 dropPoint.folderNode = xulNode;
                 return dropPoint;
               }
             } else{
               // This is a non-folder node. If the mouse is above the middle,
               // drop above the folder.  Otherwise, drop below.
               if (event.clientY < nodeY + (nodeHeight / 2)) {
                 // Drop above this bookmark.
-                dropPoint.ip = new InsertionPoint(resultNode.folderId, i - start, -1);
+                dropPoint.ip = new InsertionPoint(resultNode.itemId, i - start, -1);
                 dropPoint.beforeIndex = i;
                 return dropPoint;
               }
             }
           }
           // Should drop below the last node.
-          dropPoint.ip = new InsertionPoint(resultNode.folderId, -1, 1);
+          dropPoint.ip = new InsertionPoint(resultNode.itemId, -1, 1);
           dropPoint.beforeIndex = -1;
           return dropPoint;
         },
         
         // This function clears all of the dragover styles that were set when
         // a menuitem was dragged over.
         _clearStyles: function TBV_DO_clearStyles() {
           this._self.removeAttribute("dragover");
--- a/browser/components/places/content/moveBookmarks.js
+++ b/browser/components/places/content/moveBookmarks.js
@@ -56,32 +56,32 @@ var gMoveBookmarksDialog = {
     var selectedNode = this.foldersTree.selectedNode;
     if (!selectedNode) {
       // XXXmano: the old dialog defaults to the the "Bookmarks" root folder
       // for some reason. I'm pretty sure we don't want to that yet in Places,
       // at least not until we make that folder node visible in the tree, if we
       // ever do so
       return;
     }
-    var selectedFolderID = asFolder(selectedNode).folderId;
+    var selectedFolderID = selectedNode.itemId;
 
     var transactions = [];
     for (var i=0; i < this._nodes.length; i++) {
-      var parentId = asFolder(this._nodes[i].parent).folderId;
+      var parentId = this._nodes[i].parent.itemId;
 
       // Nothing to do if the node is already under the selected folder
       if (parentId == selectedFolderID)
         continue;
 
       var nodeIndex = PlacesUtils.getIndexOfNode(this._nodes[i]);
       if (PlacesUtils.nodeIsFolder(this._nodes[i])) {
         // Disallow moving a folder into itself
-        if (asFolder(this._nodes[i]).folderId != selectedFolderID) {
+        if (this._nodes[i].itemId != selectedFolderID) {
           transactions.push(new
-            PlacesMoveFolderTransaction(asFolder(this._nodes[i]).folderId,
+            PlacesMoveFolderTransaction(this._nodes[i].itemId,
                                         parentId, nodeIndex,
                                         selectedFolderID, -1));
         }
       }
       else if (PlacesUtils.nodeIsBookmark(this._nodes[i])) {
         transactions.push(new
           PlacesMoveItemTransaction(this._nodes[i].itemId,
                                     PlacesUtils._uri(this._nodes[i].uri),
--- a/browser/components/places/content/places.js
+++ b/browser/components/places/content/places.js
@@ -314,18 +314,17 @@ var PlacesOrganizer = {
   },
 
   updateStatusBarForView: function PO_updateStatusBarForView(aView) {
     var statusText = "";
     var selectedNode = aView.selectedNode;
     if (selectedNode) {
       if (PlacesUtils.nodeIsFolder(selectedNode)) {
         var childsCount =
-          PlacesUtils.getFolderContents(asFolder(selectedNode).folderId)
-                     .childCount;
+          PlacesUtils.getFolderContents(selectedNode.itemId).childCount;
         statusText = PlacesUtils.getFormattedString("status_foldercount",
                                                     [childsCount]);
       }
       else if (PlacesUtils.nodeIsBookmark(selectedNode))
         statusText = selectedNode.uri;
     }
     document.getElementById("status").label = statusText;
   }
@@ -359,17 +358,17 @@ var PlacesSearchBox = {
         (filterString == "" || this.searchFilter.hasAttribute("empty")))
       return;
 
     var content = PlacesOrganizer._content;
     var PO = PlacesOrganizer;
 
     switch (PlacesSearchBox.filterCollection) {
     case "collection":
-      var folderId = asFolder(content.getResult().root).folderId;
+      var folderId = content.getResult().root.itemId;
       content.applyFilter(filterString, true, folderId, OptionsFilter);
       PO.setHeaderText(PO.HEADER_TYPE_SEARCH, filterString);
       break;
     case "bookmarks":
       if (filterString != "")
         content.applyFilter(filterString, true);
       else
         PlacesOrganizer.onPlaceSelected();
--- a/browser/components/places/content/toolbar.xml
+++ b/browser/components/places/content/toolbar.xml
@@ -252,17 +252,17 @@
           } else if (PlacesUtils.nodeIsSeparator(child)) {
             button = document.createElementNS(XULNS, "toolbarseparator");
           } else if (PlacesUtils.nodeIsContainer(child)) {
             button = document.createElementNS(XULNS, "toolbarbutton");
             button.setAttribute("type", "menu");
             button.setAttribute("container", "true");
             if (PlacesUtils.nodeIsLivemarkContainer(child)) {
               button.setAttribute("livemark", "true");
-              var folder = asFolder(child).folderId;
+              var folder = child.itemId;
 
               // duplicate nsLivemarkService.getSiteURI to avoid instantiating
               // the service on startup.
               var siteURIString;
               try {
                 siteURIString = 
                   this._anno.getItemAnnotationString(folder, "livemark/siteURI");
               }
@@ -297,17 +297,17 @@
         ]]></body>
       </method>
 
       <method name="removeItem">
         <parameter name="parent"/>
         <parameter name="child"/>
         <body><![CDATA[
           if (PlacesUtils.nodeIsFolder(parent) &&
-              asFolder(parent).folderId == PlacesUtils.bookmarks.toolbarFolder)
+              parent.itemId == PlacesUtils.bookmarks.toolbarFolder)
             return this.removeChild(child);
           return null;
         ]]></body>
       </method>
 
       <method name="chevronPopupShowing">
         <body><![CDATA[
           var popup = this._chevron.firstChild;
@@ -454,23 +454,23 @@
         ]]></getter>
       </property>
       
       <!-- nsIPlacesView -->
       <property name="insertionPoint">
         <getter><![CDATA[
           // By default, the insertion point is at the top level, at the end. 
           var index = -1;
-          var folderId = this._result.root.QueryInterface(Ci.nsINavHistoryFolderResultNode).folderId;
+          var folderId = this._result.root.itemId;
           
           if (this.hasSelection) {
             if(PlacesUtils.nodeIsFolder(this.selectedNode)) {
               // If there is a folder selected, the insertion point is the
               // end of the folder.
-              folderId = this.selectedNode.QueryInterface(Ci.nsINavHistoryFolderResultNode).folderId;
+              folderId = this.selectedNode.itemId;
             } else {
               // If there is another type of node selected, the insertion point
               // is after that node.
               index = PlacesUtils.getIndexOfNode(this.selectedNode)
             }
           }
           return new InsertionPoint(folderId, index, 1);
         ]]></getter>
@@ -614,55 +614,54 @@
         // This function returns information about where to drop when
         // dragging over this menu--insertion point, child index to drop
         // before, and folder to drop into.
         _getDropPoint: function TBV_DO_getDropPoint(event) {
           // Can't drop if the toolbar isn't a folder.
           var result = this._self.getResult();
           if (!PlacesUtils.nodeIsFolder(result.root))
             return null;
-          asFolder(result.root);
           
           var dropPoint = { ip: null, beforeIndex: null, folderNode: null };
           // Loop through all the nodes to see which one this should
           // get dropped in/next to
           for (var i = 0; i < this._self.childNodes.length; i++) {
             var xulNode = this._self.childNodes[i];
             if (PlacesUtils.nodeIsFolder(xulNode.node) &&
                 !PlacesUtils.nodeIsReadOnly(xulNode.node)) {
               NS_ASSERT(xulNode.getAttribute("type") == "menu");
               // This is a folder. If the mouse is in the left 25% of the
               // node, drop to the left of the folder.  If it's in the middle
               // 50%, drop into the folder.  If it's past that, drop to the right.
               if (event.clientX < xulNode.boxObject.x + (xulNode.boxObject.width * 0.25)) {
                 // Drop to the left of this folder.
-                dropPoint.ip = new InsertionPoint(result.root.folderId, i, -1);
+                dropPoint.ip = new InsertionPoint(result.root.itemId, i, -1);
                 dropPoint.beforeIndex = i;
                 return dropPoint;
               }
               else if (event.clientX < xulNode.boxObject.x + (xulNode.boxObject.width * 0.75)) {
                 // Drop inside this folder.
-                dropPoint.ip = new InsertionPoint(asFolder(xulNode.node).folderId, -1, 1);
+                dropPoint.ip = new InsertionPoint(xulNode.node.itemId, -1, 1);
                 dropPoint.beforeIndex = i;
                 dropPoint.folderNode = xulNode;
                 return dropPoint;
               }
             } else{
               // This is a non-folder node. If the mouse is left of the middle,
               // drop to the left of the folder.  If it's right, drop to the right.
               if (event.clientX < xulNode.boxObject.x + (xulNode.boxObject.width / 2)) {
                 // Drop to the left of this bookmark.
-                dropPoint.ip = new InsertionPoint(result.root.folderId, i, -1);
+                dropPoint.ip = new InsertionPoint(result.root.itemId, i, -1);
                 dropPoint.beforeIndex = i;
                 return dropPoint;
               }
             }
           }
           // Should drop to the right of the last node.
-          dropPoint.ip = new InsertionPoint(result.root.folderId, -1, 1);
+          dropPoint.ip = new InsertionPoint(result.root.itemId, -1, 1);
           dropPoint.beforeIndex = -1;
           return dropPoint;
         },
         
         onDragStart: function TBV_DO_onDragStart(event, xferData, dragAction) {
           if (event.ctrlKey) {
             dragAction.action = Ci.nsIDragService.DRAGDROP_ACTION_COPY;
           }
--- a/browser/components/places/content/tree.xml
+++ b/browser/components/places/content/tree.xml
@@ -457,33 +457,33 @@
           // selections - if the last element within a multi-selection is an
           // open folder, insert _adajacent_ to the selection.
           //
           // If the sole selection is the bookmarks toolbar folder, we nsert
           // into it even if it is not opened
           if (this.hasSingleSelection && resultView.isContainer(max.value) &&
               (resultView.isContainerOpen(max.value) ||
                resultView.nodeForTreeIndex(max.value)
-                         .folderId == PlacesUtils.bookmarksRootId))
+                         .itemId == PlacesUtils.bookmarksRootId))
             orientation = NHRVO.DROP_ON;
 
           return this._getInsertionPoint(max.value, orientation);
         ]]></getter>
       </property>
       
       <method name="_getInsertionPoint">
         <parameter name="index"/>
         <parameter name="orientation"/>
         <body><![CDATA[ 
           var result = this.getResult();
           var resultview = this.getResultView();
           var container = result.root;
           NS_ASSERT(container, "null container");
           // When there's no selection, assume the container is the container
-          // the view is populated from (i.e. the result's folderId).
+          // the view is populated from (i.e. the result's itemId).
           if (index != -1) {
             var lastSelected = resultview.nodeForTreeIndex(index);
             if (resultview.isContainer(index) && orientation == NHRVO.DROP_ON) {
               // If the last selected item is an open container, append _into_
               // it, rather than insert adjacent to it. 
               container = lastSelected;
               index = -1;
             }
@@ -496,18 +496,18 @@
               index = orientation == NHRVO.DROP_BEFORE ? lsi : lsi + 1;
             }
           }
 
           // * Disallow insertion of items under readonly folders
           // * Disallow insertion of items under the places root
           if (PlacesUtils.nodeIsFolder(container) &&
               !PlacesUtils.nodeIsReadOnly(container) &&
-              container.folderId != PlacesUtils.placesRootId) 
-            return new InsertionPoint(asFolder(container).folderId, index, orientation);
+              container.itemId != PlacesUtils.placesRootId) 
+            return new InsertionPoint(container.itemId, index, orientation);
           return null;
         ]]></body>
       </method>
 
       <!-- nsIPlacesView -->
       <field name="peerDropTypes">PlacesUtils.GENERIC_VIEW_DROP_TYPES</field>
       
       <!-- nsIPlacesView -->
@@ -579,23 +579,21 @@
             node.containerOpen = true;
 
             for (var child = 0; 
                  (child < node.childCount) && (len(indexes) > 0);
                  child++) {
               var childNode = node.getChild(child);
               if (!PlacesUtils.nodeIsFolder(childNode))
                 continue;
-
-              var childFolder = asFolder(childNode);
               
               // See if child matches an ID we wanted; add to results.
-              if (childFolder.folderId in indexes) {
-                nodes[childFolder.folderId] = childFolder;
-                delete indexes[childFolder.folderId];
+              if (childNode.itemId in indexes) {
+                nodes[childFolder.itemId] = childFolder;
+                delete indexes[childFolder.itemId];
               }
 
               // Search down that child's subtree.
               findNodes(childFolder, indexes, nodes);
             }
 
             // If we didn't find any additional matches in this node's
             // subtree, revert the node to its previous openness.
@@ -715,44 +713,43 @@
           // The InsertionPoint defines a place within the view hierarchy where 
           // items may be inserted. This function returns the node adjacent to 
           // that point. In order to get the right node, we must enumerate the
           // contents of the containing folder, but we cannot construct a new
           // query for this, because if we do so the node will be a member of
           // another result node (that constructed by |getFolderContents| say, 
           // instead of the displayed tree view). So we need to walk the 
           // children of the result to find the right folder. 
-          function findFolder(folderId, container) {
-            var wasOpen = container.containerOpen;
-            container.containerOpen = true;
-            var cc = container.childCount;
+          function findFolder(aItemId, aContainer) {
+            var wasOpen = aContainer.containerOpen;
+            aContainer.containerOpen = true;
+            var cc = aContainer.childCount;
             var foundNode = null;
             for (var i = 0; i < cc; ++i) {
-              var node = container.getChild(i);
+              var node = aContainer.getChild(i);
               if (PlacesUtils.nodeIsFolder(node)) {
-                var folder = asFolder(node);
-                if (folder.folderId == folderId) {
+                if (folder.itemId == aItemId) {
                   foundNode = node;
                   break;
                 }
-                foundNode = findFolder(folderId, folder);
+                foundNode = findFolder(aItemId, node);
                 if (foundNode)
                   break;
               }
             }
-            container.containerOpen = wasOpen;
+            aContainer.containerOpen = wasOpen;
             return foundNode;
           }
           var folder = null;
           var root = asContainer(this.getResult().root);
           if (PlacesUtils.nodeIsFolder(root) && 
-              asFolder(root).folderId == insertionPoint.folderId)
+              root.itemId == insertionPoint.itemId)
             folder = root;
           else
-            folder = findFolder(insertionPoint.folderId, root);
+            folder = findFolder(insertionPoint.itemId, root);
           
           // Since we find the folder manually, using findFolder instead of 
           // PlacesUtils.getFolderContents, the folder is not opened for
           // us. We need to do that ourselves (and remember if it was closed,
           // so that we can close it again later).
           var folderWasOpen = folder.containerOpen;
           folder.containerOpen = true;
 
--- a/browser/components/places/content/utils.js
+++ b/browser/components/places/content/utils.js
@@ -53,17 +53,16 @@ function QI_node(aNode, aIID) {
   try {
     result = aNode.QueryInterface(aIID);
   }
   catch (e) {
   }
   NS_ASSERT(result, "Node QI Failed");
   return result;
 }
-function asFolder(aNode)   { return QI_node(aNode, Ci.nsINavHistoryFolderResultNode);   }
 function asVisit(aNode)    { return QI_node(aNode, Ci.nsINavHistoryVisitResultNode);    }
 function asFullVisit(aNode){ return QI_node(aNode, Ci.nsINavHistoryFullVisitResultNode);}
 function asContainer(aNode){ return QI_node(aNode, Ci.nsINavHistoryContainerResultNode);}
 function asQuery(aNode)    { return QI_node(aNode, Ci.nsINavHistoryQueryResultNode);    }
 
 var PlacesUtils = {
   // Place entries that are containers, e.g. bookmark folders or queries.
   TYPE_X_MOZ_PLACE_CONTAINER: "text/x-moz-place-container",
@@ -283,17 +282,17 @@ var PlacesUtils = {
    * @param   aNode
    *          A NavHistoryResultNode
    * @returns true if the node is readonly, false otherwise
    */
   nodeIsReadOnly: function PU_nodeIsReadOnly(aNode) {
     NS_ASSERT(aNode, "null node");
 
     if (this.nodeIsFolder(aNode))
-      return this.bookmarks.getFolderReadonly(asFolder(aNode).folderId);
+      return this.bookmarks.getFolderReadonly(aNode.itemId);
     if (this.nodeIsQuery(aNode))
       return asQuery(aNode).childrenReadOnly;
     return false;
   },
 
   /**
    * Determines whether or not a ResultNode is a host folder or not
    * @param   aNode
@@ -383,17 +382,17 @@ var PlacesUtils = {
    * @param   aNode
    *          The node to test.
    * @returns true if the node is a readonly folder.
   */
   isReadonlyFolder: function(aNode) {
     NS_ASSERT(aNode, "null node");
 
     return this.nodeIsFolder(aNode) &&
-           this.bookmarks.getFolderReadonly(asFolder(aNode).folderId);
+           this.bookmarks.getFolderReadonly(aNode.itemId);
   },
 
   /**
    * Gets the index of a node within its parent container
    * @param   aNode
    *          The node to look up
    * @returns The index of the node within its parent container, or -1 if the
    *          node was not found or the node specified has no parent.
@@ -431,30 +430,28 @@ var PlacesUtils = {
     case this.TYPE_X_MOZ_PLACE:
     case this.TYPE_X_MOZ_PLACE_SEPARATOR:
       // Data is encoded like this:
       // bookmarks folder: <itemId>\n<>\n<parentId>\n<indexInParent>
       // uri:              0\n<uri>\n<parentId>\n<indexInParent>
       // bookmark:         <itemId>\n<uri>\n<parentId>\n<indexInParent>
       // separator:        0\n<>\n<parentId>\n<indexInParent>
       var wrapped = "";
-      if (this.nodeIsFolder(aNode))
-        wrapped += asFolder(aNode).folderId + NEWLINE;
-      else if (this.nodeIsBookmark(aNode))
+      if (aNode.itemId != -1) // 
         wrapped += aNode.itemId + NEWLINE;
       else
         wrapped += "0" + NEWLINE;
 
       if (this.nodeIsURI(aNode) || this.nodeIsQuery(aNode))
         wrapped += aNode.uri + NEWLINE;
       else
         wrapped += NEWLINE;
 
       if (this.nodeIsFolder(aNode.parent))
-        wrapped += asFolder(aNode.parent).folderId + NEWLINE;
+        wrapped += aNode.parent.itemId + NEWLINE;
       else
         wrapped += "0" + NEWLINE;
 
       wrapped += this.getIndexOfNode(aNode);
       return wrapped;
     case this.TYPE_X_MOZ_URL:
       return (aOverrideURI || aNode.uri) + NEWLINE + aNode.title;
     case this.TYPE_HTML:
@@ -532,20 +529,19 @@ var PlacesUtils = {
     function getChildItemsTransactions(aFolderId) {
       var childItemsTransactions = [];
       var children = self.getFolderContents(aFolderId, false, false);
       var cc = children.childCount;
       for (var i = 0; i < cc; ++i) {
         var txn = null;
         var node = children.getChild(i);
         if (self.nodeIsFolder(node)) {
-          var nodeFolderId = asFolder(node).folderId;
+          var nodeFolderId = node.itemId;
           var title = self.bookmarks.getItemTitle(nodeFolderId);
-          // XXXmano: use item-annotations once bug 372508 is fixed
-          var annos = self.getAnnotationsForURI(self._uri(node.uri));
+          var annos = self.getAnnotationsForItem(nodeFolderId);
           var folderItemsTransactions =
             getChildItemsTransactions(nodeFolderId);
           txn = new PlacesCreateFolderTransaction(title, -1, aIndex, annos,
                                                   folderItemsTransactions);
         }
         else if (self.nodeIsBookmark(node)) {
           txn = self._getBookmarkItemCopyTransaction(node.itemId, -1,
                                                      aIndex);
--- a/browser/components/places/src/nsPlacesImportExportService.cpp
+++ b/browser/components/places/src/nsPlacesImportExportService.cpp
@@ -1817,19 +1817,18 @@ nsPlacesImportExportService::WriteContai
     nsCOMPtr<nsINavHistoryResultNode> child;
     rv = rootNode->GetChild(i, getter_AddRefs(child));
     NS_ENSURE_SUCCESS(rv, rv);
     PRUint32 type = 0;
     rv = child->GetType(&type);
     NS_ENSURE_SUCCESS(rv, rv);
     if (type == nsINavHistoryResultNode::RESULT_TYPE_FOLDER) {
       // bookmarks folder
-      nsCOMPtr<nsINavHistoryFolderResultNode> folderNode = do_QueryInterface(child);
       PRInt64 folderId;
-      rv = folderNode->GetItemId(&folderId);
+      rv = child->GetItemId(&folderId);
       NS_ENSURE_SUCCESS(rv, rv);
       if (aFolder == mPlacesRoot && (folderId == mToolbarFolder ||
                                folderId == mBookmarksRoot)) {
         // don't write out the bookmarks menu folder from the
         // places root. When writing to bookmarks.html, it is reparented
         // to the menu, which is the root of the namespace. This provides
         // better backwards compatability.
         continue;
--- a/toolkit/components/places/public/nsINavHistoryService.idl
+++ b/toolkit/components/places/public/nsINavHistoryService.idl
@@ -38,17 +38,16 @@
 
 #include "nsISupports.idl"
 #include "nsIArray.idl"
 #include "nsIURI.idl"
 
 interface nsIFile;
 interface nsINavHistoryContainerResultNode;
 interface nsINavHistoryQueryResultNode;
-interface nsINavHistoryFolderResultNode;
 interface nsINavHistoryQuery;
 interface nsINavHistoryQueryOptions;
 interface nsINavHistoryResult;
 interface nsITreeColumn;
 interface nsIWritablePropertyBag;
 
 [scriptable, uuid(2cce631e-d7dd-4162-a05b-e8ecfbc34367)]
 interface nsINavHistoryResultNode : nsISupports
@@ -76,17 +75,17 @@ interface nsINavHistoryResultNode : nsIS
    * have a remote container type as well.
    */
   const PRUint32 RESULT_TYPE_URI = 0;              // nsINavHistoryResultNode
   const PRUint32 RESULT_TYPE_VISIT = 1;            // nsINavHistoryVisitResultNode
   const PRUint32 RESULT_TYPE_FULL_VISIT = 2;       // nsINavHistoryFullVisitResultNode
   const PRUint32 RESULT_TYPE_HOST = 3;             // nsINavHistoryContainerResultNode
   const PRUint32 RESULT_TYPE_REMOTE_CONTAINER = 4; // nsINavHistoryContainerResultNode
   const PRUint32 RESULT_TYPE_QUERY = 5;            // nsINavHistoryQueryResultNode
-  const PRUint32 RESULT_TYPE_FOLDER = 6;           // nsINavHistoryFolderResultNode
+  const PRUint32 RESULT_TYPE_FOLDER = 6;           // nsINavHistoryQueryResultNode
   const PRUint32 RESULT_TYPE_SEPARATOR = 7;        // nsINavHistoryResultNode
   const PRUint32 RESULT_TYPE_DAY = 8;              // nsINavHistoryContainerResultNode
   readonly attribute PRUint32 type;
 
   /**
    * Title of the web page, or of the node's grouping (day, host, folder, etc)
    */
   readonly attribute AUTF8String title;
@@ -390,34 +389,16 @@ interface nsINavHistoryQueryResultNode :
 
   /**
    * Get the options which group this node's children.
    * Only valid for RESULT_TYPE_QUERY nodes.
    */
   readonly attribute nsINavHistoryQueryOptions queryOptions;
 };
 
-
-/**
- * Represents a bookmark folder (type == RESULT_TYPE_FOLDER). It derives from a
- * query result because it can provide a query that will result in the
- * contents.
- */
-[scriptable, uuid(f3160bfe-ebb3-453b-b25e-19d0b9c425b1)]
-interface nsINavHistoryFolderResultNode : nsINavHistoryQueryResultNode
-{
-  /**
-   * ID of the folder corresponding to this node.
-   * Only valid for RESULT_TYPE_QUERY nodes where exactly one folder
-   * has been specified in the query.  0 in all other cases.
-   */
-  readonly attribute PRInt64 folderId;
-};
-
-
 /**
  *  Allows clients of the HistoryResult to define domain specific handling 
  *  of specific nsITreeView methods that the HistoryResult does not implement.
  *
  *  @see nsINavHistoryResult for where this fits in
  */
 [scriptable, uuid(b34d5ca4-ce8e-49a6-9201-a59ae2128d2c)]
 interface nsINavHistoryResultViewObserver : nsISupports
@@ -697,21 +678,18 @@ interface nsINavHistoryResult : nsISuppo
    * objects are related). This may be null, in which case you can still
    * manually walk the tree using the root node. When this is non-null, you
    * can access the flattened list of items (flatItemCount, nodeForFlatIndex,
    * flatIndexForNode).
    */
   attribute nsINavHistoryResultViewer viewer;
 
   /**
-   * This is the root of the results.  It will either be a
-   * nsINavHistoryFolderResultNode (if the query is for bookmarks matching a
-   * single folder) or just a nsINavHistoryQueryResultNode (for everything
-   * else). Remember that you need to open all containers for their contents 
-   * to be valid.
+   * This is the root of the results. Remember that you need to open all
+   * containers for their contents to be valid.
    */
   readonly attribute nsINavHistoryQueryResultNode root;
 };
 
 
 /**
  * Similar to nsIRDFObserver for history. Note that we don't pass the data
  * source since that is always the global history.
--- a/toolkit/components/places/src/nsNavHistoryResult.cpp
+++ b/toolkit/components/places/src/nsNavHistoryResult.cpp
@@ -2569,20 +2569,19 @@ nsNavHistoryQueryResultNode::OnFolderCha
 //
 //    There is an additional wrinkle. If the result is attached to a treeview,
 //    and we invalidate but the folder itself is visible (its parent is open),
 //    we will immediately get asked if we are full. The folder will then query
 //    its children. Thus, the whole benefit of incremental updating is lost.
 //    Therefore, if we are in a treeview AND our parent is visible, we will
 //    keep incremental updating.
 
-NS_IMPL_ISUPPORTS_INHERITED2(nsNavHistoryFolderResultNode,
+NS_IMPL_ISUPPORTS_INHERITED1(nsNavHistoryFolderResultNode,
                              nsNavHistoryContainerResultNode,
-                             nsINavHistoryQueryResultNode,
-                             nsINavHistoryFolderResultNode)
+                             nsINavHistoryQueryResultNode)
 
 nsNavHistoryFolderResultNode::nsNavHistoryFolderResultNode(
     const nsACString& aTitle, nsNavHistoryQueryOptions* aOptions,
     PRInt64 aFolderId, const nsACString& aRemoteContainerType) :
   nsNavHistoryContainerResultNode(EmptyCString(), aTitle, EmptyCString(),
                                   nsNavHistoryResultNode::RESULT_TYPE_FOLDER,
                                   PR_FALSE, aRemoteContainerType),
   mContentsValid(PR_FALSE),
--- a/toolkit/components/places/src/nsNavHistoryResult.h
+++ b/toolkit/components/places/src/nsNavHistoryResult.h
@@ -687,17 +687,17 @@ public:
 
 
 // nsNavHistoryFolderResultNode
 //
 //    Overridden container type for bookmark folders. It will keep the contents
 //    of the folder in sync with the bookmark service.
 
 class nsNavHistoryFolderResultNode : public nsNavHistoryContainerResultNode,
-                                     public nsINavHistoryFolderResultNode
+                                     public nsINavHistoryQueryResultNode
 {
 public:
   nsNavHistoryFolderResultNode(const nsACString& aTitle,
                                nsNavHistoryQueryOptions* options,
                                PRInt64 aFolderId,
                                const nsACString& aRemoteContainerType);
 
   NS_DECL_ISUPPORTS_INHERITED
@@ -705,19 +705,16 @@ public:
   NS_IMETHOD GetType(PRUint32* type)
     { *type = nsNavHistoryResultNode::RESULT_TYPE_FOLDER; return NS_OK; }
   NS_IMETHOD GetUri(nsACString& aURI);
   NS_FORWARD_CONTAINERNODE_EXCEPT_HASCHILDREN_AND_READONLY
   NS_IMETHOD GetHasChildren(PRBool* aHasChildren);
   NS_IMETHOD GetChildrenReadOnly(PRBool *aChildrenReadOnly);
   NS_DECL_NSINAVHISTORYQUERYRESULTNODE
 
-  NS_IMETHOD GetFolderId(PRInt64* aFolderId)
-    { *aFolderId = mItemId; return NS_OK; }
-
   virtual nsresult OpenContainer();
 
   // This object implements a bookmark observer interface without deriving from
   // the bookmark observers. This is called from the result's actual observer
   // and it knows all observers are FolderResultNodes
   NS_DECL_NSINAVBOOKMARKOBSERVER
 
   virtual void OnRemoving();