Bug 1034922 - Make nsSiteWindow's destructor private, and expose it to nsContentTreeOwner via friend class. r=Enn

CLOSED TREE
This commit is contained in:
Michael Layzell 2015-07-07 21:49:00 -04:00
parent 7bb9c7cdd7
commit 0d844ee3a9

View File

@ -57,25 +57,25 @@ using namespace mozilla;
class nsSiteWindow : public nsIEmbeddingSiteWindow
{
// nsSiteWindow shares a lifetime with nsContentTreeOwner, and proxies it's
// AddRef and Release calls to said object.
// When nsContentTreeOwner is destroyed, nsSiteWindow will be destroyed as well.
// nsContentTreeOwner is a friend class of nsSiteWindow such that it can call
// nsSiteWindow's destructor, which is private, as public destructors
// on reference counted classes are generally unsafe.
friend class nsContentTreeOwner;
public:
explicit nsSiteWindow(nsContentTreeOwner *aAggregator);
virtual ~nsSiteWindow();
NS_DECL_ISUPPORTS
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIEMBEDDINGSITEWINDOW
private:
virtual ~nsSiteWindow();
nsContentTreeOwner *mAggregator;
};
namespace mozilla {
template<>
struct HasDangerousPublicDestructor<nsSiteWindow>
{
static const bool value = true;
};
}
//*****************************************************************************
//*** nsContentTreeOwner: Object Management
//*****************************************************************************