diff --git a/mozilla/xpcom/base/nsConsoleMessage.cpp b/mozilla/xpcom/base/nsConsoleMessage.cpp index 095f462c46e..0d8f8a535d3 100644 --- a/mozilla/xpcom/base/nsConsoleMessage.cpp +++ b/mozilla/xpcom/base/nsConsoleMessage.cpp @@ -53,8 +53,6 @@ nsConsoleMessage::nsConsoleMessage(const PRUnichar *message) mMessage.Assign(message); } -nsConsoleMessage::~nsConsoleMessage() {} - NS_IMETHODIMP nsConsoleMessage::GetMessage(PRUnichar **result) { *result = ToNewUnicode(mMessage); diff --git a/mozilla/xpcom/base/nsConsoleMessage.h b/mozilla/xpcom/base/nsConsoleMessage.h index ae8e3c697d0..4ded7940634 100644 --- a/mozilla/xpcom/base/nsConsoleMessage.h +++ b/mozilla/xpcom/base/nsConsoleMessage.h @@ -46,12 +46,12 @@ public: nsConsoleMessage(); nsConsoleMessage(const PRUnichar *message); - virtual ~nsConsoleMessage(); - NS_DECL_ISUPPORTS NS_DECL_NSICONSOLEMESSAGE private: + ~nsConsoleMessage() {} + nsString mMessage; }; diff --git a/mozilla/xpcom/base/nsConsoleService.h b/mozilla/xpcom/base/nsConsoleService.h index 48377ce97cc..c4ccd42501c 100644 --- a/mozilla/xpcom/base/nsConsoleService.h +++ b/mozilla/xpcom/base/nsConsoleService.h @@ -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); diff --git a/mozilla/xpcom/base/nsDebugImpl.cpp b/mozilla/xpcom/base/nsDebugImpl.cpp index 055d195183a..9a40b745419 100644 --- a/mozilla/xpcom/base/nsDebugImpl.cpp +++ b/mozilla/xpcom/base/nsDebugImpl.cpp @@ -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 diff --git a/mozilla/xpcom/base/nsDebugImpl.h b/mozilla/xpcom/base/nsDebugImpl.h index 056183b9a18..b6ca9770f5b 100644 --- a/mozilla/xpcom/base/nsDebugImpl.h +++ b/mozilla/xpcom/base/nsDebugImpl.h @@ -43,8 +43,10 @@ public: NS_DECL_NSIDEBUG nsDebugImpl(); - virtual ~nsDebugImpl(); static NS_METHOD Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr); + +private: + ~nsDebugImpl() {} }; diff --git a/mozilla/xpcom/base/nsErrorService.h b/mozilla/xpcom/base/nsErrorService.h index 20b0d427ddd..e36c9ecd809 100644 --- a/mozilla/xpcom/base/nsErrorService.h +++ b/mozilla/xpcom/base/nsErrorService.h @@ -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; diff --git a/mozilla/xpcom/base/nsExceptionService.cpp b/mozilla/xpcom/base/nsExceptionService.cpp index e5e8e4fa1c2..302f78a2ecc 100644 --- a/mozilla/xpcom/base/nsExceptionService.cpp +++ b/mozilla/xpcom/base/nsExceptionService.cpp @@ -73,7 +73,6 @@ public: NS_DECL_NSIEXCEPTIONMANAGER nsExceptionManager(nsExceptionService *svc); - virtual ~nsExceptionManager(); /* additional members */ nsCOMPtr mCurrentException; nsExceptionManager *mNextThread; // not ref-counted. @@ -81,6 +80,9 @@ public: #ifdef NS_DEBUG static PRInt32 totalInstances; #endif + +private: + ~nsExceptionManager(); }; diff --git a/mozilla/xpcom/base/nsExceptionService.h b/mozilla/xpcom/base/nsExceptionService.h index 102e4d0eaf2..cbbf264065a 100644 --- a/mozilla/xpcom/base/nsExceptionService.h +++ b/mozilla/xpcom/base/nsExceptionService.h @@ -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(); }; diff --git a/mozilla/xpcom/base/nsLeakDetector.cpp b/mozilla/xpcom/base/nsLeakDetector.cpp index ccb6d9d3400..4acf9268fee 100644 --- a/mozilla/xpcom/base/nsLeakDetector.cpp +++ b/mozilla/xpcom/base/nsLeakDetector.cpp @@ -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() { diff --git a/mozilla/xpcom/base/nsMemoryImpl.cpp b/mozilla/xpcom/base/nsMemoryImpl.cpp index 33b665e632d..2f6e6706cff 100644 --- a/mozilla/xpcom/base/nsMemoryImpl.cpp +++ b/mozilla/xpcom/base/nsMemoryImpl.cpp @@ -77,12 +77,14 @@ protected: PRCondVar* mCVar; MemoryFlusher(nsMemoryImpl* aMemoryImpl); - virtual ~MemoryFlusher(); enum { kInitialTimeout = 60 /*seconds*/ }; +private: + ~MemoryFlusher(); + public: /** * Create a memory flusher. diff --git a/mozilla/xpcom/base/nsMemoryImpl.h b/mozilla/xpcom/base/nsMemoryImpl.h index f1625734f1b..82de355e870 100644 --- a/mozilla/xpcom/base/nsMemoryImpl.h +++ b/mozilla/xpcom/base/nsMemoryImpl.h @@ -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 mFlusherThread; diff --git a/mozilla/xpcom/base/nsTraceRefcntImpl.cpp b/mozilla/xpcom/base/nsTraceRefcntImpl.cpp index 02f3495e462..0a4bd07c688 100644 --- a/mozilla/xpcom/base/nsTraceRefcntImpl.cpp +++ b/mozilla/xpcom/base/nsTraceRefcntImpl.cpp @@ -1110,11 +1110,6 @@ nsTraceRefcntImpl::nsTraceRefcntImpl() /* member initializers and constructor code */ } -nsTraceRefcntImpl::~nsTraceRefcntImpl() -{ - /* destructor code */ -} - NS_IMETHODIMP nsTraceRefcntImpl::LogAddRef(void* aPtr, nsrefcnt aRefcnt, diff --git a/mozilla/xpcom/base/nsTraceRefcntImpl.h b/mozilla/xpcom/base/nsTraceRefcntImpl.h index f0a4cf821a1..d7ebfa1f174 100644 --- a/mozilla/xpcom/base/nsTraceRefcntImpl.h +++ b/mozilla/xpcom/base/nsTraceRefcntImpl.h @@ -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" diff --git a/mozilla/xpcom/build/dlldeps.cpp b/mozilla/xpcom/build/dlldeps.cpp index bec8dc26cf3..8640212b059 100644 --- a/mozilla/xpcom/build/dlldeps.cpp +++ b/mozilla/xpcom/build/dlldeps.cpp @@ -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 dummyArray; NS_NewArray(nsnull, dummyArray); NS_NewArrayEnumerator(nsnull, dummyArray); - nsVariant(); + new nsVariant(); nsUnescape(nsnull); nsEscape(nsnull, url_XAlphas); nsStringArray array; diff --git a/mozilla/xpcom/components/nsComponentManager.h b/mozilla/xpcom/components/nsComponentManager.h index 44b7f2bf556..7db4f43b901 100644 --- a/mozilla/xpcom/components/nsComponentManager.h +++ b/mozilla/xpcom/components/nsComponentManager.h @@ -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(); }; diff --git a/mozilla/xpcom/components/nsNativeComponentLoader.cpp b/mozilla/xpcom/components/nsNativeComponentLoader.cpp index 53c7aecea17..0d683317446 100644 --- a/mozilla/xpcom/components/nsNativeComponentLoader.cpp +++ b/mozilla/xpcom/components/nsNativeComponentLoader.cpp @@ -67,11 +67,6 @@ nsNativeComponentLoader::nsNativeComponentLoader() : { } -nsNativeComponentLoader::~nsNativeComponentLoader() -{ - mCompMgr = nsnull; -} - NS_IMPL_THREADSAFE_ISUPPORTS2(nsNativeComponentLoader, nsIComponentLoader, nsINativeComponentLoader) diff --git a/mozilla/xpcom/components/nsNativeComponentLoader.h b/mozilla/xpcom/components/nsNativeComponentLoader.h index c33de4cbc99..c46d85b6669 100644 --- a/mozilla/xpcom/components/nsNativeComponentLoader.h +++ b/mozilla/xpcom/components/nsNativeComponentLoader.h @@ -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); diff --git a/mozilla/xpcom/components/nsStaticComponentLoader.cpp b/mozilla/xpcom/components/nsStaticComponentLoader.cpp index c4d02196138..d2c1502e602 100644 --- a/mozilla/xpcom/components/nsStaticComponentLoader.cpp +++ b/mozilla/xpcom/components/nsStaticComponentLoader.cpp @@ -34,7 +34,8 @@ public: mAutoRegistered(PR_FALSE), mLoadedInfo(PR_FALSE) { } - virtual ~nsStaticComponentLoader() { +private: + ~nsStaticComponentLoader() { if (mInfoHash.ops) PL_DHashTableFinish(&mInfoHash); } diff --git a/mozilla/xpcom/ds/nsArray.h b/mozilla/xpcom/ds/nsArray.h index 6aa220cba83..135ad9e7237 100644 --- a/mozilla/xpcom/ds/nsArray.h +++ b/mozilla/xpcom/ds/nsArray.h @@ -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; }; diff --git a/mozilla/xpcom/ds/nsArrayEnumerator.cpp b/mozilla/xpcom/ds/nsArrayEnumerator.cpp index 8443794236c..c105622a7a0 100644 --- a/mozilla/xpcom/ds/nsArrayEnumerator.cpp +++ b/mozilla/xpcom/ds/nsArrayEnumerator.cpp @@ -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 diff --git a/mozilla/xpcom/ds/nsArrayEnumerator.h b/mozilla/xpcom/ds/nsArrayEnumerator.h index da44b84c5b8..e22302b5056 100644 --- a/mozilla/xpcom/ds/nsArrayEnumerator.h +++ b/mozilla/xpcom/ds/nsArrayEnumerator.h @@ -59,7 +59,9 @@ public: nsSimpleArrayEnumerator(nsIArray* aValueArray) : mValueArray(aValueArray), mIndex(0) { } - virtual ~nsSimpleArrayEnumerator(void) {} + +private: + ~nsSimpleArrayEnumerator() {} protected: nsCOMPtr mValueArray; diff --git a/mozilla/xpcom/ds/nsAtomService.cpp b/mozilla/xpcom/ds/nsAtomService.cpp index 180c448ac90..7a3d53b8039 100644 --- a/mozilla/xpcom/ds/nsAtomService.cpp +++ b/mozilla/xpcom/ds/nsAtomService.cpp @@ -44,10 +44,6 @@ nsAtomService::nsAtomService() { } -nsAtomService::~nsAtomService() -{} - - nsresult nsAtomService::GetAtom(const PRUnichar *aString, nsIAtom ** aResult) { diff --git a/mozilla/xpcom/ds/nsAtomService.h b/mozilla/xpcom/ds/nsAtomService.h index c039c6a981c..213fdc43ccd 100644 --- a/mozilla/xpcom/ds/nsAtomService.h +++ b/mozilla/xpcom/ds/nsAtomService.h @@ -45,10 +45,12 @@ class nsAtomService : public nsIAtomService { public: nsAtomService(); - virtual ~nsAtomService(); NS_DECL_ISUPPORTS NS_DECL_NSIATOMSERVICE + + private: + ~nsAtomService() {} }; #endif diff --git a/mozilla/xpcom/ds/nsByteBuffer.h b/mozilla/xpcom/ds/nsByteBuffer.h index 0eaaba29e32..b8c18614e31 100644 --- a/mozilla/xpcom/ds/nsByteBuffer.h +++ b/mozilla/xpcom/ds/nsByteBuffer.h @@ -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__ diff --git a/mozilla/xpcom/ds/nsEmptyEnumerator.cpp b/mozilla/xpcom/ds/nsEmptyEnumerator.cpp index e3a2e3ca302..497d2a3e202 100644 --- a/mozilla/xpcom/ds/nsEmptyEnumerator.cpp +++ b/mozilla/xpcom/ds/nsEmptyEnumerator.cpp @@ -54,7 +54,7 @@ EmptyEnumeratorImpl::EmptyEnumeratorImpl(void) MOZ_COUNT_CTOR(EmptyEnumeratorImpl); } -/* virtual */ EmptyEnumeratorImpl::~EmptyEnumeratorImpl(void) +EmptyEnumeratorImpl::~EmptyEnumeratorImpl(void) { MOZ_COUNT_DTOR(EmptyEnumeratorImpl); } diff --git a/mozilla/xpcom/ds/nsEmptyEnumerator.h b/mozilla/xpcom/ds/nsEmptyEnumerator.h index 9dfcb29dc8d..8f1543f73fc 100644 --- a/mozilla/xpcom/ds/nsEmptyEnumerator.h +++ b/mozilla/xpcom/ds/nsEmptyEnumerator.h @@ -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); }; diff --git a/mozilla/xpcom/ds/nsEnumeratorUtils.h b/mozilla/xpcom/ds/nsEnumeratorUtils.h index 03ee86c5cc7..095656fca45 100644 --- a/mozilla/xpcom/ds/nsEnumeratorUtils.h +++ b/mozilla/xpcom/ds/nsEnumeratorUtils.h @@ -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; diff --git a/mozilla/xpcom/ds/nsObserverList.h b/mozilla/xpcom/ds/nsObserverList.h index 755c79e8bdc..2b627726e45 100644 --- a/mozilla/xpcom/ds/nsObserverList.h +++ b/mozilla/xpcom/ds/nsObserverList.h @@ -51,7 +51,9 @@ public: NS_DECL_NSISIMPLEENUMERATOR ObserverListEnumerator(nsISupportsArray* aValueArray); - virtual ~ObserverListEnumerator(void); + +private: + ~ObserverListEnumerator(void); protected: nsISupportsArray* mValueArray; diff --git a/mozilla/xpcom/ds/nsObserverService.h b/mozilla/xpcom/ds/nsObserverService.h index 43409f8bced..9e9ecb29407 100644 --- a/mozilla/xpcom/ds/nsObserverService.h +++ b/mozilla/xpcom/ds/nsObserverService.h @@ -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); diff --git a/mozilla/xpcom/ds/nsPersistentProperties.h b/mozilla/xpcom/ds/nsPersistentProperties.h index 0dbeb9f4ad3..72b2b2e4dfe 100644 --- a/mozilla/xpcom/ds/nsPersistentProperties.h +++ b/mozilla/xpcom/ds/nsPersistentProperties.h @@ -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; diff --git a/mozilla/xpcom/ds/nsProperties.h b/mozilla/xpcom/ds/nsProperties.h index 969412c2c1e..ec87436b8d5 100644 --- a/mozilla/xpcom/ds/nsProperties.h +++ b/mozilla/xpcom/ds/nsProperties.h @@ -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___ */ diff --git a/mozilla/xpcom/ds/nsRecyclingAllocator.h b/mozilla/xpcom/ds/nsRecyclingAllocator.h index a7becbe838f..4266b1b8012 100644 --- a/mozilla/xpcom/ds/nsRecyclingAllocator.h +++ b/mozilla/xpcom/ds/nsRecyclingAllocator.h @@ -202,6 +202,7 @@ public: { } - virtual ~nsRecyclingAllocatorImpl() {} +private: + ~nsRecyclingAllocatorImpl() {} }; #endif // nsRecyclingAllocator_h__ diff --git a/mozilla/xpcom/ds/nsStringEnumerator.cpp b/mozilla/xpcom/ds/nsStringEnumerator.cpp index ecf95965d20..8a10b18cca7 100644 --- a/mozilla/xpcom/ds/nsStringEnumerator.cpp +++ b/mozilla/xpcom/ds/nsStringEnumerator.cpp @@ -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; diff --git a/mozilla/xpcom/ds/nsSupportsArrayEnumerator.h b/mozilla/xpcom/ds/nsSupportsArrayEnumerator.h index 18293740e0e..ef9e80f0be8 100644 --- a/mozilla/xpcom/ds/nsSupportsArrayEnumerator.h +++ b/mozilla/xpcom/ds/nsSupportsArrayEnumerator.h @@ -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; diff --git a/mozilla/xpcom/ds/nsSupportsPrimitives.cpp b/mozilla/xpcom/ds/nsSupportsPrimitives.cpp index 0cef986a6ad..df0fa208e8d 100644 --- a/mozilla/xpcom/ds/nsSupportsPrimitives.cpp +++ b/mozilla/xpcom/ds/nsSupportsPrimitives.cpp @@ -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) { diff --git a/mozilla/xpcom/ds/nsSupportsPrimitives.h b/mozilla/xpcom/ds/nsSupportsPrimitives.h index 34a54f7245f..885c52c5964 100644 --- a/mozilla/xpcom/ds/nsSupportsPrimitives.h +++ b/mozilla/xpcom/ds/nsSupportsPrimitives.h @@ -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 mData; nsID *mIID; }; @@ -333,8 +348,10 @@ public: NS_DECL_NSISUPPORTSCSTRING nsSupportsDependentCString(const char* aStr); - virtual ~nsSupportsDependentCString(); + private: + ~nsSupportsDependentCString() {} + nsDependentCString mData; }; diff --git a/mozilla/xpcom/ds/nsTimelineService.cpp b/mozilla/xpcom/ds/nsTimelineService.cpp index 8b0b9d9cb1b..09d4841d475 100644 --- a/mozilla/xpcom/ds/nsTimelineService.cpp +++ b/mozilla/xpcom/ds/nsTimelineService.cpp @@ -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) { diff --git a/mozilla/xpcom/ds/nsTimelineService.h b/mozilla/xpcom/ds/nsTimelineService.h index e0161c364a4..7d6241bfcd4 100644 --- a/mozilla/xpcom/ds/nsTimelineService.h +++ b/mozilla/xpcom/ds/nsTimelineService.h @@ -56,8 +56,9 @@ public: NS_DECL_NSITIMELINESERVICE nsTimelineService(); - virtual ~nsTimelineService(); - /* additional members */ + +private: + ~nsTimelineService() {} }; #endif diff --git a/mozilla/xpcom/ds/nsUnicharBuffer.h b/mozilla/xpcom/ds/nsUnicharBuffer.h index 413ba46543d..08b273e1555 100644 --- a/mozilla/xpcom/ds/nsUnicharBuffer.h +++ b/mozilla/xpcom/ds/nsUnicharBuffer.h @@ -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__ diff --git a/mozilla/xpcom/ds/nsVariant.h b/mozilla/xpcom/ds/nsVariant.h index 717a762f217..92d3ee2fc99 100644 --- a/mozilla/xpcom/ds/nsVariant.h +++ b/mozilla/xpcom/ds/nsVariant.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; diff --git a/mozilla/xpcom/glue/nsGenericFactory.h b/mozilla/xpcom/glue/nsGenericFactory.h index d0c335cb9c4..5735670daf1 100644 --- a/mozilla/xpcom/glue/nsGenericFactory.h +++ b/mozilla/xpcom/glue/nsGenericFactory.h @@ -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; }; diff --git a/mozilla/xpcom/glue/nsWeakReference.h b/mozilla/xpcom/glue/nsWeakReference.h index ccfba5d01bf..783cb950734 100644 --- a/mozilla/xpcom/glue/nsWeakReference.h +++ b/mozilla/xpcom/glue/nsWeakReference.h @@ -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 ) diff --git a/mozilla/xpcom/glue/standalone/nsGREDirServiceProvider.h b/mozilla/xpcom/glue/standalone/nsGREDirServiceProvider.h index f01b75c2bce..0638a1279ee 100644 --- a/mozilla/xpcom/glue/standalone/nsGREDirServiceProvider.h +++ b/mozilla/xpcom/glue/standalone/nsGREDirServiceProvider.h @@ -61,8 +61,8 @@ public: NS_DECL_ISUPPORTS NS_DECL_NSIDIRECTORYSERVICEPROVIDER -protected: - virtual ~nsGREDirServiceProvider() { } +private: + ~nsGREDirServiceProvider() { } }; #endif // nsGREDirServiceProvider.h diff --git a/mozilla/xpcom/io/nsAppFileLocationProvider.cpp b/mozilla/xpcom/io/nsAppFileLocationProvider.cpp index b4df4cb5e53..1612bf02c77 100755 --- a/mozilla/xpcom/io/nsAppFileLocationProvider.cpp +++ b/mozilla/xpcom/io/nsAppFileLocationProvider.cpp @@ -112,10 +112,6 @@ nsAppFileLocationProvider::nsAppFileLocationProvider() { } -nsAppFileLocationProvider::~nsAppFileLocationProvider() -{ -} - //***************************************************************************** // nsAppFileLocationProvider::nsISupports //***************************************************************************** diff --git a/mozilla/xpcom/io/nsAppFileLocationProvider.h b/mozilla/xpcom/io/nsAppFileLocationProvider.h index c7a6d6afea7..b262615cd4e 100755 --- a/mozilla/xpcom/io/nsAppFileLocationProvider.h +++ b/mozilla/xpcom/io/nsAppFileLocationProvider.h @@ -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); diff --git a/mozilla/xpcom/io/nsByteArrayInputStream.h b/mozilla/xpcom/io/nsByteArrayInputStream.h index 7170581ad3e..ce4af2ecef6 100644 --- a/mozilla/xpcom/io/nsByteArrayInputStream.h +++ b/mozilla/xpcom/io/nsByteArrayInputStream.h @@ -32,9 +32,10 @@ class nsByteArrayInputStream : public nsIByteArrayInputStream public: nsByteArrayInputStream (char *buffer, PRUint32 nbytes); - virtual ~nsByteArrayInputStream (); private: + ~nsByteArrayInputStream (); + char *_buffer; PRUint32 _nbytes; PRUint32 _pos; diff --git a/mozilla/xpcom/io/nsDirectoryService.cpp b/mozilla/xpcom/io/nsDirectoryService.cpp index c98f384f4ac..088f9d4337a 100644 --- a/mozilla/xpcom/io/nsDirectoryService.cpp +++ b/mozilla/xpcom/io/nsDirectoryService.cpp @@ -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; diff --git a/mozilla/xpcom/io/nsDirectoryService.h b/mozilla/xpcom/io/nsDirectoryService.h index 6a9f8a38de7..c131e4254c4 100644 --- a/mozilla/xpcom/io/nsDirectoryService.h +++ b/mozilla/xpcom/io/nsDirectoryService.h @@ -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; diff --git a/mozilla/xpcom/io/nsInputStreamTee.cpp b/mozilla/xpcom/io/nsInputStreamTee.cpp index 8841237f9b9..3451690de80 100644 --- a/mozilla/xpcom/io/nsInputStreamTee.cpp +++ b/mozilla/xpcom/io/nsInputStreamTee.cpp @@ -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) { diff --git a/mozilla/xpcom/io/nsLocalFileMac.cpp b/mozilla/xpcom/io/nsLocalFileMac.cpp index 9178d944389..b50253ea390 100644 --- a/mozilla/xpcom/io/nsLocalFileMac.cpp +++ b/mozilla/xpcom/io/nsLocalFileMac.cpp @@ -888,9 +888,8 @@ class nsDirEnumerator : public nsISimpleEnumerator return NS_OK; } - virtual ~nsDirEnumerator() - { - } + private: + ~nsDirEnumerator() {} protected: nsCOMPtr mNext; @@ -966,10 +965,6 @@ nsLocalFile& nsLocalFile::operator=(const nsLocalFile& rhs) return *this; } -nsLocalFile::~nsLocalFile() -{ -} - #pragma mark - #pragma mark [nsISupports interface implementation] diff --git a/mozilla/xpcom/io/nsLocalFileMac.h b/mozilla/xpcom/io/nsLocalFileMac.h index 8290259d8ac..d3112acf946 100644 --- a/mozilla/xpcom/io/nsLocalFileMac.h +++ b/mozilla/xpcom/io/nsLocalFileMac.h @@ -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); diff --git a/mozilla/xpcom/io/nsLocalFileOS2.cpp b/mozilla/xpcom/io/nsLocalFileOS2.cpp index 053631c5e1e..da521633930 100644 --- a/mozilla/xpcom/io/nsLocalFileOS2.cpp +++ b/mozilla/xpcom/io/nsLocalFileOS2.cpp @@ -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) diff --git a/mozilla/xpcom/io/nsLocalFileOS2.h b/mozilla/xpcom/io/nsLocalFileOS2.h index fe12b2ed0aa..bd89c64d944 100644 --- a/mozilla/xpcom/io/nsLocalFileOS2.h +++ b/mozilla/xpcom/io/nsLocalFileOS2.h @@ -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 diff --git a/mozilla/xpcom/io/nsLocalFileOSX.cpp b/mozilla/xpcom/io/nsLocalFileOSX.cpp index 7834c7024cc..a56132f6298 100644 --- a/mozilla/xpcom/io/nsLocalFileOSX.cpp +++ b/mozilla/xpcom/io/nsLocalFileOSX.cpp @@ -202,7 +202,8 @@ class nsDirEnumerator : public nsISimpleEnumerator return NS_OK; } - virtual ~nsDirEnumerator() + private: + ~nsDirEnumerator() { if (mIterator) ::FSCloseIterator(mIterator); diff --git a/mozilla/xpcom/io/nsLocalFileOSX.h b/mozilla/xpcom/io/nsLocalFileOSX.h index 45bf1bd53e4..21d160beeb4 100644 --- a/mozilla/xpcom/io/nsLocalFileOSX.h +++ b/mozilla/xpcom/io/nsLocalFileOSX.h @@ -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); diff --git a/mozilla/xpcom/io/nsLocalFileUnix.cpp b/mozilla/xpcom/io/nsLocalFileUnix.cpp index de6a41b4c4c..0a031bba7f7 100644 --- a/mozilla/xpcom/io/nsLocalFileUnix.cpp +++ b/mozilla/xpcom/io/nsLocalFileUnix.cpp @@ -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) diff --git a/mozilla/xpcom/io/nsLocalFileUnix.h b/mozilla/xpcom/io/nsLocalFileUnix.h index ac1f021db2e..4a3d60746b5 100644 --- a/mozilla/xpcom/io/nsLocalFileUnix.h +++ b/mozilla/xpcom/io/nsLocalFileUnix.h @@ -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; diff --git a/mozilla/xpcom/io/nsLocalFileWin.cpp b/mozilla/xpcom/io/nsLocalFileWin.cpp index 47c9ceaef05..77bf7005127 100644 --- a/mozilla/xpcom/io/nsLocalFileWin.cpp +++ b/mozilla/xpcom/io/nsLocalFileWin.cpp @@ -406,10 +406,6 @@ nsLocalFile::nsLocalFile() MakeDirty(); } -nsLocalFile::~nsLocalFile() -{ -} - NS_METHOD nsLocalFile::nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr) { diff --git a/mozilla/xpcom/io/nsLocalFileWin.h b/mozilla/xpcom/io/nsLocalFileWin.h index 529c3dd4ac0..f2508cb6298 100644 --- a/mozilla/xpcom/io/nsLocalFileWin.h +++ b/mozilla/xpcom/io/nsLocalFileWin.h @@ -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; diff --git a/mozilla/xpcom/io/nsMultiplexInputStream.cpp b/mozilla/xpcom/io/nsMultiplexInputStream.cpp index 621a700a4dd..3ad8e82ba11 100644 --- a/mozilla/xpcom/io/nsMultiplexInputStream.cpp +++ b/mozilla/xpcom/io/nsMultiplexInputStream.cpp @@ -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) diff --git a/mozilla/xpcom/io/nsScriptableInputStream.h b/mozilla/xpcom/io/nsScriptableInputStream.h index 5305a98dcd3..49767c2c9eb 100644 --- a/mozilla/xpcom/io/nsScriptableInputStream.h +++ b/mozilla/xpcom/io/nsScriptableInputStream.h @@ -58,11 +58,13 @@ public: // nsScriptableInputStream methods nsScriptableInputStream() {}; - virtual ~nsScriptableInputStream() {}; static NS_METHOD Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); + private: + ~nsScriptableInputStream() {}; + nsCOMPtr mInputStream; }; diff --git a/mozilla/xpcom/io/nsStorageStream.cpp b/mozilla/xpcom/io/nsStorageStream.cpp index ac9349bb1c6..9fc48ee425e 100644 --- a/mozilla/xpcom/io/nsStorageStream.cpp +++ b/mozilla/xpcom/io/nsStorageStream.cpp @@ -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; diff --git a/mozilla/xpcom/io/nsStorageStream.h b/mozilla/xpcom/io/nsStorageStream.h index 16473b65338..59f22fa2213 100644 --- a/mozilla/xpcom/io/nsStorageStream.h +++ b/mozilla/xpcom/io/nsStorageStream.h @@ -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 diff --git a/mozilla/xpcom/io/nsStreamUtils.cpp b/mozilla/xpcom/io/nsStreamUtils.cpp index abf21fb40fc..3c0d319989a 100644 --- a/mozilla/xpcom/io/nsStreamUtils.cpp +++ b/mozilla/xpcom/io/nsStreamUtils.cpp @@ -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; diff --git a/mozilla/xpcom/io/nsUnicharInputStream.cpp b/mozilla/xpcom/io/nsUnicharInputStream.cpp index 0ccb9b6e26e..1fc34a2f12b 100644 --- a/mozilla/xpcom/io/nsUnicharInputStream.cpp +++ b/mozilla/xpcom/io/nsUnicharInputStream.cpp @@ -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); diff --git a/mozilla/xpcom/obsolete/component/nsFileSpecImpl.h b/mozilla/xpcom/obsolete/component/nsFileSpecImpl.h index 820a766c890..a9df578d1fa 100644 --- a/mozilla/xpcom/obsolete/component/nsFileSpecImpl.h +++ b/mozilla/xpcom/obsolete/component/nsFileSpecImpl.h @@ -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 diff --git a/mozilla/xpcom/obsolete/component/nsRegistry.cpp b/mozilla/xpcom/obsolete/component/nsRegistry.cpp index 7e2c6113c74..4e9cf64cc95 100644 --- a/mozilla/xpcom/obsolete/component/nsRegistry.cpp +++ b/mozilla/xpcom/obsolete/component/nsRegistry.cpp @@ -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. diff --git a/mozilla/xpcom/obsolete/component/nsRegistry.h b/mozilla/xpcom/obsolete/component/nsRegistry.h index 26164cccfe6..2cef9d74c41 100644 --- a/mozilla/xpcom/obsolete/component/nsRegistry.h +++ b/mozilla/xpcom/obsolete/component/nsRegistry.h @@ -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. diff --git a/mozilla/xpcom/obsolete/nsFileSpecImpl.h b/mozilla/xpcom/obsolete/nsFileSpecImpl.h index 8e0588d19db..4c87b289286 100644 --- a/mozilla/xpcom/obsolete/nsFileSpecImpl.h +++ b/mozilla/xpcom/obsolete/nsFileSpecImpl.h @@ -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 diff --git a/mozilla/xpcom/obsolete/nsIFileStream.cpp b/mozilla/xpcom/obsolete/nsIFileStream.cpp index 6702d6d8a91..a030c84838d 100644 --- a/mozilla/xpcom/obsolete/nsIFileStream.cpp +++ b/mozilla/xpcom/obsolete/nsIFileStream.cpp @@ -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; } diff --git a/mozilla/xpcom/proxy/src/nsProxyEventPrivate.h b/mozilla/xpcom/proxy/src/nsProxyEventPrivate.h index de993da4c00..b7d2e9e8b6a 100644 --- a/mozilla/xpcom/proxy/src/nsProxyEventPrivate.h +++ b/mozilla/xpcom/proxy/src/nsProxyEventPrivate.h @@ -89,9 +89,10 @@ public: protected: nsProxyEventClass(); nsProxyEventClass(REFNSIID aIID, nsIInterfaceInfo* aInfo); - virtual ~nsProxyEventClass(); private: + ~nsProxyEventClass(); + nsIID mIID; nsCOMPtr 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; diff --git a/mozilla/xpcom/proxy/src/nsProxyObjectManager.cpp b/mozilla/xpcom/proxy/src/nsProxyObjectManager.cpp index 208f9c3d9d6..c70e4bb980d 100644 --- a/mozilla/xpcom/proxy/src/nsProxyObjectManager.cpp +++ b/mozilla/xpcom/proxy/src/nsProxyObjectManager.cpp @@ -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) diff --git a/mozilla/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp b/mozilla/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp index 1249012b01c..4cf3444b484 100644 --- a/mozilla/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp +++ b/mozilla/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp @@ -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; diff --git a/mozilla/xpcom/reflect/xptinfo/src/xptiprivate.h b/mozilla/xpcom/reflect/xptinfo/src/xptiprivate.h index fccf6e61e65..91a59cd8dd7 100644 --- a/mozilla/xpcom/reflect/xptinfo/src/xptiprivate.h +++ b/mozilla/xpcom/reflect/xptinfo/src/xptiprivate.h @@ -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); diff --git a/mozilla/xpcom/sample/nsSample.h b/mozilla/xpcom/sample/nsSample.h index 8552b4682ff..48cb585fa12 100644 --- a/mozilla/xpcom/sample/nsSample.h +++ b/mozilla/xpcom/sample/nsSample.h @@ -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; }; diff --git a/mozilla/xpcom/tests/TestArray.cpp b/mozilla/xpcom/tests/TestArray.cpp index 14068cdd455..90a35510830 100644 --- a/mozilla/xpcom/tests/TestArray.cpp +++ b/mozilla/xpcom/tests/TestArray.cpp @@ -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; diff --git a/mozilla/xpcom/tests/TestHashtables.cpp b/mozilla/xpcom/tests/TestHashtables.cpp index 911984bdb84..4d0f5e03b57 100644 --- a/mozilla/xpcom/tests/TestHashtables.cpp +++ b/mozilla/xpcom/tests/TestHashtables.cpp @@ -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_; diff --git a/mozilla/xpcom/tests/TestObserverService.cpp b/mozilla/xpcom/tests/TestObserverService.cpp index 37c49d8e97d..13c39082edb 100644 --- a/mozilla/xpcom/tests/TestObserverService.cpp +++ b/mozilla/xpcom/tests/TestObserverService.cpp @@ -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 ) diff --git a/mozilla/xpcom/tests/TestPipes.cpp b/mozilla/xpcom/tests/TestPipes.cpp index e43b5de64d4..5f0c4721aeb 100644 --- a/mozilla/xpcom/tests/TestPipes.cpp +++ b/mozilla/xpcom/tests/TestPipes.cpp @@ -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 mIn; diff --git a/mozilla/xpcom/tests/TestThreads.cpp b/mozilla/xpcom/tests/TestThreads.cpp index 795acac30c2..515834a324b 100644 --- a/mozilla/xpcom/tests/TestThreads.cpp +++ b/mozilla/xpcom/tests/TestThreads.cpp @@ -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; diff --git a/mozilla/xpcom/tests/services/MyService.cpp b/mozilla/xpcom/tests/services/MyService.cpp index cc6dd3a72b9..e7d3ba225f5 100644 --- a/mozilla/xpcom/tests/services/MyService.cpp +++ b/mozilla/xpcom/tests/services/MyService.cpp @@ -50,10 +50,10 @@ public: Doit(void); MyService(); - virtual ~MyService(); - NS_DECL_ISUPPORTS +private: + ~MyService(); }; //////////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/xpcom/tests/windows/TestCOM.cpp b/mozilla/xpcom/tests/windows/TestCOM.cpp index 99a84a659e3..df48bd759ce 100644 --- a/mozilla/xpcom/tests/windows/TestCOM.cpp +++ b/mozilla/xpcom/tests/windows/TestCOM.cpp @@ -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) diff --git a/mozilla/xpcom/threads/TimerThread.h b/mozilla/xpcom/threads/TimerThread.h index 4eaa89bcd48..6c9557435f3 100644 --- a/mozilla/xpcom/threads/TimerThread.h +++ b/mozilla/xpcom/threads/TimerThread.h @@ -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. diff --git a/mozilla/xpcom/threads/nsAutoLock.h b/mozilla/xpcom/threads/nsAutoLock.h index 39b75d30354..48c57c45c52 100644 --- a/mozilla/xpcom/threads/nsAutoLock.h +++ b/mozilla/xpcom/threads/nsAutoLock.h @@ -52,7 +52,7 @@ mLock = PR_NewLock(); } - virtual ~Foo(void) { + ~Foo(void) { PR_DestroyLock(mLock); } diff --git a/mozilla/xpcom/threads/nsEventQueue.h b/mozilla/xpcom/threads/nsEventQueue.h index 63a6abebd22..b31968ea04b 100644 --- a/mozilla/xpcom/threads/nsEventQueue.h +++ b/mozilla/xpcom/threads/nsEventQueue.h @@ -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? diff --git a/mozilla/xpcom/threads/nsEventQueueService.h b/mozilla/xpcom/threads/nsEventQueueService.h index e61fe8dc28a..5ea24676c5e 100644 --- a/mozilla/xpcom/threads/nsEventQueueService.h +++ b/mozilla/xpcom/threads/nsEventQueueService.h @@ -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. */ diff --git a/mozilla/xpcom/threads/nsProcess.h b/mozilla/xpcom/threads/nsProcess.h index c2e048a0702..9c73953e652 100644 --- a/mozilla/xpcom/threads/nsProcess.h +++ b/mozilla/xpcom/threads/nsProcess.h @@ -42,9 +42,10 @@ public: NS_DECL_NSIPROCESS nsProcess(); - virtual ~nsProcess(); private: + ~nsProcess() {} + nsCOMPtr mExecutable; PRInt32 mExitValue; nsCString mTargetPath; diff --git a/mozilla/xpcom/threads/nsProcessCommon.cpp b/mozilla/xpcom/threads/nsProcessCommon.cpp index 1c064070486..b8a95163d2f 100644 --- a/mozilla/xpcom/threads/nsProcessCommon.cpp +++ b/mozilla/xpcom/threads/nsProcessCommon.cpp @@ -59,10 +59,6 @@ nsProcess::nsProcess():mExitValue(-1), { } -nsProcess::~nsProcess() -{ -} - NS_IMETHODIMP nsProcess::Init(nsIFile* executable) { diff --git a/mozilla/xpcom/threads/nsProcessMac.cpp b/mozilla/xpcom/threads/nsProcessMac.cpp index 0e14d27caec..a2c1b8cbbea 100644 --- a/mozilla/xpcom/threads/nsProcessMac.cpp +++ b/mozilla/xpcom/threads/nsProcessMac.cpp @@ -59,10 +59,6 @@ nsProcess::nsProcess() { } -nsProcess::~nsProcess() -{ -} - NS_IMETHODIMP nsProcess::Init(nsIFile* executable) { diff --git a/mozilla/xpcom/threads/nsThread.h b/mozilla/xpcom/threads/nsThread.h index d0f051a41b3..b43cfc49c5c 100644 --- a/mozilla/xpcom/threads/nsThread.h +++ b/mozilla/xpcom/threads/nsThread.h @@ -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 mRunnable; diff --git a/mozilla/xpcom/threads/nsTimerImpl.h b/mozilla/xpcom/threads/nsTimerImpl.h index dce1abfe7fd..c3e90afa0fa 100644 --- a/mozilla/xpcom/threads/nsTimerImpl.h +++ b/mozilla/xpcom/threads/nsTimerImpl.h @@ -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; }; diff --git a/mozilla/xpcom/tools/registry/regxpcom.cpp b/mozilla/xpcom/tools/registry/regxpcom.cpp index 0c8f61ffd03..73b17400a05 100644 --- a/mozilla/xpcom/tools/registry/regxpcom.cpp +++ b/mozilla/xpcom/tools/registry/regxpcom.cpp @@ -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) diff --git a/mozilla/xpcom/typelib/xpidl/xpidl_header.c b/mozilla/xpcom/typelib/xpidl/xpidl_header.c index 2891c1d8edd..d3febeb5e29 100644 --- a/mozilla/xpcom/typelib/xpidl/xpidl_header.c +++ b/mozilla/xpcom/typelib/xpidl/xpidl_header.c @@ -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);