2007-01-05 01:31:26 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2007-02-14 20:33:38 +03:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* The Mozilla Foundation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2006
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
2007-01-05 01:31:26 +03:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#ifndef nsCycleCollectionParticipant_h__
|
|
|
|
#define nsCycleCollectionParticipant_h__
|
|
|
|
|
|
|
|
#include "nsISupports.h"
|
|
|
|
|
|
|
|
#define NS_CYCLECOLLECTIONPARTICIPANT_IID \
|
2007-03-16 15:52:47 +03:00
|
|
|
{ \
|
|
|
|
0x8057ad9e, \
|
|
|
|
0x3ecc, \
|
|
|
|
0x4e89, \
|
|
|
|
{ 0x89, 0xac, 0x0a, 0x71, 0xf3, 0x8b, 0x14, 0xc2 } \
|
2007-01-05 01:31:26 +03:00
|
|
|
}
|
|
|
|
|
2007-02-18 17:38:04 +03:00
|
|
|
/**
|
|
|
|
* Special IID to get at the base nsISupports for a class. Usually this is the
|
|
|
|
* canonical nsISupports pointer, but in the case of tearoffs for example it is
|
|
|
|
* the base nsISupports pointer of the tearoff. This allow the cycle collector
|
|
|
|
* to have separate nsCycleCollectionParticipant's for tearoffs or aggregated
|
|
|
|
* classes.
|
|
|
|
*/
|
|
|
|
#define NS_CYCLECOLLECTIONISUPPORTS_IID \
|
|
|
|
{ \
|
|
|
|
0xc61eac14, \
|
|
|
|
0x5f7a, \
|
|
|
|
0x4481, \
|
|
|
|
{ 0x96, 0x5e, 0x7e, 0xaa, 0x6e, 0xff, 0xa8, 0x5f } \
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Just holds the IID so NS_GET_IID works.
|
|
|
|
*/
|
|
|
|
class NS_COM nsCycleCollectionISupports
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_CYCLECOLLECTIONISUPPORTS_IID)
|
|
|
|
};
|
|
|
|
|
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsCycleCollectionISupports,
|
|
|
|
NS_CYCLECOLLECTIONISUPPORTS_IID)
|
|
|
|
|
2007-01-05 01:31:26 +03:00
|
|
|
#undef IMETHOD_VISIBILITY
|
|
|
|
#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT
|
|
|
|
|
|
|
|
struct nsCycleCollectionTraversalCallback
|
|
|
|
{
|
|
|
|
// You must call DescribeNode() with an accurate refcount,
|
|
|
|
// otherwise cycle collection will fail, and probably crash.
|
2007-04-21 21:43:19 +04:00
|
|
|
#ifdef DEBUG_CC
|
|
|
|
virtual void DescribeNode(size_t refcount,
|
|
|
|
size_t objsz,
|
2007-01-05 01:31:26 +03:00
|
|
|
const char *objname) = 0;
|
2007-04-21 21:43:19 +04:00
|
|
|
#else
|
|
|
|
virtual void DescribeNode(size_t refcount) = 0;
|
|
|
|
#endif
|
2007-01-05 01:31:26 +03:00
|
|
|
virtual void NoteScriptChild(PRUint32 langID, void *child) = 0;
|
|
|
|
virtual void NoteXPCOMChild(nsISupports *child) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
class NS_COM nsCycleCollectionParticipant
|
|
|
|
: public nsISupports
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_CYCLECOLLECTIONPARTICIPANT_IID)
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
2007-03-08 14:31:14 +03:00
|
|
|
NS_IMETHOD Unlink(nsISupports *p);
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMETHOD Traverse(nsISupports *p,
|
2007-03-08 14:31:14 +03:00
|
|
|
nsCycleCollectionTraversalCallback &cb);
|
2007-03-16 15:52:47 +03:00
|
|
|
NS_IMETHOD_(void) UnmarkPurple(nsISupports *p);
|
2007-02-18 17:38:04 +03:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
NS_EXTERNAL_VIS_(PRBool) CheckForRightISupports(nsISupports *s);
|
|
|
|
#endif
|
2007-01-05 01:31:26 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsCycleCollectionParticipant,
|
|
|
|
NS_CYCLECOLLECTIONPARTICIPANT_IID)
|
|
|
|
|
|
|
|
#undef IMETHOD_VISIBILITY
|
|
|
|
#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Helpers for implementing a QI to nsCycleCollectionParticipant
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#define NS_CYCLE_COLLECTION_INNERCLASS \
|
|
|
|
cycleCollection
|
|
|
|
|
|
|
|
#define NS_CYCLE_COLLECTION_CLASSNAME(_class) \
|
|
|
|
_class::NS_CYCLE_COLLECTION_INNERCLASS
|
|
|
|
|
|
|
|
#define NS_CYCLE_COLLECTION_NAME(_class) \
|
|
|
|
_class##_cycleCollectorGlobal
|
|
|
|
|
|
|
|
#define NS_IMPL_QUERY_CYCLE_COLLECTION(_class) \
|
|
|
|
if ( aIID.Equals(NS_GET_IID(nsCycleCollectionParticipant)) ) { \
|
|
|
|
foundInterface = & NS_CYCLE_COLLECTION_NAME(_class); \
|
|
|
|
} else
|
|
|
|
|
2007-02-18 17:38:04 +03:00
|
|
|
#define NS_IMPL_QUERY_CYCLE_COLLECTION_ISUPPORTS(_class) \
|
|
|
|
if ( aIID.Equals(NS_GET_IID(nsCycleCollectionISupports)) ) \
|
|
|
|
foundInterface = NS_CYCLE_COLLECTION_CLASSNAME(_class)::Upcast(this); \
|
|
|
|
else
|
|
|
|
|
2007-01-05 01:31:26 +03:00
|
|
|
#define NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION(_class) \
|
|
|
|
NS_IMPL_QUERY_CYCLE_COLLECTION(_class)
|
|
|
|
|
2007-02-18 17:38:04 +03:00
|
|
|
#define NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION_ISUPPORTS(_class) \
|
|
|
|
NS_IMPL_QUERY_CYCLE_COLLECTION_ISUPPORTS(_class)
|
|
|
|
|
|
|
|
#define NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(_class) \
|
|
|
|
NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION(_class) \
|
|
|
|
NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION_ISUPPORTS(_class)
|
|
|
|
|
2007-04-25 20:35:31 +04:00
|
|
|
#define NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(_class) \
|
|
|
|
NS_INTERFACE_MAP_BEGIN(_class) \
|
|
|
|
NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION(_class) \
|
|
|
|
NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION_ISUPPORTS(_class)
|
|
|
|
|
|
|
|
#define NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(_class) \
|
|
|
|
NS_INTERFACE_MAP_BEGIN(_class) \
|
|
|
|
NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION(_class)
|
2007-01-05 01:31:26 +03:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Helpers for implementing nsCycleCollectionParticipant::Unlink
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2007-02-18 17:38:04 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class) \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMETHODIMP \
|
|
|
|
NS_CYCLE_COLLECTION_CLASSNAME(_class)::Unlink(nsISupports *s) \
|
|
|
|
{ \
|
2007-02-18 17:38:04 +03:00
|
|
|
NS_ASSERTION(CheckForRightISupports(s), \
|
|
|
|
"not the nsISupports pointer we expect"); \
|
|
|
|
_class *tmp = Downcast(s);
|
2007-01-05 01:31:26 +03:00
|
|
|
|
2007-03-08 14:17:16 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(_class, _base_class) \
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
NS_CYCLE_COLLECTION_CLASSNAME(_class)::Unlink(nsISupports *s) \
|
|
|
|
{ \
|
|
|
|
NS_ASSERTION(CheckForRightISupports(s), \
|
|
|
|
"not the nsISupports pointer we expect"); \
|
|
|
|
_class *tmp = NS_STATIC_CAST(_class*, Downcast(s)); \
|
|
|
|
NS_CYCLE_COLLECTION_CLASSNAME(_base_class)::Unlink(s);
|
|
|
|
|
2007-01-05 01:31:26 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(_field) \
|
|
|
|
tmp->_field = NULL;
|
|
|
|
|
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMARRAY(_field) \
|
|
|
|
tmp->_field.Clear();
|
|
|
|
|
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_UNLINK_END \
|
|
|
|
return NS_OK; \
|
|
|
|
}
|
|
|
|
|
2007-02-18 23:05:32 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_UNLINK_0(_class) \
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
NS_CYCLE_COLLECTION_CLASSNAME(_class)::Unlink(nsISupports *s) \
|
|
|
|
{ \
|
|
|
|
NS_ASSERTION(CheckForRightISupports(s), \
|
|
|
|
"not the nsISupports pointer we expect"); \
|
|
|
|
return NS_OK; \
|
|
|
|
}
|
|
|
|
|
2007-01-05 01:31:26 +03:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Helpers for implementing nsCycleCollectionParticipant::Traverse
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2007-04-21 21:43:19 +04:00
|
|
|
#ifdef DEBUG_CC
|
2007-01-05 01:31:26 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_DESCRIBE(_class) \
|
|
|
|
cb.DescribeNode(tmp->mRefCnt.get(), sizeof(_class), #_class);
|
2007-04-21 21:43:19 +04:00
|
|
|
#else
|
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_DESCRIBE(_class) \
|
|
|
|
cb.DescribeNode(tmp->mRefCnt.get());
|
|
|
|
#endif
|
2007-01-05 01:31:26 +03:00
|
|
|
|
2007-02-18 17:38:04 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class) \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMETHODIMP \
|
|
|
|
NS_CYCLE_COLLECTION_CLASSNAME(_class)::Traverse \
|
|
|
|
(nsISupports *s, \
|
|
|
|
nsCycleCollectionTraversalCallback &cb) \
|
|
|
|
{ \
|
2007-02-18 17:38:04 +03:00
|
|
|
NS_ASSERTION(CheckForRightISupports(s), \
|
|
|
|
"not the nsISupports pointer we expect"); \
|
|
|
|
_class *tmp = Downcast(s); \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_DESCRIBE(_class)
|
|
|
|
|
2007-03-08 14:17:16 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(_class, _base_class) \
|
|
|
|
NS_IMETHODIMP \
|
|
|
|
NS_CYCLE_COLLECTION_CLASSNAME(_class)::Traverse \
|
|
|
|
(nsISupports *s, \
|
|
|
|
nsCycleCollectionTraversalCallback &cb) \
|
|
|
|
{ \
|
|
|
|
NS_ASSERTION(CheckForRightISupports(s), \
|
|
|
|
"not the nsISupports pointer we expect"); \
|
|
|
|
_class *tmp = NS_STATIC_CAST(_class*, Downcast(s)); \
|
|
|
|
NS_CYCLE_COLLECTION_CLASSNAME(_base_class)::Traverse(s, cb);
|
|
|
|
|
2007-02-17 02:02:08 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(_field) \
|
2007-03-09 16:14:06 +03:00
|
|
|
cb.NoteXPCOMChild(tmp->_field);
|
2007-02-17 02:02:08 +03:00
|
|
|
|
2007-01-05 01:31:26 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(_field) \
|
2007-03-09 16:14:06 +03:00
|
|
|
cb.NoteXPCOMChild(tmp->_field.get());
|
2007-01-05 01:31:26 +03:00
|
|
|
|
2007-03-08 14:17:16 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR_AMBIGUOUS(_field, _base) \
|
2007-03-09 16:14:06 +03:00
|
|
|
cb.NoteXPCOMChild(NS_ISUPPORTS_CAST(_base*, tmp->_field));
|
2007-03-08 14:17:16 +03:00
|
|
|
|
2007-01-05 01:31:26 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMARRAY(_field) \
|
|
|
|
{ \
|
2007-03-09 16:14:06 +03:00
|
|
|
PRInt32 i; \
|
|
|
|
for (i = 0; i < tmp->_field.Count(); ++i) \
|
|
|
|
cb.NoteXPCOMChild(tmp->_field[i]); \
|
2007-01-05 01:31:26 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END \
|
|
|
|
return NS_OK; \
|
|
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Helpers for implementing a concrete nsCycleCollectionParticipant
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2007-02-18 17:38:04 +03:00
|
|
|
#define NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(_class, _base) \
|
2007-01-05 01:31:26 +03:00
|
|
|
class NS_CYCLE_COLLECTION_INNERCLASS \
|
|
|
|
: public nsCycleCollectionParticipant \
|
|
|
|
{ \
|
2007-02-18 17:38:04 +03:00
|
|
|
public: \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMETHOD Unlink(nsISupports *n); \
|
|
|
|
NS_IMETHOD Traverse(nsISupports *n, \
|
|
|
|
nsCycleCollectionTraversalCallback &cb); \
|
2007-03-16 15:52:47 +03:00
|
|
|
NS_IMETHOD_(void) UnmarkPurple(nsISupports *n) \
|
|
|
|
{ \
|
|
|
|
Downcast(n)->UnmarkPurple(); \
|
|
|
|
} \
|
2007-02-18 17:38:04 +03:00
|
|
|
static _class* Downcast(nsISupports* s) \
|
|
|
|
{ \
|
|
|
|
return NS_STATIC_CAST(_class*, NS_STATIC_CAST(_base*, s)); \
|
|
|
|
} \
|
|
|
|
static nsISupports* Upcast(_class *p) \
|
|
|
|
{ \
|
|
|
|
return NS_ISUPPORTS_CAST(_base*, p); \
|
|
|
|
} \
|
2007-01-05 01:31:26 +03:00
|
|
|
};
|
|
|
|
|
2007-02-18 17:38:04 +03:00
|
|
|
#define NS_DECL_CYCLE_COLLECTION_CLASS(_class) \
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(_class, _class)
|
|
|
|
|
2007-03-08 14:17:16 +03:00
|
|
|
#define NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(_class, _base_class) \
|
|
|
|
class NS_CYCLE_COLLECTION_INNERCLASS \
|
|
|
|
: public NS_CYCLE_COLLECTION_CLASSNAME(_base_class) \
|
|
|
|
{ \
|
|
|
|
public: \
|
|
|
|
NS_IMETHOD Unlink(nsISupports *n); \
|
|
|
|
NS_IMETHOD Traverse(nsISupports *n, \
|
|
|
|
nsCycleCollectionTraversalCallback &cb); \
|
|
|
|
static _class* Downcast(nsISupports* s) \
|
|
|
|
{ \
|
|
|
|
return NS_STATIC_CAST(_class*, NS_STATIC_CAST(_base_class*, \
|
|
|
|
NS_CYCLE_COLLECTION_CLASSNAME(_base_class)::Downcast(s))); \
|
|
|
|
} \
|
|
|
|
};
|
|
|
|
|
|
|
|
#define NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(_class, \
|
|
|
|
_base_class) \
|
|
|
|
class NS_CYCLE_COLLECTION_INNERCLASS \
|
|
|
|
: public NS_CYCLE_COLLECTION_CLASSNAME(_base_class) \
|
|
|
|
{ \
|
|
|
|
public: \
|
|
|
|
NS_IMETHOD Traverse(nsISupports *n, \
|
|
|
|
nsCycleCollectionTraversalCallback &cb); \
|
|
|
|
static _class* Downcast(nsISupports* s) \
|
|
|
|
{ \
|
|
|
|
return NS_STATIC_CAST(_class*, NS_STATIC_CAST(_base_class*, \
|
|
|
|
NS_CYCLE_COLLECTION_CLASSNAME(_base_class)::Downcast(s))); \
|
|
|
|
} \
|
|
|
|
};
|
|
|
|
|
2007-03-16 15:52:47 +03:00
|
|
|
/**
|
|
|
|
* This implements a stub UnmarkPurple function for classes that want to be
|
|
|
|
* traversed but whose AddRef/Release functions don't add/remove them to/from
|
|
|
|
* the purple buffer. If you're just using NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
* then you don't need this.
|
|
|
|
*/
|
|
|
|
#define NS_DECL_CYCLE_COLLECTION_UNMARK_PURPLE_STUB(_class) \
|
|
|
|
void UnmarkPurple() \
|
|
|
|
{ \
|
|
|
|
} \
|
|
|
|
|
2007-01-05 01:31:26 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_CLASS(_class) \
|
|
|
|
static NS_CYCLE_COLLECTION_CLASSNAME(_class) \
|
|
|
|
NS_CYCLE_COLLECTION_NAME(_class);
|
|
|
|
|
2007-02-18 17:38:04 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_0(_class) \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_CLASS(_class) \
|
2007-02-18 17:38:04 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class) \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_END \
|
2007-02-18 17:38:04 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class) \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
|
|
|
|
2007-02-18 17:38:04 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_1(_class, _f) \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_CLASS(_class) \
|
2007-02-18 17:38:04 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class) \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(_f) \
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_END \
|
2007-02-18 17:38:04 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class) \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(_f) \
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
|
|
|
|
2007-02-18 17:38:04 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_2(_class, _f1, _f2) \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_CLASS(_class) \
|
2007-02-18 17:38:04 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class) \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(_f1) \
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(_f2) \
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_END \
|
2007-02-18 17:38:04 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class) \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(_f1) \
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(_f2) \
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
|
|
|
|
2007-02-18 17:38:04 +03:00
|
|
|
#define NS_IMPL_CYCLE_COLLECTION_3(_class, _f1, _f2, _f3) \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_CLASS(_class) \
|
2007-02-18 17:38:04 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class) \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(_f1) \
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(_f2) \
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(_f3) \
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_UNLINK_END \
|
2007-02-18 17:38:04 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class) \
|
2007-01-05 01:31:26 +03:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(_f1) \
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(_f2) \
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(_f3) \
|
|
|
|
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
|
|
|
|
|
|
|
#endif // nsCycleCollectionParticipant_h__
|