bug 838565 - cc taf and nsFind r=smaug

This commit is contained in:
Trevor Saunders 2013-01-31 18:46:24 -05:00
parent 4d9b1a396c
commit b88a8e6cb9
5 changed files with 62 additions and 8 deletions

View File

@ -87,7 +87,8 @@ public:
} }
// nsISupports // nsISupports
NS_DECL_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS(nsFindContentIterator)
// nsIContentIterator // nsIContentIterator
virtual nsresult Init(nsINode* aRoot) virtual nsresult Init(nsINode* aRoot)
@ -130,7 +131,17 @@ private:
void SetupInnerIterator(nsIContent* aContent); void SetupInnerIterator(nsIContent* aContent);
}; };
NS_IMPL_ISUPPORTS1(nsFindContentIterator, nsIContentIterator) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsFindContentIterator)
NS_INTERFACE_MAP_ENTRY(nsIContentIterator)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsFindContentIterator)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsFindContentIterator)
NS_IMPL_CYCLE_COLLECTION_6(nsFindContentIterator, mOuterIterator, mInnerIterator,
mStartOuterContent, mEndOuterContent, mEndNode, mStartNode)
nsresult nsresult
nsFindContentIterator::Init(nsIDOMNode* aStartNode, int32_t aStartOffset, nsFindContentIterator::Init(nsIDOMNode* aStartNode, int32_t aStartOffset,
@ -425,7 +436,15 @@ NS_NewFindContentIterator(bool aFindBackward,
} }
// -------------------------------------------------------------------- // --------------------------------------------------------------------
NS_IMPL_ISUPPORTS1(nsFind, nsIFind) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsFind)
NS_INTERFACE_MAP_ENTRY(nsIFind)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsFind)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsFind)
NS_IMPL_CYCLE_COLLECTION_3(nsFind, mLastBlockParent, mIterNode, mIterator)
nsFind::nsFind() nsFind::nsFind()
: mFindBackward(false) : mFindBackward(false)

View File

@ -9,6 +9,7 @@
#include "nsIFind.h" #include "nsIFind.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIDOMNode.h" #include "nsIDOMNode.h"
#include "nsIDOMRange.h" #include "nsIDOMRange.h"
#include "nsIContentIterator.h" #include "nsIContentIterator.h"
@ -27,8 +28,9 @@ class nsFindContentIterator;
class nsFind : public nsIFind class nsFind : public nsIFind
{ {
public: public:
NS_DECL_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_NSIFIND NS_DECL_NSIFIND
NS_DECL_CYCLE_COLLECTION_CLASS(nsFind)
nsFind(); nsFind();
virtual ~nsFind(); virtual ~nsFind();

View File

@ -9,6 +9,7 @@
#include "mozilla/ModuleUtils.h" #include "mozilla/ModuleUtils.h"
#include "nsIWebBrowserChrome.h" #include "nsIWebBrowserChrome.h"
#include "nsCURILoader.h" #include "nsCURILoader.h"
#include "nsCycleCollectionParticipant.h"
#include "nsNetUtil.h" #include "nsNetUtil.h"
#include "nsIURL.h" #include "nsIURL.h"
#include "nsIURI.h" #include "nsIURI.h"
@ -53,15 +54,20 @@
#include "nsTypeAheadFind.h" #include "nsTypeAheadFind.h"
NS_INTERFACE_MAP_BEGIN(nsTypeAheadFind) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsTypeAheadFind)
NS_INTERFACE_MAP_ENTRY(nsITypeAheadFind) NS_INTERFACE_MAP_ENTRY(nsITypeAheadFind)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsITypeAheadFind) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsITypeAheadFind)
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
NS_INTERFACE_MAP_ENTRY(nsIObserver) NS_INTERFACE_MAP_ENTRY(nsIObserver)
NS_INTERFACE_MAP_END NS_INTERFACE_MAP_END
NS_IMPL_ADDREF(nsTypeAheadFind) NS_IMPL_CYCLE_COLLECTING_ADDREF(nsTypeAheadFind)
NS_IMPL_RELEASE(nsTypeAheadFind) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsTypeAheadFind)
NS_IMPL_CYCLE_COLLECTION_9(nsTypeAheadFind, mFoundLink, mFoundEditable,
mCurrentWindow, mStartFindRange, mSearchRange,
mStartPointRange, mEndPointRange, mSoundInterface,
mFind)
static NS_DEFINE_CID(kFrameTraversalCID, NS_FRAMETRAVERSAL_CID); static NS_DEFINE_CID(kFrameTraversalCID, NS_FRAMETRAVERSAL_CID);

View File

@ -3,6 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsCycleCollectionParticipant.h"
#include "nsISelectionController.h" #include "nsISelectionController.h"
#include "nsIController.h" #include "nsIController.h"
#include "nsIControllers.h" #include "nsIControllers.h"
@ -31,10 +32,12 @@ public:
nsTypeAheadFind(); nsTypeAheadFind();
virtual ~nsTypeAheadFind(); virtual ~nsTypeAheadFind();
NS_DECL_ISUPPORTS NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_NSITYPEAHEADFIND NS_DECL_NSITYPEAHEADFIND
NS_DECL_NSIOBSERVER NS_DECL_NSIOBSERVER
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsTypeAheadFind, nsITypeAheadFind)
protected: protected:
nsresult PrefsReset(); nsresult PrefsReset();

View File

@ -919,6 +919,30 @@ struct Skippable
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f8) \ NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f8) \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
#define NS_IMPL_CYCLE_COLLECTION_9(_class, _f1, _f2, _f3, _f4, _f5, _f6, _f7, _f8, _f9) \
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class) \
NS_IMPL_CYCLE_COLLECTION_UNLINK(_f1) \
NS_IMPL_CYCLE_COLLECTION_UNLINK(_f2) \
NS_IMPL_CYCLE_COLLECTION_UNLINK(_f3) \
NS_IMPL_CYCLE_COLLECTION_UNLINK(_f4) \
NS_IMPL_CYCLE_COLLECTION_UNLINK(_f5) \
NS_IMPL_CYCLE_COLLECTION_UNLINK(_f6) \
NS_IMPL_CYCLE_COLLECTION_UNLINK(_f7) \
NS_IMPL_CYCLE_COLLECTION_UNLINK(_f8) \
NS_IMPL_CYCLE_COLLECTION_UNLINK(_f9) \
NS_IMPL_CYCLE_COLLECTION_UNLINK_END \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class) \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f1) \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f2) \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f3) \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f4) \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f5) \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f6) \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f7) \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f8) \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f9) \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
#define NS_IMPL_CYCLE_COLLECTION_INHERITED_0(_class, _base) \ #define NS_IMPL_CYCLE_COLLECTION_INHERITED_0(_class, _base) \
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(_class, _base) \ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(_class, _base) \
NS_IMPL_CYCLE_COLLECTION_UNLINK_END \ NS_IMPL_CYCLE_COLLECTION_UNLINK_END \