Bug 1382966 - Use skipDescendantsOnItemRemoval in nsNavHistoryResult to improve performance when deleting bookmark folders. r?mak draft
authorMark Banner <standard8@mozilla.com>
Tue, 01 Aug 2017 12:40:40 +0100
changeset 619009 2b0a0dfd04258d0ed9adf0ac3dc178a9ce46c0e0
parent 618502 1be0c1da06076f85c69cd8a9d244e0164ec544d9
child 640262 296116a5ac0f27d69af3e8d1a9c03f049091f67d
push id71537
push userbmo:standard8@mozilla.com
push dateTue, 01 Aug 2017 11:41:17 +0000
reviewersmak
bugs1382966
milestone56.0a1
Bug 1382966 - Use skipDescendantsOnItemRemoval in nsNavHistoryResult to improve performance when deleting bookmark folders. r?mak MozReview-Commit-ID: FaotgKVaEmH
toolkit/components/places/nsNavBookmarks.cpp
toolkit/components/places/nsNavHistoryResult.cpp
--- a/toolkit/components/places/nsNavBookmarks.cpp
+++ b/toolkit/components/places/nsNavBookmarks.cpp
@@ -46,17 +46,17 @@ namespace {
 bool DontSkip(nsCOMPtr<nsINavBookmarkObserver> obs) { return false; }
 bool SkipTags(nsCOMPtr<nsINavBookmarkObserver> obs) {
   bool skipTags = false;
   (void) obs->GetSkipTags(&skipTags);
   return skipTags;
 }
 bool SkipDescendants(nsCOMPtr<nsINavBookmarkObserver> obs) {
   bool skipDescendantsOnItemRemoval = false;
-  (void) obs->GetSkipTags(&skipDescendantsOnItemRemoval);
+  (void) obs->GetSkipDescendantsOnItemRemoval(&skipDescendantsOnItemRemoval);
   return skipDescendantsOnItemRemoval;
 }
 
 template<typename Method, typename DataType>
 class AsyncGetBookmarksForURI : public AsyncStatementCallback
 {
 public:
   AsyncGetBookmarksForURI(nsNavBookmarks* aBookmarksSvc,
--- a/toolkit/components/places/nsNavHistoryResult.cpp
+++ b/toolkit/components/places/nsNavHistoryResult.cpp
@@ -4394,17 +4394,17 @@ nsNavHistoryResult::GetSkipTags(bool *aS
 {
   *aSkipTags = false;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNavHistoryResult::GetSkipDescendantsOnItemRemoval(bool *aSkipDescendantsOnItemRemoval)
 {
-  *aSkipDescendantsOnItemRemoval = false;
+  *aSkipDescendantsOnItemRemoval = true;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNavHistoryResult::OnBeginUpdateBatch()
 {
   // Since we could be observing both history and bookmarks, it's possible both
   // notify the batch.  We can safely ignore nested calls.