Make IsPermanent non-virtual so it can be called in the destructor. b=334605 r=mrbkap rs=brendan

This commit is contained in:
dbaron%dbaron.org 2006-04-19 21:46:47 +00:00
parent dbbb2a5e98
commit 19cdeba085
2 changed files with 10 additions and 18 deletions

View File

@ -410,6 +410,12 @@ AtomImpl::~AtomImpl()
NS_IMPL_THREADSAFE_ISUPPORTS1(AtomImpl, nsIAtom)
PermanentAtomImpl::PermanentAtomImpl()
: AtomImpl()
{
mRefCnt = REFCNT_PERMANENT_SENTINEL;
}
NS_IMETHODIMP_(nsrefcnt) PermanentAtomImpl::AddRef()
{
return 2;
@ -420,18 +426,6 @@ NS_IMETHODIMP_(nsrefcnt) PermanentAtomImpl::Release()
return 1;
}
/* virtual */ PRBool
AtomImpl::IsPermanent()
{
return PR_FALSE;
}
/* virtual */ PRBool
PermanentAtomImpl::IsPermanent()
{
return PR_TRUE;
}
void* AtomImpl::operator new ( size_t size, const nsACString& aString ) CPP_THROW_NEW
{
/*

View File

@ -59,7 +59,9 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSIATOM
virtual PRBool IsPermanent();
enum { REFCNT_PERMANENT_SENTINEL = PR_UINT32_MAX };
PRBool IsPermanent() { return mRefCnt == REFCNT_PERMANENT_SENTINEL; }
void* operator new(size_t size, const nsACString& aString) CPP_THROW_NEW;
@ -81,14 +83,10 @@ public:
class PermanentAtomImpl : public AtomImpl {
public:
#ifdef AIX
PermanentAtomImpl() : AtomImpl() {}
#endif
PermanentAtomImpl();
NS_IMETHOD_(nsrefcnt) AddRef();
NS_IMETHOD_(nsrefcnt) Release();
virtual PRBool IsPermanent();
void* operator new(size_t size, const nsACString& aString) CPP_THROW_NEW {
return AtomImpl::operator new(size, aString);
}