diff --git a/toolkit/components/places/src/nsLivemarkService.h b/toolkit/components/places/src/nsLivemarkService.h index a642073b845..13b114faf06 100644 --- a/toolkit/components/places/src/nsLivemarkService.h +++ b/toolkit/components/places/src/nsLivemarkService.h @@ -41,6 +41,7 @@ #include "nsIAnnotationService.h" #include "nsNavHistory.h" #include "nsBrowserCompsCID.h" +#include "nsILoadGroup.h" // Constants for livemark annotations #define LMANNO_FEEDURI "livemark/feedURI" @@ -71,13 +72,21 @@ public: nsCOMPtr folderURI; nsCOMPtr feedURI; PRBool locked; + // Keep track of the load group that contains the channel we're using + // to load this livemark. This allows the load to be cancelled if + // necessary. The load group automatically adds redirect channels, so + // cancelling the load group cancels everything. + nsCOMPtr loadGroup; - LivemarkInfo(PRInt64 aFolderId, nsCOMPtr aFolderURI, nsCOMPtr aFeedURI) { - folderId = aFolderId; - folderURI = aFolderURI; - feedURI = aFeedURI; - locked = false; - } + LivemarkInfo(PRInt64 aFolderId, nsIURI *aFolderURI, nsIURI *aFeedURI) + : folderId(aFolderId), folderURI(aFolderURI), feedURI(aFeedURI), + locked(PR_FALSE) { } + + void AddRef() { ++mRefCnt; } + void Release() { if (--mRefCnt == 0) delete this; } + + private: + nsAutoRefCnt mRefCnt; }; private: @@ -98,7 +107,7 @@ private: nsCOMPtr mBookmarksService; // The list of livemarks is stored in this array - nsTArray mLivemarks; + nsTArray< nsRefPtr > mLivemarks; // Livemarks are updated on a timer. nsCOMPtr mTimer;