Bug 229875 - eliminate unnecssary public/virtual destructors. This patch changes all refcounted classes under xpcom/, which aren't inherited from or used on the stack, to have private, nonvirtual destructors. r=dougt, sr=dbaron.

This commit is contained in:
bryner%brianryner.com 2004-01-15 06:14:18 +00:00
Родитель e95aed0fd1
Коммит bc829daafa
93 изменённых файлов: 306 добавлений и 273 удалений

Просмотреть файл

@ -53,8 +53,6 @@ nsConsoleMessage::nsConsoleMessage(const PRUnichar *message)
mMessage.Assign(message);
}
nsConsoleMessage::~nsConsoleMessage() {}
NS_IMETHODIMP
nsConsoleMessage::GetMessage(PRUnichar **result) {
*result = ToNewUnicode(mMessage);

Просмотреть файл

@ -46,12 +46,12 @@ public:
nsConsoleMessage();
nsConsoleMessage(const PRUnichar *message);
virtual ~nsConsoleMessage();
NS_DECL_ISUPPORTS
NS_DECL_NSICONSOLEMESSAGE
private:
~nsConsoleMessage() {}
nsString mMessage;
};

Просмотреть файл

@ -52,12 +52,13 @@ class nsConsoleService : public nsIConsoleService
{
public:
nsConsoleService();
virtual ~nsConsoleService();
NS_DECL_ISUPPORTS
NS_DECL_NSICONSOLESERVICE
private:
~nsConsoleService();
// build (or find) a proxy for the listener
nsresult GetProxyForListener(nsIConsoleListener* aListener,
nsIConsoleListener** aProxy);

Просмотреть файл

@ -148,10 +148,6 @@ nsDebugImpl::nsDebugImpl()
{
}
nsDebugImpl::~nsDebugImpl()
{
}
/**
* Implementation of the nsDebug methods. Note that this code is
* always compiled in, in case some other module that uses it is

Просмотреть файл

@ -43,8 +43,10 @@ public:
NS_DECL_NSIDEBUG
nsDebugImpl();
virtual ~nsDebugImpl();
static NS_METHOD Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
private:
~nsDebugImpl() {}
};

Просмотреть файл

@ -62,11 +62,13 @@ public:
NS_DECL_NSIERRORSERVICE
nsErrorService() {}
virtual ~nsErrorService() {}
static NS_METHOD
Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
private:
~nsErrorService() {}
protected:
nsInt2StrHashtable mErrorStringBundleURLMap;
nsInt2StrHashtable mErrorStringBundleKeyMap;

Просмотреть файл

@ -73,7 +73,6 @@ public:
NS_DECL_NSIEXCEPTIONMANAGER
nsExceptionManager(nsExceptionService *svc);
virtual ~nsExceptionManager();
/* additional members */
nsCOMPtr<nsIException> mCurrentException;
nsExceptionManager *mNextThread; // not ref-counted.
@ -81,6 +80,9 @@ public:
#ifdef NS_DEBUG
static PRInt32 totalInstances;
#endif
private:
~nsExceptionManager();
};

Просмотреть файл

@ -58,7 +58,6 @@ public:
NS_DECL_NSIOBSERVER
nsExceptionService();
virtual ~nsExceptionService();
/* additional members */
nsresult DoGetExceptionFromProvider(nsresult errCode,
@ -86,6 +85,9 @@ public:
#ifdef NS_DEBUG
static PRInt32 totalInstances;
#endif
private:
~nsExceptionService();
};

Просмотреть файл

@ -75,17 +75,17 @@ static FILE* openTraceFile()
class nsLeakDetector : public nsILeakDetector {
public:
nsLeakDetector();
virtual ~nsLeakDetector();
NS_DECL_ISUPPORTS
NS_DECL_NSILEAKDETECTOR
private:
~nsLeakDetector() {}
};
NS_IMPL_ISUPPORTS1(nsLeakDetector, nsILeakDetector)
nsLeakDetector::nsLeakDetector() {
}
nsLeakDetector::~nsLeakDetector() {}
NS_METHOD nsLeakDetector::DumpLeaks()
{

Просмотреть файл

@ -77,12 +77,14 @@ protected:
PRCondVar* mCVar;
MemoryFlusher(nsMemoryImpl* aMemoryImpl);
virtual ~MemoryFlusher();
enum {
kInitialTimeout = 60 /*seconds*/
};
private:
~MemoryFlusher();
public:
/**
* Create a memory flusher.

Просмотреть файл

@ -55,7 +55,6 @@ public:
NS_DECL_NSIMEMORY
nsMemoryImpl();
virtual ~nsMemoryImpl();
nsresult FlushMemory(const PRUnichar* aReason, PRBool aImmediate);
@ -66,6 +65,9 @@ public:
static NS_METHOD
Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
private:
~nsMemoryImpl();
protected:
MemoryFlusher* mFlusher;
nsCOMPtr<nsIThread> mFlusherThread;

Просмотреть файл

@ -1110,11 +1110,6 @@ nsTraceRefcntImpl::nsTraceRefcntImpl()
/* member initializers and constructor code */
}
nsTraceRefcntImpl::~nsTraceRefcntImpl()
{
/* destructor code */
}
NS_IMETHODIMP
nsTraceRefcntImpl::LogAddRef(void* aPtr,
nsrefcnt aRefcnt,

Просмотреть файл

@ -48,7 +48,6 @@ public:
NS_DECL_NSITRACEREFCNT
nsTraceRefcntImpl();
virtual ~nsTraceRefcntImpl();
static NS_COM void Startup();
static NS_COM void Shutdown();
@ -80,6 +79,9 @@ public:
static NS_COM void SetActivityIsLegal(PRBool aLegal);
static NS_METHOD Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
private:
~nsTraceRefcntImpl() {}
};
#define NS_TRACE_REFCNT_CONTRACTID "@mozilla.org/xpcom/trace-refcnt;1"

Просмотреть файл

@ -122,7 +122,7 @@ void XXXNeverCalled()
nsTraceRefcnt::LogAddCOMPtr(nsnull, nsnull);
nsTraceRefcntImpl::DumpStatistics();
NS_NewEmptyEnumerator(nsnull);
nsArrayEnumerator(nsnull);
new nsArrayEnumerator(nsnull);
NS_QuickSort(nsnull, 0, 0, nsnull, nsnull);
nsString();
nsProxyObject(nsnull, 0, nsnull);
@ -148,7 +148,7 @@ void XXXNeverCalled()
nsLinebreakConverter::eLinebreakAny, nsLinebreakConverter::eLinebreakContent);
NS_NewLocalFile(nsString(), PR_FALSE, nsnull);
NS_NewNativeLocalFile(nsCString(), PR_FALSE, nsnull);
nsProcess();
new nsProcess();
nsStaticCaseInsensitiveNameTable();
nsAutoString str1;
nsCAutoString str2;
@ -163,7 +163,7 @@ void XXXNeverCalled()
nsCOMArray<nsISupports> dummyArray;
NS_NewArray(nsnull, dummyArray);
NS_NewArrayEnumerator(nsnull, dummyArray);
nsVariant();
new nsVariant();
nsUnescape(nsnull);
nsEscape(nsnull, url_XAlphas);
nsStringArray array;

Просмотреть файл

@ -134,7 +134,6 @@ public:
// nsComponentManagerImpl methods:
nsComponentManagerImpl();
virtual ~nsComponentManagerImpl();
static nsComponentManagerImpl* gComponentManager;
nsresult Init(void);
@ -240,6 +239,8 @@ public:
nsVoidArray mPendingCIDs;
#endif
private:
~nsComponentManagerImpl();
};

Просмотреть файл

@ -67,11 +67,6 @@ nsNativeComponentLoader::nsNativeComponentLoader() :
{
}
nsNativeComponentLoader::~nsNativeComponentLoader()
{
mCompMgr = nsnull;
}
NS_IMPL_THREADSAFE_ISUPPORTS2(nsNativeComponentLoader,
nsIComponentLoader,
nsINativeComponentLoader)

Просмотреть файл

@ -38,7 +38,6 @@ class nsNativeComponentLoader : public nsIComponentLoader, public nsINativeCompo
NS_DECL_NSINATIVECOMPONENTLOADER
nsNativeComponentLoader();
virtual ~nsNativeComponentLoader();
nsIComponentManager* mCompMgr; // weak reference -- backpointer
nsHashtable mLoadedDependentLibs;
@ -47,6 +46,8 @@ class nsNativeComponentLoader : public nsIComponentLoader, public nsINativeCompo
nsObjectHashtable mDllStore;
nsVoidArray mDeferredComponents;
~nsNativeComponentLoader() {}
NS_IMETHOD RegisterComponentsInDir(PRInt32 when, nsIFile *dir);
nsresult CreateDll(nsIFile *aSpec, const char *aLocation, nsDll **aDll);

Просмотреть файл

@ -34,7 +34,8 @@ public:
mAutoRegistered(PR_FALSE), mLoadedInfo(PR_FALSE) {
}
virtual ~nsStaticComponentLoader() {
private:
~nsStaticComponentLoader() {
if (mInfoHash.ops)
PL_DHashTableFinish(&mInfoHash);
}

Просмотреть файл

@ -75,13 +75,13 @@ public:
nsArray(const nsCOMArray_base& aBaseArray) : mArray(aBaseArray)
{ }
virtual ~nsArray();
NS_DECL_ISUPPORTS
NS_DECL_NSIARRAY
NS_DECL_NSIMUTABLEARRAY
private:
~nsArray();
nsCOMArray_base mArray;
};

Просмотреть файл

@ -110,7 +110,6 @@ public:
// nsSimpleArrayEnumerator methods
nsCOMArrayEnumerator() : mIndex(0) {
}
virtual ~nsCOMArrayEnumerator(void);
// specialized operator to make sure we make room for mValues
void* operator new (size_t size, const nsCOMArray_base& aArray) CPP_THROW_NEW;
@ -118,6 +117,9 @@ public:
::operator delete(ptr);
}
private:
~nsCOMArrayEnumerator(void);
protected:
PRUint32 mIndex; // current position
PRUint32 mArraySize; // size of the array

Просмотреть файл

@ -59,7 +59,9 @@ public:
nsSimpleArrayEnumerator(nsIArray* aValueArray) :
mValueArray(aValueArray), mIndex(0) {
}
virtual ~nsSimpleArrayEnumerator(void) {}
private:
~nsSimpleArrayEnumerator() {}
protected:
nsCOMPtr<nsIArray> mValueArray;

Просмотреть файл

@ -44,10 +44,6 @@ nsAtomService::nsAtomService()
{
}
nsAtomService::~nsAtomService()
{}
nsresult
nsAtomService::GetAtom(const PRUnichar *aString, nsIAtom ** aResult)
{

Просмотреть файл

@ -45,10 +45,12 @@ class nsAtomService : public nsIAtomService
{
public:
nsAtomService();
virtual ~nsAtomService();
NS_DECL_ISUPPORTS
NS_DECL_NSIATOMSERVICE
private:
~nsAtomService() {}
};
#endif

Просмотреть файл

@ -43,7 +43,6 @@
class ByteBufferImpl : public nsIByteBuffer {
public:
ByteBufferImpl(void);
virtual ~ByteBufferImpl();
NS_DECL_ISUPPORTS
@ -61,6 +60,8 @@ public:
char* mBuffer;
PRUint32 mSpace;
PRUint32 mLength;
private:
~ByteBufferImpl();
};
#endif // nsByteBuffer_h__

Просмотреть файл

@ -54,7 +54,7 @@ EmptyEnumeratorImpl::EmptyEnumeratorImpl(void)
MOZ_COUNT_CTOR(EmptyEnumeratorImpl);
}
/* virtual */ EmptyEnumeratorImpl::~EmptyEnumeratorImpl(void)
EmptyEnumeratorImpl::~EmptyEnumeratorImpl(void)
{
MOZ_COUNT_DTOR(EmptyEnumeratorImpl);
}

Просмотреть файл

@ -50,7 +50,6 @@ class EmptyEnumeratorImpl : public nsISimpleEnumerator
{
public:
EmptyEnumeratorImpl(void);
virtual ~EmptyEnumeratorImpl(void);
// nsISupports interface
NS_DECL_ISUPPORTS_INHERITED // not really inherited, but no mRefCnt
@ -59,4 +58,7 @@ public:
NS_DECL_NSISIMPLEENUMERATOR
static void Shutdown();
private:
~EmptyEnumeratorImpl(void);
};

Просмотреть файл

@ -53,7 +53,9 @@ public:
// nsArrayEnumerator methods
nsArrayEnumerator(nsISupportsArray* aValueArray);
virtual ~nsArrayEnumerator(void);
private:
~nsArrayEnumerator(void);
protected:
nsISupportsArray* mValueArray;
@ -76,7 +78,9 @@ public:
NS_IMETHOD GetNext(nsISupports** aResult);
nsSingletonEnumerator(nsISupports* aValue);
virtual ~nsSingletonEnumerator();
private:
~nsSingletonEnumerator();
protected:
nsISupports* mValue;

Просмотреть файл

@ -51,7 +51,9 @@ public:
NS_DECL_NSISIMPLEENUMERATOR
ObserverListEnumerator(nsISupportsArray* aValueArray);
virtual ~ObserverListEnumerator(void);
private:
~ObserverListEnumerator(void);
protected:
nsISupportsArray* mValueArray;

Просмотреть файл

@ -55,7 +55,6 @@ public:
NS_DEFINE_STATIC_CID_ACCESSOR( NS_OBSERVERSERVICE_CID )
nsObserverService();
virtual ~nsObserverService(void);
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVERSERVICE
@ -64,6 +63,8 @@ public:
Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
private:
~nsObserverService(void);
nsObjectHashtable* mObserverTopicTable;
nsresult GetObserverList(const char* aTopic, nsObserverList** anObserverList);

Просмотреть файл

@ -50,7 +50,6 @@ class nsPersistentProperties : public nsIPersistentProperties
{
public:
nsPersistentProperties();
virtual ~nsPersistentProperties();
nsresult Init();
NS_DECL_ISUPPORTS
@ -66,6 +65,9 @@ public:
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
private:
~nsPersistentProperties();
protected:
nsIUnicharInputStream* mIn;
PRUint32 mBufferPos;
@ -87,14 +89,15 @@ public:
{
}
virtual ~nsPropertyElement() {}
NS_DECL_ISUPPORTS
NS_DECL_NSIPROPERTYELEMENT
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
private:
~nsPropertyElement() {}
protected:
nsCString mKey;
nsString mValue;

Просмотреть файл

@ -59,13 +59,14 @@ public:
NS_DECL_NSIPROPERTIES
nsProperties(nsISupports* outer);
virtual ~nsProperties();
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
static PRBool PR_CALLBACK ReleaseValues(nsHashKey* key, void* data, void* closure);
private:
~nsProperties();
};
#endif /* nsProperties_h___ */

Просмотреть файл

@ -202,6 +202,7 @@ public:
{
}
virtual ~nsRecyclingAllocatorImpl() {}
private:
~nsRecyclingAllocatorImpl() {}
};
#endif // nsRecyclingAllocator_h__

Просмотреть файл

@ -69,8 +69,17 @@ public:
nsStringEnumerator(const nsCStringArray* aArray, nsISupports* aOwner) :
mCArray(aArray), mIndex(0), mOwner(aOwner), mOwnsArray(PR_FALSE), mIsUnicode(PR_FALSE)
{}
virtual ~nsStringEnumerator() {
NS_DECL_ISUPPORTS
NS_DECL_NSIUTF8STRINGENUMERATOR
// have to declare nsIStringEnumerator manually, because of
// overlapping method names
NS_IMETHOD GetNext(nsAString& aResult);
NS_DECL_NSISIMPLEENUMERATOR
private:
~nsStringEnumerator() {
if (mOwnsArray) {
// const-casting is safe here, because the NS_New*
// constructors make sure mOwnsArray is consistent with
@ -82,15 +91,6 @@ public:
}
}
NS_DECL_ISUPPORTS
NS_DECL_NSIUTF8STRINGENUMERATOR
// have to declare nsIStringEnumerator manually, because of
// overlapping method names
NS_IMETHOD GetNext(nsAString& aResult);
NS_DECL_NSISIMPLEENUMERATOR
private:
union {
const nsStringArray* mArray;
const nsCStringArray* mCArray;

Просмотреть файл

@ -47,7 +47,6 @@ public:
NS_DECL_ISUPPORTS
nsSupportsArrayEnumerator(nsISupportsArray* array);
virtual ~nsSupportsArrayEnumerator();
// nsIEnumerator methods:
NS_DECL_NSIENUMERATOR
@ -55,6 +54,9 @@ public:
// nsIBidirectionalEnumerator methods:
NS_DECL_NSIBIDIRECTIONALENUMERATOR
private:
~nsSupportsArrayEnumerator();
protected:
nsISupportsArray* mArray;
PRInt32 mCursor;

Просмотреть файл

@ -54,10 +54,6 @@ nsSupportsIDImpl::nsSupportsIDImpl()
{
}
nsSupportsIDImpl::~nsSupportsIDImpl()
{
}
NS_IMETHODIMP nsSupportsIDImpl::GetType(PRUint16 *aType)
{
NS_ASSERTION(aType, "Bad pointer");
@ -191,8 +187,6 @@ nsSupportsPRBoolImpl::nsSupportsPRBoolImpl()
{
}
nsSupportsPRBoolImpl::~nsSupportsPRBoolImpl() {}
NS_IMETHODIMP nsSupportsPRBoolImpl::GetType(PRUint16 *aType)
{
NS_ASSERTION(aType, "Bad pointer");
@ -234,8 +228,6 @@ nsSupportsPRUint8Impl::nsSupportsPRUint8Impl()
{
}
nsSupportsPRUint8Impl::~nsSupportsPRUint8Impl() {}
NS_IMETHODIMP nsSupportsPRUint8Impl::GetType(PRUint16 *aType)
{
NS_ASSERTION(aType, "Bad pointer");
@ -281,8 +273,6 @@ nsSupportsPRUint16Impl::nsSupportsPRUint16Impl()
{
}
nsSupportsPRUint16Impl::~nsSupportsPRUint16Impl() {}
NS_IMETHODIMP nsSupportsPRUint16Impl::GetType(PRUint16 *aType)
{
NS_ASSERTION(aType, "Bad pointer");
@ -328,8 +318,6 @@ nsSupportsPRUint32Impl::nsSupportsPRUint32Impl()
{
}
nsSupportsPRUint32Impl::~nsSupportsPRUint32Impl() {}
NS_IMETHODIMP nsSupportsPRUint32Impl::GetType(PRUint16 *aType)
{
NS_ASSERTION(aType, "Bad pointer");
@ -375,8 +363,6 @@ nsSupportsPRUint64Impl::nsSupportsPRUint64Impl()
{
}
nsSupportsPRUint64Impl::~nsSupportsPRUint64Impl() {}
NS_IMETHODIMP nsSupportsPRUint64Impl::GetType(PRUint16 *aType)
{
NS_ASSERTION(aType, "Bad pointer");
@ -422,8 +408,6 @@ nsSupportsPRTimeImpl::nsSupportsPRTimeImpl()
{
}
nsSupportsPRTimeImpl::~nsSupportsPRTimeImpl() {}
NS_IMETHODIMP nsSupportsPRTimeImpl::GetType(PRUint16 *aType)
{
NS_ASSERTION(aType, "Bad pointer");
@ -469,8 +453,6 @@ nsSupportsCharImpl::nsSupportsCharImpl()
{
}
nsSupportsCharImpl::~nsSupportsCharImpl() {}
NS_IMETHODIMP nsSupportsCharImpl::GetType(PRUint16 *aType)
{
NS_ASSERTION(aType, "Bad pointer");
@ -516,8 +498,6 @@ nsSupportsPRInt16Impl::nsSupportsPRInt16Impl()
{
}
nsSupportsPRInt16Impl::~nsSupportsPRInt16Impl() {}
NS_IMETHODIMP nsSupportsPRInt16Impl::GetType(PRUint16 *aType)
{
NS_ASSERTION(aType, "Bad pointer");
@ -563,8 +543,6 @@ nsSupportsPRInt32Impl::nsSupportsPRInt32Impl()
{
}
nsSupportsPRInt32Impl::~nsSupportsPRInt32Impl() {}
NS_IMETHODIMP nsSupportsPRInt32Impl::GetType(PRUint16 *aType)
{
NS_ASSERTION(aType, "Bad pointer");
@ -610,8 +588,6 @@ nsSupportsPRInt64Impl::nsSupportsPRInt64Impl()
{
}
nsSupportsPRInt64Impl::~nsSupportsPRInt64Impl() {}
NS_IMETHODIMP nsSupportsPRInt64Impl::GetType(PRUint16 *aType)
{
NS_ASSERTION(aType, "Bad pointer");
@ -657,8 +633,6 @@ nsSupportsFloatImpl::nsSupportsFloatImpl()
{
}
nsSupportsFloatImpl::~nsSupportsFloatImpl() {}
NS_IMETHODIMP nsSupportsFloatImpl::GetType(PRUint16 *aType)
{
NS_ASSERTION(aType, "Bad pointer");
@ -704,8 +678,6 @@ nsSupportsDoubleImpl::nsSupportsDoubleImpl()
{
}
nsSupportsDoubleImpl::~nsSupportsDoubleImpl() {}
NS_IMETHODIMP nsSupportsDoubleImpl::GetType(PRUint16 *aType)
{
NS_ASSERTION(aType, "Bad pointer");
@ -752,8 +724,6 @@ nsSupportsVoidImpl::nsSupportsVoidImpl()
{
}
nsSupportsVoidImpl::~nsSupportsVoidImpl() {}
NS_IMETHODIMP nsSupportsVoidImpl::GetType(PRUint16 *aType)
{
NS_ASSERTION(aType, "Bad pointer");
@ -875,9 +845,6 @@ nsSupportsDependentCString::nsSupportsDependentCString(const char* aStr)
: mData(aStr)
{ }
nsSupportsDependentCString::~nsSupportsDependentCString()
{ }
NS_IMETHODIMP
nsSupportsDependentCString::GetType(PRUint16 *aType)
{

Просмотреть файл

@ -52,9 +52,10 @@ public:
NS_DECL_NSISUPPORTSID
nsSupportsIDImpl();
virtual ~nsSupportsIDImpl();
private:
~nsSupportsIDImpl() { }
nsID *mData;
};
@ -68,9 +69,9 @@ public:
NS_DECL_NSISUPPORTSCSTRING
nsSupportsCStringImpl() {}
virtual ~nsSupportsCStringImpl() {}
private:
~nsSupportsCStringImpl() {}
nsCString mData;
};
@ -85,9 +86,9 @@ public:
NS_DECL_NSISUPPORTSSTRING
nsSupportsStringImpl() {}
virtual ~nsSupportsStringImpl() {}
private:
~nsSupportsStringImpl() {}
nsString mData;
};
@ -102,9 +103,10 @@ public:
NS_DECL_NSISUPPORTSPRBOOL
nsSupportsPRBoolImpl();
virtual ~nsSupportsPRBoolImpl();
private:
~nsSupportsPRBoolImpl() {}
PRBool mData;
};
@ -118,9 +120,10 @@ public:
NS_DECL_NSISUPPORTSPRUINT8
nsSupportsPRUint8Impl();
virtual ~nsSupportsPRUint8Impl();
private:
~nsSupportsPRUint8Impl() {}
PRUint8 mData;
};
@ -134,9 +137,10 @@ public:
NS_DECL_NSISUPPORTSPRUINT16
nsSupportsPRUint16Impl();
virtual ~nsSupportsPRUint16Impl();
private:
~nsSupportsPRUint16Impl() {}
PRUint16 mData;
};
@ -150,9 +154,10 @@ public:
NS_DECL_NSISUPPORTSPRUINT32
nsSupportsPRUint32Impl();
virtual ~nsSupportsPRUint32Impl();
private:
~nsSupportsPRUint32Impl() {}
PRUint32 mData;
};
@ -166,9 +171,10 @@ public:
NS_DECL_NSISUPPORTSPRUINT64
nsSupportsPRUint64Impl();
virtual ~nsSupportsPRUint64Impl();
private:
~nsSupportsPRUint64Impl() {}
PRUint64 mData;
};
@ -182,9 +188,10 @@ public:
NS_DECL_NSISUPPORTSPRTIME
nsSupportsPRTimeImpl();
virtual ~nsSupportsPRTimeImpl();
private:
~nsSupportsPRTimeImpl() {}
PRTime mData;
};
@ -198,9 +205,10 @@ public:
NS_DECL_NSISUPPORTSCHAR
nsSupportsCharImpl();
virtual ~nsSupportsCharImpl();
private:
~nsSupportsCharImpl() {}
char mData;
};
@ -214,9 +222,10 @@ public:
NS_DECL_NSISUPPORTSPRINT16
nsSupportsPRInt16Impl();
virtual ~nsSupportsPRInt16Impl();
private:
~nsSupportsPRInt16Impl() {}
PRInt16 mData;
};
@ -230,9 +239,10 @@ public:
NS_DECL_NSISUPPORTSPRINT32
nsSupportsPRInt32Impl();
virtual ~nsSupportsPRInt32Impl();
private:
~nsSupportsPRInt32Impl() {}
PRInt32 mData;
};
@ -246,9 +256,10 @@ public:
NS_DECL_NSISUPPORTSPRINT64
nsSupportsPRInt64Impl();
virtual ~nsSupportsPRInt64Impl();
private:
~nsSupportsPRInt64Impl() {}
PRInt64 mData;
};
@ -262,9 +273,10 @@ public:
NS_DECL_NSISUPPORTSFLOAT
nsSupportsFloatImpl();
virtual ~nsSupportsFloatImpl();
private:
~nsSupportsFloatImpl() {}
float mData;
};
@ -278,9 +290,10 @@ public:
NS_DECL_NSISUPPORTSDOUBLE
nsSupportsDoubleImpl();
virtual ~nsSupportsDoubleImpl();
private:
~nsSupportsDoubleImpl() {}
double mData;
};
@ -294,9 +307,10 @@ public:
NS_DECL_NSISUPPORTSVOID
nsSupportsVoidImpl();
virtual ~nsSupportsVoidImpl();
private:
~nsSupportsVoidImpl() {}
void* mData;
};
@ -310,9 +324,10 @@ public:
NS_DECL_NSISUPPORTSINTERFACEPOINTER
nsSupportsInterfacePointerImpl();
virtual ~nsSupportsInterfacePointerImpl();
private:
~nsSupportsInterfacePointerImpl();
nsCOMPtr<nsISupports> mData;
nsID *mIID;
};
@ -333,8 +348,10 @@ public:
NS_DECL_NSISUPPORTSCSTRING
nsSupportsDependentCString(const char* aStr);
virtual ~nsSupportsDependentCString();
private:
~nsSupportsDependentCString() {}
nsDependentCString mData;
};

Просмотреть файл

@ -543,11 +543,6 @@ nsTimelineService::nsTimelineService()
/* member initializers and constructor code */
}
nsTimelineService::~nsTimelineService()
{
/* destructor code */
}
/* void mark (in string text); */
NS_IMETHODIMP nsTimelineService::Mark(const char *text)
{

Просмотреть файл

@ -56,8 +56,9 @@ public:
NS_DECL_NSITIMELINESERVICE
nsTimelineService();
virtual ~nsTimelineService();
/* additional members */
private:
~nsTimelineService() {}
};
#endif

Просмотреть файл

@ -43,7 +43,6 @@
class UnicharBufferImpl : public nsIUnicharBuffer {
public:
UnicharBufferImpl();
virtual ~UnicharBufferImpl();
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
@ -58,6 +57,9 @@ public:
PRUnichar* mBuffer;
PRUint32 mSpace;
PRUint32 mLength;
private:
~UnicharBufferImpl();
};
#endif // nsUnicharBuffer_h__

Просмотреть файл

@ -102,7 +102,6 @@ public:
NS_DECL_NSIWRITABLEVARIANT
nsVariant();
virtual ~nsVariant();
static nsresult Initialize(nsDiscriminatedUnion* data);
static nsresult Cleanup(nsDiscriminatedUnion* data);
@ -163,6 +162,9 @@ public:
static nsresult SetToEmpty(nsDiscriminatedUnion* data);
static nsresult SetToEmptyArray(nsDiscriminatedUnion* data);
private:
~nsVariant();
protected:
nsDiscriminatedUnion mData;
PRBool mWritable;

Просмотреть файл

@ -51,7 +51,6 @@ public:
NS_DEFINE_STATIC_CID_ACCESSOR(NS_GENERICFACTORY_CID);
nsGenericFactory(const nsModuleComponentInfo *info = NULL);
virtual ~nsGenericFactory();
NS_DECL_ISUPPORTS
NS_DECL_NSICLASSINFO
@ -66,6 +65,8 @@ public:
static NS_METHOD Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
private:
~nsGenericFactory();
const nsModuleComponentInfo *mInfo;
};

Просмотреть файл

@ -82,7 +82,7 @@ class NS_COM nsWeakReference : public nsIWeakReference
// nothing else to do here
}
virtual ~nsWeakReference()
~nsWeakReference()
// ...I will only be destroyed by calling |delete| myself.
{
if ( mReferent )

Просмотреть файл

@ -61,8 +61,8 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDIRECTORYSERVICEPROVIDER
protected:
virtual ~nsGREDirServiceProvider() { }
private:
~nsGREDirServiceProvider() { }
};
#endif // nsGREDirServiceProvider.h

Просмотреть файл

@ -112,10 +112,6 @@ nsAppFileLocationProvider::nsAppFileLocationProvider()
{
}
nsAppFileLocationProvider::~nsAppFileLocationProvider()
{
}
//*****************************************************************************
// nsAppFileLocationProvider::nsISupports
//*****************************************************************************

Просмотреть файл

@ -40,9 +40,10 @@ public:
NS_DECL_NSIDIRECTORYSERVICEPROVIDER
NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
protected:
virtual ~nsAppFileLocationProvider();
private:
~nsAppFileLocationProvider() {}
protected:
NS_METHOD CloneMozBinDirectory(nsILocalFile **aLocalFile);
NS_METHOD GetProductDirectory(nsILocalFile **aLocalFile);
NS_METHOD GetDefaultUserProfileRoot(nsILocalFile **aLocalFile);

Просмотреть файл

@ -32,9 +32,10 @@ class nsByteArrayInputStream : public nsIByteArrayInputStream
public:
nsByteArrayInputStream (char *buffer, PRUint32 nbytes);
virtual ~nsByteArrayInputStream ();
private:
~nsByteArrayInputStream ();
char *_buffer;
PRUint32 _nbytes;
PRUint32 _pos;

Просмотреть файл

@ -319,8 +319,7 @@ nsDirectoryService::GetCurrentProcessDirectory(nsILocalFile** aFile)
#endif
if (localFile)
delete localFile;
NS_RELEASE(localFile);
NS_ERROR("unable to get current process directory");
return NS_ERROR_FAILURE;

Просмотреть файл

@ -68,12 +68,13 @@ class nsDirectoryService : public nsIDirectoryService,
NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
nsDirectoryService();
virtual ~nsDirectoryService();
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
private:
~nsDirectoryService();
nsresult GetCurrentProcessDirectory(nsILocalFile** aFile);
static nsDirectoryService* mService;

Просмотреть файл

@ -49,9 +49,10 @@ public:
NS_DECL_NSIINPUTSTREAMTEE
nsInputStreamTee();
virtual ~nsInputStreamTee();
private:
~nsInputStreamTee() {}
nsresult TeeSegment(const char *buf, PRUint32 count);
static NS_METHOD WriteSegmentFun(nsIInputStream *, void *, const char *,
@ -68,10 +69,6 @@ nsInputStreamTee::nsInputStreamTee()
{
}
nsInputStreamTee::~nsInputStreamTee()
{
}
nsresult
nsInputStreamTee::TeeSegment(const char *buf, PRUint32 count)
{

Просмотреть файл

@ -888,9 +888,8 @@ class nsDirEnumerator : public nsISimpleEnumerator
return NS_OK;
}
virtual ~nsDirEnumerator()
{
}
private:
~nsDirEnumerator() {}
protected:
nsCOMPtr<nsILocalFileMac> mNext;
@ -966,10 +965,6 @@ nsLocalFile& nsLocalFile::operator=(const nsLocalFile& rhs)
return *this;
}
nsLocalFile::~nsLocalFile()
{
}
#pragma mark -
#pragma mark [nsISupports interface implementation]

Просмотреть файл

@ -41,7 +41,6 @@ public:
NS_DEFINE_STATIC_CID_ACCESSOR(NS_LOCAL_FILE_CID)
nsLocalFile();
virtual ~nsLocalFile();
static NS_METHOD nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
@ -62,8 +61,10 @@ public:
static void GlobalInit();
static void GlobalShutdown();
protected:
private:
~nsLocalFile() {}
protected:
void MakeDirty();
nsresult ResolveAndStat();
nsresult UpdateCachedCatInfo(PRBool forceUpdate);

Просмотреть файл

@ -223,7 +223,8 @@ class nsDirEnumerator : public nsISimpleEnumerator
return NS_OK;
}
virtual ~nsDirEnumerator()
private:
~nsDirEnumerator()
{
if (mDir)
{
@ -253,10 +254,6 @@ nsLocalFile::nsLocalFile(const nsLocalFile& other)
{
}
nsLocalFile::~nsLocalFile()
{
}
/* nsISupports interface implementation. */
NS_IMPL_THREADSAFE_ISUPPORTS2(nsLocalFile, nsILocalFile, nsIFile)

Просмотреть файл

@ -57,7 +57,6 @@ public:
NS_DEFINE_STATIC_CID_ACCESSOR(NS_LOCAL_FILE_CID)
nsLocalFile();
virtual ~nsLocalFile();
static NS_METHOD nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
@ -75,6 +74,8 @@ public:
static void GlobalShutdown();
private:
~nsLocalFile() {}
nsLocalFile(const nsLocalFile& other);
// this is the flag which indicates if I can used cached information about the file

Просмотреть файл

@ -202,7 +202,8 @@ class nsDirEnumerator : public nsISimpleEnumerator
return NS_OK;
}
virtual ~nsDirEnumerator()
private:
~nsDirEnumerator()
{
if (mIterator)
::FSCloseIterator(mIterator);

Просмотреть файл

@ -62,7 +62,6 @@ public:
NS_DEFINE_STATIC_CID_ACCESSOR(NS_LOCAL_FILE_CID)
nsLocalFile();
virtual ~nsLocalFile();
static NS_METHOD nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
@ -76,6 +75,9 @@ public:
static void GlobalInit();
static void GlobalShutdown();
private:
~nsLocalFile();
protected:
nsLocalFile(const nsLocalFile& src);

Просмотреть файл

@ -98,7 +98,6 @@ nsDirEnumeratorUnix : public nsISimpleEnumerator
{
public:
nsDirEnumeratorUnix();
virtual ~nsDirEnumeratorUnix();
// nsISupports interface
NS_DECL_ISUPPORTS
@ -108,6 +107,9 @@ nsDirEnumeratorUnix : public nsISimpleEnumerator
NS_IMETHOD Init(nsLocalFile *parent, PRBool ignored);
private:
~nsDirEnumeratorUnix();
protected:
NS_IMETHOD GetNextEntry();
@ -208,10 +210,6 @@ nsLocalFile::nsLocalFile(const nsLocalFile& other)
{
}
nsLocalFile::~nsLocalFile()
{
}
NS_IMPL_THREADSAFE_ISUPPORTS2(nsLocalFile,
nsIFile,
nsILocalFile)

Просмотреть файл

@ -70,7 +70,6 @@ public:
NS_DEFINE_STATIC_CID_ACCESSOR(NS_LOCAL_FILE_CID)
nsLocalFile();
virtual ~nsLocalFile();
static NS_METHOD nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
@ -89,6 +88,7 @@ public:
private:
nsLocalFile(const nsLocalFile& other);
~nsLocalFile() {}
protected:
struct stat mCachedStat;

Просмотреть файл

@ -406,10 +406,6 @@ nsLocalFile::nsLocalFile()
MakeDirty();
}
nsLocalFile::~nsLocalFile()
{
}
NS_METHOD
nsLocalFile::nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr)
{

Просмотреть файл

@ -50,7 +50,6 @@ public:
NS_DEFINE_STATIC_CID_ACCESSOR(NS_LOCAL_FILE_CID)
nsLocalFile();
virtual ~nsLocalFile();
static NS_METHOD nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
@ -69,6 +68,7 @@ public:
private:
nsLocalFile(const nsLocalFile& other);
~nsLocalFile() {}
// this is the flag which indicates if I can used cached information about the file
PRPackedBool mDirty;

Просмотреть файл

@ -51,7 +51,6 @@ class nsMultiplexInputStream : public nsIMultiplexInputStream,
{
public:
nsMultiplexInputStream();
virtual ~nsMultiplexInputStream();
NS_DECL_ISUPPORTS
NS_DECL_NSIINPUTSTREAM
@ -61,6 +60,8 @@ public:
static NS_METHOD Create(nsISupports *outer, REFNSIID iid, void **result);
private:
~nsMultiplexInputStream() {}
struct ReadSegmentsState {
nsIInputStream* mThisStream;
@ -91,10 +92,6 @@ nsMultiplexInputStream::nsMultiplexInputStream()
{
}
nsMultiplexInputStream::~nsMultiplexInputStream()
{
}
/* readonly attribute unsigned long count; */
NS_IMETHODIMP
nsMultiplexInputStream::GetCount(PRUint32 *aCount)

Просмотреть файл

@ -58,11 +58,13 @@ public:
// nsScriptableInputStream methods
nsScriptableInputStream() {};
virtual ~nsScriptableInputStream() {};
static NS_METHOD
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
private:
~nsScriptableInputStream() {};
nsCOMPtr<nsIInputStream> mInputStream;
};

Просмотреть файл

@ -321,17 +321,17 @@ public:
NS_ADDREF(mStorageStream);
}
virtual ~nsStorageInputStream()
{
NS_IF_RELEASE(mStorageStream);
}
NS_DECL_ISUPPORTS
NS_DECL_NSIINPUTSTREAM
NS_DECL_NSISEEKABLESTREAM
private:
~nsStorageInputStream()
{
NS_IF_RELEASE(mStorageStream);
}
protected:
NS_METHOD Seek(PRUint32 aPosition);
friend class nsStorageStream;

Просмотреть файл

@ -41,7 +41,6 @@ class nsStorageStream : public nsIStorageStream,
{
public:
nsStorageStream();
virtual ~nsStorageStream();
NS_METHOD Init(PRUint32 segmentSize, PRUint32 maxSize, nsIMemory *segmentAllocator = 0);
@ -52,6 +51,8 @@ public:
friend class nsStorageInputStream;
private:
~nsStorageStream();
nsSegmentedBuffer* mSegmentedBuffer;
PRUint32 mSegmentSize; // All segments, except possibly the last, are of this size
// Must be power-of-2

Просмотреть файл

@ -56,7 +56,8 @@ public:
{
}
virtual ~nsInputStreamReadyEvent()
private:
~nsInputStreamReadyEvent()
{
if (mCallback) {
nsresult rv;
@ -85,6 +86,7 @@ public:
}
}
public:
NS_IMETHOD OnInputStreamReady(nsIAsyncInputStream *stream)
{
mStream = stream;
@ -143,7 +145,8 @@ public:
{
}
virtual ~nsOutputStreamReadyEvent()
private:
~nsOutputStreamReadyEvent()
{
if (mCallback) {
nsresult rv;
@ -172,6 +175,7 @@ public:
}
}
public:
void Init(nsIOutputStreamCallback *callback, nsIEventTarget *target)
{
mCallback = callback;

Просмотреть файл

@ -53,7 +53,6 @@
class StringUnicharInputStream : public nsIUnicharInputStream {
public:
StringUnicharInputStream(nsString* aString);
virtual ~StringUnicharInputStream();
NS_DECL_ISUPPORTS
@ -68,6 +67,9 @@ public:
nsString* mString;
PRUint32 mPos;
PRUint32 mLen;
private:
~StringUnicharInputStream();
};
StringUnicharInputStream::StringUnicharInputStream(nsString* aString)
@ -171,7 +173,6 @@ NS_NewStringUnicharInputStream(nsIUnicharInputStream** aInstancePtrResult,
class UTF8InputStream : public nsIUnicharInputStream {
public:
UTF8InputStream();
virtual ~UTF8InputStream();
nsresult Init(nsIInputStream* aStream, PRUint32 aBufSize);
NS_DECL_ISUPPORTS
@ -184,6 +185,9 @@ public:
PRUint32 *aReadCount);
NS_IMETHOD Close();
private:
~UTF8InputStream();
protected:
PRInt32 Fill(nsresult * aErrorCode);

Просмотреть файл

@ -66,7 +66,6 @@ class nsFileSpecImpl
nsFileSpecImpl();
nsFileSpecImpl(const nsFileSpec& inSpec);
virtual ~nsFileSpecImpl();
static nsresult MakeInterface(const nsFileSpec& inSpec, nsIFileSpec** outSpec);
//----------------------
@ -77,6 +76,8 @@ class nsFileSpecImpl
nsIInputStream* mInputStream;
nsIOutputStream* mOutputStream;
private:
~nsFileSpecImpl();
}; // class nsFileSpecImpl
//========================================================================================
@ -88,7 +89,6 @@ class nsDirectoryIteratorImpl
public:
nsDirectoryIteratorImpl();
virtual ~nsDirectoryIteratorImpl();
NS_DECL_ISUPPORTS
@ -106,8 +106,10 @@ public:
static NS_METHOD Create(nsISupports* outer, const nsIID& aIID, void* *aIFileSpec);
protected:
private:
~nsDirectoryIteratorImpl();
protected:
nsDirectoryIterator* mDirectoryIterator;
}; // class nsDirectoryIteratorImpl

Просмотреть файл

@ -101,7 +101,9 @@ struct nsRegistry : public nsIRegistry {
// ctor/dtor
nsRegistry();
virtual ~nsRegistry();
private:
~nsRegistry();
protected:
HREG mReg; // Registry handle.
@ -195,8 +197,10 @@ struct nsRegistryNode : public nsIRegistryNode {
// ctor
nsRegistryNode( HREG hReg, char *name, RKEY childKey );
virtual ~nsRegistryNode();
private:
~nsRegistryNode();
protected:
HREG mReg; // Handle to registry this node is part of.
char mName[MAXREGPATHLEN]; // Buffer to hold name.
@ -220,7 +224,9 @@ struct nsRegistryValue : public nsIRegistryValue {
// ctor
nsRegistryValue( HREG hReg, RKEY key, REGENUM slot );
virtual ~nsRegistryValue();
private:
~nsRegistryValue();
protected:
nsresult getInfo(); // Get registry info.

Просмотреть файл

@ -55,11 +55,13 @@ struct nsRegistry : public nsIRegistry, nsIRegistryGetter {
// Fast registry getters
NS_DECL_NSIREGISTRYGETTER
int SetBufferSize( int bufsize ); // changes the file buffer size for this registry
// ctor/dtor
nsRegistry();
virtual ~nsRegistry();
int SetBufferSize( int bufsize ); // changes the file buffer size for this registry
private:
~nsRegistry();
protected:
HREG mReg; // Registry handle.

Просмотреть файл

@ -66,7 +66,6 @@ class NS_COM nsFileSpecImpl
nsFileSpecImpl();
nsFileSpecImpl(const nsFileSpec& inSpec);
virtual ~nsFileSpecImpl();
static nsresult MakeInterface(const nsFileSpec& inSpec, nsIFileSpec** outSpec);
//----------------------
@ -77,6 +76,8 @@ class NS_COM nsFileSpecImpl
nsIInputStream* mInputStream;
nsIOutputStream* mOutputStream;
private:
~nsFileSpecImpl();
}; // class nsFileSpecImpl
//========================================================================================
@ -88,7 +89,6 @@ class NS_COM nsDirectoryIteratorImpl
public:
nsDirectoryIteratorImpl();
virtual ~nsDirectoryIteratorImpl();
NS_DECL_ISUPPORTS
@ -106,8 +106,10 @@ public:
static NS_METHOD Create(nsISupports* outer, const nsIID& aIID, void* *aIFileSpec);
protected:
private:
~nsDirectoryIteratorImpl();
protected:
nsDirectoryIterator* mDirectoryIterator;
}; // class nsDirectoryIteratorImpl

Просмотреть файл

@ -67,7 +67,6 @@ class FileImpl
FileImpl(PRFileDesc* inDesc);
FileImpl(const nsFileSpec& inFile, int nsprMode, PRIntn accessMode);
virtual ~FileImpl();
// nsISupports interface
NS_DECL_ISUPPORTS
@ -93,6 +92,10 @@ class FileImpl
NS_IMETHOD GetAtEOF(PRBool* outAtEOF);
NS_IMETHOD SetAtEOF(PRBool inAtEOF);
private:
~FileImpl();
protected:
enum {
@ -706,18 +709,16 @@ NS_COM nsresult NS_NewIOFileStream(
FileImpl* stream = new FileImpl(inFile, nsprMode, accessMode);
if (! stream)
return NS_ERROR_OUT_OF_MEMORY;
else
{
PRBool isOpened = PR_FALSE;
stream->GetIsOpen(&isOpened);
if (!isOpened)
{
delete stream;
return NS_ERROR_FAILURE;
}
}
NS_ADDREF(stream);
PRBool isOpened = PR_FALSE;
stream->GetIsOpen(&isOpened);
if (!isOpened)
{
NS_RELEASE(stream);
return NS_ERROR_FAILURE;
}
*aResult = (nsISupports*)(void*)stream;
return NS_OK;
}

Просмотреть файл

@ -89,9 +89,10 @@ public:
protected:
nsProxyEventClass();
nsProxyEventClass(REFNSIID aIID, nsIInterfaceInfo* aInfo);
virtual ~nsProxyEventClass();
private:
~nsProxyEventClass();
nsIID mIID;
nsCOMPtr<nsIInterfaceInfo> mInfo;
uint32* mDescriptors;
@ -135,14 +136,15 @@ public:
nsProxyEventClass* aClass,
nsProxyEventObject* root);
virtual ~nsProxyEventObject();
nsProxyEventObject* LockedFind(REFNSIID aIID);
#ifdef DEBUG_xpcom_proxy
void DebugDump(const char * message, PRUint32 hashKey);
#endif
private:
~nsProxyEventObject();
protected:
void LockedRemoveProxy();
@ -175,7 +177,6 @@ public:
static NS_METHOD Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
nsProxyObjectManager();
virtual ~nsProxyObjectManager();
static nsProxyObjectManager *GetInstance();
static PRBool IsManagerShutdown();
@ -188,6 +189,8 @@ public:
PRMonitor* GetMonitor() const { return mProxyCreationMonitor; }
private:
~nsProxyObjectManager();
static nsProxyObjectManager* mInstance;
nsHashtable mProxyObjectMap;
nsHashtable mProxyClassMap;

Просмотреть файл

@ -74,18 +74,12 @@ class nsProxyCreateInstance : public nsIProxyCreateInstance
NS_IMETHOD CreateInstanceByIID(const nsIID & cid, nsISupports *aOuter, const nsIID & iid, void * *result);
NS_IMETHOD CreateInstanceByContractID(const char *aContractID, nsISupports *aOuter, const nsIID & iid, void * *result);
nsProxyCreateInstance();
virtual ~nsProxyCreateInstance();
nsProxyCreateInstance() {}
private:
~nsProxyCreateInstance() {}
};
nsProxyCreateInstance::nsProxyCreateInstance()
{
}
nsProxyCreateInstance::~nsProxyCreateInstance()
{
}
NS_IMPL_ISUPPORTS1(nsProxyCreateInstance, nsIProxyCreateInstance)
NS_IMETHODIMP nsProxyCreateInstance::CreateInstanceByIID(const nsIID & cid, nsISupports *aOuter, const nsIID & iid, void * *result)

Просмотреть файл

@ -1958,12 +1958,13 @@ public:
NS_DECL_NSISIMPLEENUMERATOR
xptiAdditionalManagersEnumerator();
virtual ~xptiAdditionalManagersEnumerator() {}
PRBool SizeTo(PRUint32 likelyCount) {return mArray.SizeTo(likelyCount);}
PRBool AppendElement(nsIInterfaceInfoManager* element);
private:
~xptiAdditionalManagersEnumerator() {}
nsSupportsArray mArray;
PRUint32 mIndex;
PRUint32 mCount;

Просмотреть файл

@ -721,8 +721,6 @@ public:
public:
xptiInterfaceInfo(xptiInterfaceEntry* entry);
virtual ~xptiInterfaceInfo() ;
void Invalidate()
{NS_IF_RELEASE(mParent); mEntry = nsnull;}
@ -732,6 +730,8 @@ public:
private:
~xptiInterfaceInfo();
// Note that mParent might still end up as nsnull if we don't have one.
PRBool EnsureParent(xptiWorkingSet* aWorkingSet = nsnull)
{
@ -788,12 +788,13 @@ public:
xptiWorkingSet* aWorkingSet) :
mManager(aMgr),
mWorkingSet(aWorkingSet) {}
virtual ~xptiZipLoaderSink() {};
NS_DECL_ISUPPORTS
NS_DECL_NSIXPTLOADERSINK
private:
~xptiZipLoaderSink() {}
xptiInterfaceInfoManager* mManager;
xptiWorkingSet* mWorkingSet;
@ -871,7 +872,6 @@ class xptiInterfaceInfoManager
xptiWorkingSet* aWorkingSet);
public:
virtual ~xptiInterfaceInfoManager();
static xptiInterfaceInfoManager* GetInterfaceInfoManagerNoAddRef();
static void FreeInterfaceInfoManager();
@ -907,6 +907,7 @@ public:
static void WriteToLog(const char *fmt, ...);
private:
~xptiInterfaceInfoManager();
xptiInterfaceInfoManager(); // not implmented
xptiInterfaceInfoManager(nsISupportsArray* aSearchPath);

Просмотреть файл

@ -64,7 +64,6 @@ class nsSampleImpl : public nsISample
{
public:
nsSampleImpl();
virtual ~nsSampleImpl();
/**
* This macro expands into a declaration of the nsISupports interface.
@ -124,5 +123,7 @@ public:
/* NS_IMETHOD Poke(const char* aValue); */
private:
~nsSampleImpl();
char* mValue;
};

Просмотреть файл

@ -60,7 +60,6 @@ class Foo : public IFoo {
public:
Foo(PRInt32 aID);
virtual ~Foo();
// nsISupports implementation
NS_DECL_ISUPPORTS
@ -69,8 +68,12 @@ public:
NS_IMETHOD_(nsrefcnt) RefCnt() { return mRefCnt; }
NS_IMETHOD_(PRInt32) ID() { return mID; }
PRInt32 mID;
static PRInt32 gCount;
PRInt32 mID;
private:
~Foo();
};
PRInt32 Foo::gCount;

Просмотреть файл

@ -229,7 +229,6 @@ class IFoo : public nsISupports
public:
IFoo();
virtual ~IFoo();
NS_IMETHOD_(nsrefcnt) AddRef();
NS_IMETHOD_(nsrefcnt) Release();
@ -241,6 +240,8 @@ class IFoo : public nsISupports
static void print_totals();
private:
~IFoo();
unsigned int refcount_;
static unsigned int total_constructions_;

Просмотреть файл

@ -71,10 +71,13 @@ public:
TestObserver( const nsAString &name )
: mName( name ) {
}
virtual ~TestObserver() {}
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
nsString mName;
private:
~TestObserver() {}
};
NS_IMPL_ISUPPORTS2( TestObserver, nsIObserver, nsISupportsWeakReference )

Просмотреть файл

@ -111,12 +111,13 @@ public:
NS_ADDREF(in);
}
virtual ~nsReceiver() {
PRUint32 GetBytesRead() { return mCount; }
private:
~nsReceiver() {
NS_RELEASE(mIn);
}
PRUint32 GetBytesRead() { return mCount; }
protected:
nsIInputStream* mIn;
PRUint32 mCount;
@ -207,10 +208,6 @@ public:
NS_ADDREF(in);
}
virtual ~nsShortReader() {
NS_RELEASE(mIn);
}
void Received(PRUint32 count) {
nsAutoCMonitor mon(this);
mReceived += count;
@ -229,6 +226,11 @@ public:
return result;
}
private:
~nsShortReader() {
NS_RELEASE(mIn);
}
protected:
nsIInputStream* mIn;
PRUint32 mReceived;
@ -312,7 +314,9 @@ public:
}
nsPipeObserver() { }
virtual ~nsPipeObserver() {}
private:
~nsPipeObserver() {}
};
NS_IMPL_ISUPPORTS2(nsPipeObserver, nsIInputStreamObserver, nsIOutputStreamObserver)
@ -435,8 +439,8 @@ public:
: mIn(in), mOut(out), mCount(0) {
}
virtual ~nsPump() {
}
private:
~nsPump() {}
protected:
nsCOMPtr<nsIInputStream> mIn;

Просмотреть файл

@ -149,12 +149,13 @@ public:
PR_AtomicIncrement(&gNum);
}
virtual ~nsStressRunner() {
static PRInt32 GetGlobalCount() {return gNum;}
private:
~nsStressRunner() {
NS_ASSERTION(mWasRun, "never run!");
}
static PRInt32 GetGlobalCount() {return gNum;}
protected:
static PRInt32 gNum;
PRInt32 mNum;

Просмотреть файл

@ -50,10 +50,10 @@ public:
Doit(void);
MyService();
virtual ~MyService();
NS_DECL_ISUPPORTS
private:
~MyService();
};
////////////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -67,14 +67,16 @@ class nsTestCom: public nsITestCom {
public:
nsTestCom() {
}
virtual ~nsTestCom() {
cout << "nsTestCom instance successfully deleted\n";
}
NS_IMETHOD Test() {
cout << "Accessed nsITestCom::Test() from COM\n";
return NS_OK;
}
private:
~nsTestCom() {
cout << "nsTestCom instance successfully deleted\n";
}
};
NS_IMPL_QUERY_INTERFACE1(nsTestCom, nsITestCom)

Просмотреть файл

@ -57,7 +57,6 @@ class TimerThread : public nsSupportsWeakReference,
{
public:
TimerThread();
virtual ~TimerThread();
NS_DECL_ISUPPORTS
NS_DECL_NSIRUNNABLE
@ -83,6 +82,8 @@ public:
void DoAfterSleep();
private:
~TimerThread();
// These two internal helper methods must be called while mLock is held.
// AddTimerInternal returns the position where the timer was added in the
// list, or -1 if it failed.

Просмотреть файл

@ -52,7 +52,7 @@
mLock = PR_NewLock();
}
virtual ~Foo(void) {
~Foo(void) {
PR_DestroyLock(mLock);
}

Просмотреть файл

@ -45,7 +45,6 @@ class nsEventQueueImpl : public nsIEventQueue,
{
public:
nsEventQueueImpl();
virtual ~nsEventQueueImpl();
NS_DECL_ISUPPORTS
NS_DECL_NSIEVENTTARGET
@ -67,6 +66,8 @@ public:
NS_IMETHOD GetElder(nsIEventQueue **aQueue);
private:
~nsEventQueueImpl();
PLEventQueue *mEventQueue;
PRBool mAcceptingEvents, // accept new events or pass them on?
mCouldHaveEvents; // accepting new ones, or still have old ones?

Просмотреть файл

@ -49,7 +49,6 @@ class nsEventQueueServiceImpl : public nsIEventQueueService
{
public:
nsEventQueueServiceImpl();
virtual ~nsEventQueueServiceImpl();
nsresult Init();
@ -60,6 +59,8 @@ public:
NS_DECL_NSIEVENTQUEUESERVICE
private:
~nsEventQueueServiceImpl();
/* Create a queue for the given thread if one does not exist.
Addref the descriptor in any case. parameter aNative is
ignored if the queue already exists. */

Просмотреть файл

@ -42,9 +42,10 @@ public:
NS_DECL_NSIPROCESS
nsProcess();
virtual ~nsProcess();
private:
~nsProcess() {}
nsCOMPtr<nsIFile> mExecutable;
PRInt32 mExitValue;
nsCString mTargetPath;

Просмотреть файл

@ -59,10 +59,6 @@ nsProcess::nsProcess():mExitValue(-1),
{
}
nsProcess::~nsProcess()
{
}
NS_IMETHODIMP
nsProcess::Init(nsIFile* executable)
{

Просмотреть файл

@ -59,10 +59,6 @@ nsProcess::nsProcess()
{
}
nsProcess::~nsProcess()
{
}
NS_IMETHODIMP
nsProcess::Init(nsIFile* executable)
{

Просмотреть файл

@ -47,7 +47,6 @@ public:
// nsThread methods:
nsThread();
virtual ~nsThread();
nsresult RegisterThreadSelf();
void SetPRThread(PRThread* thread) { mThread = thread; }
@ -62,6 +61,9 @@ public:
static NS_METHOD
Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
private:
~nsThread();
protected:
PRThread* mThread;
nsCOMPtr<nsIRunnable> mRunnable;

Просмотреть файл

@ -85,7 +85,6 @@ class nsTimerImpl : public nsITimer, public nsITimerInternal
public:
nsTimerImpl();
virtual ~nsTimerImpl();
static void Shutdown();
@ -102,6 +101,8 @@ public:
PRInt32 GetGeneration() { return mGeneration; }
private:
~nsTimerImpl();
nsresult InitCommon(PRUint32 aType, PRUint32 aDelay);
void ReleaseCallback()
@ -172,13 +173,14 @@ class nsTimerManager : nsITimerManager
{
public:
nsTimerManager();
virtual ~nsTimerManager();
NS_DECL_ISUPPORTS
NS_DECL_NSITIMERMANAGER
nsresult AddIdleTimer(nsITimer* timer);
private:
~nsTimerManager();
PRLock *mLock;
nsVoidArray mIdleTimers;
};

Просмотреть файл

@ -65,10 +65,12 @@ class DirectoryServiceProvider : public nsIDirectoryServiceProvider
{
public:
DirectoryServiceProvider() {}
virtual ~DirectoryServiceProvider() {};
NS_DECL_ISUPPORTS
NS_DECL_NSIDIRECTORYSERVICEPROVIDER
private:
~DirectoryServiceProvider() {}
};
NS_IMPL_ISUPPORTS1(DirectoryServiceProvider, nsIDirectoryServiceProvider)

Просмотреть файл

@ -507,8 +507,12 @@ interface(TreeState *state)
fputs("\n", state->file);
write_indent(state->file);
fprintf(state->file, "%s();\n", classNameImpl);
fputs("\n"
"private:\n", state->file);
write_indent(state->file);
fprintf(state->file, "virtual ~%s();\n", classNameImpl);
fprintf(state->file, "~%s();\n", classNameImpl);
fputs("\n"
"protected:\n", state->file);
write_indent(state->file);
fputs("/* additional members */\n", state->file);
fputs("};\n\n", state->file);