From 5ccce391b13766cb582d03499ba7ce410f35aeef Mon Sep 17 00:00:00 2001 From: "benjamin%smedbergs.us" Date: Tue, 18 Jul 2006 15:08:04 +0000 Subject: [PATCH] Bug 326432, r=annie.sullivan Bookmarks batches are transactions, livemarks performance bug fixes. Original committer: brettw%gmail.com Original revision: 1.19 Original date: 2006/02/08 21:07:59 --- toolkit/components/places/src/nsNavBookmarks.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/toolkit/components/places/src/nsNavBookmarks.h b/toolkit/components/places/src/nsNavBookmarks.h index 2efe84fa75c..f88ff8004c2 100644 --- a/toolkit/components/places/src/nsNavBookmarks.h +++ b/toolkit/components/places/src/nsNavBookmarks.h @@ -110,8 +110,14 @@ private: PRInt64 mRoot; PRInt64 mBookmarksRoot; PRInt64 mToolbarRoot; + + // the level of nesting of batches, 0 when no batches are open PRInt32 mBatchLevel; + // true if the outermost batch has an associated transaction that should + // be committed when our batch level reaches 0 again. + PRBool mBatchHasTransaction; + nsCOMPtr mDBGetFolderInfo; // kGetFolderInfoIndex_* results nsCOMPtr mDBGetChildren; // kGetInfoIndex_* results + kGetChildrenIndex_* results @@ -140,4 +146,11 @@ private: PRInt64 aFolder); }; +struct nsBookmarksUpdateBatcher +{ + nsBookmarksUpdateBatcher() { nsNavBookmarks::GetBookmarksService()->BeginUpdateBatch(); } + ~nsBookmarksUpdateBatcher() { nsNavBookmarks::GetBookmarksService()->EndUpdateBatch(); } +}; + + #endif // nsNavBookmarks_h_