Bug 1371679 - 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 619010 49f6898296950bc71533adcc2d9d9dd2e06b510b
parent 618502 1be0c1da06076f85c69cd8a9d244e0164ec544d9
child 640263 f5e3cb4057fe6e47d08bda161088138bff02fd3b
push id71538
push userbmo:standard8@mozilla.com
push dateTue, 01 Aug 2017 11:45:01 +0000
reviewersmak
bugs1371679
milestone56.0a1
Bug 1371679 - 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.