Bug 1028588 - Fix dangerous public destructors in miscellaneous places - r=ehsan

This commit is contained in:
Benoit Jacob 2014-06-23 18:40:03 -04:00
parent 965c1936df
commit 3cd7e34ddb
12 changed files with 28 additions and 8 deletions

View File

@ -18,12 +18,12 @@ public:
NS_DECL_NSIABOUTMODULE
AboutRedirector() {}
virtual ~AboutRedirector() {}
static nsresult
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
protected:
virtual ~AboutRedirector() {}
};
} // namespace browser

View File

@ -25,6 +25,8 @@ public:
NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
private:
~DirectoryProvider() {}
class AppendingEnumerator MOZ_FINAL : public nsISimpleEnumerator
{
public:
@ -35,6 +37,8 @@ private:
char const *const *aAppendList);
private:
~AppendingEnumerator() {}
nsCOMPtr<nsISimpleEnumerator> mBase;
char const *const *const mAppendList;
nsCOMPtr<nsIFile> mNext;

View File

@ -26,6 +26,8 @@ public:
uint32_t* writeCount);
protected:
~nsFeedSniffer() {}
nsresult ConvertEncodedData(nsIRequest* request, const uint8_t* data,
uint32_t length);

View File

@ -19,9 +19,10 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMAINPOLICY
DomainPolicy();
virtual ~DomainPolicy();
private:
virtual ~DomainPolicy();
nsCOMPtr<nsIDomainSet> mBlacklist;
nsCOMPtr<nsIDomainSet> mSuperBlacklist;
nsCOMPtr<nsIDomainSet> mWhitelist;
@ -35,9 +36,9 @@ public:
NS_DECL_NSIDOMAINSET
DomainSet() {}
virtual ~DomainSet() {}
protected:
virtual ~DomainSet() {}
nsTHashtable<nsURIHashKey> mHashTable;
};

View File

@ -37,6 +37,8 @@ public:
nsNullPrincipalURI(const nsCString &aSpec);
private:
~nsNullPrincipalURI() {}
nsCString mScheme;
nsCString mPath;
};

View File

@ -29,6 +29,8 @@ public:
// nsChromeProtocolHandler methods:
nsChromeProtocolHandler() {}
private:
~nsChromeProtocolHandler() {}
};

View File

@ -60,7 +60,6 @@ public:
// nsChromeRegistry methods:
nsChromeRegistry() : mInitialized(false) { }
virtual ~nsChromeRegistry();
virtual nsresult Init();
@ -71,6 +70,8 @@ public:
static nsresult Canonify(nsIURL* aChromeURL);
protected:
virtual ~nsChromeRegistry();
void FlushSkinCaches();
void FlushAllCaches();

View File

@ -97,6 +97,7 @@ RemoveChildFromList(const nsAString& aKey, nsAutoPtr<ProcessLockTable>& aTable,
}
class ClearHashtableOnShutdown MOZ_FINAL : public nsIObserver {
~ClearHashtableOnShutdown() {}
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
@ -116,6 +117,7 @@ ClearHashtableOnShutdown::Observe(nsISupports* aSubject, const char* aTopic, con
}
class CleanupOnContentShutdown MOZ_FINAL : public nsIObserver {
~CleanupOnContentShutdown() {}
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER

View File

@ -20,6 +20,7 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSISYNCJPAKE
nsSyncJPAKE();
protected:
virtual ~nsSyncJPAKE();
private:
enum { JPAKENotStarted, JPAKEBeforeRound2, JPAKEAfterRound2 } round;

View File

@ -93,6 +93,7 @@ struct CacheEntry
// refcount its listeners, so we'll let it refcount this instead.
class StartupCacheListener MOZ_FINAL : public nsIObserver
{
~StartupCacheListener() {}
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIOBSERVER
};
@ -187,7 +188,9 @@ private:
#ifdef DEBUG
class StartupCacheDebugOutputStream MOZ_FINAL
: public nsIObjectOutputStream
{
{
~StartupCacheDebugOutputStream() {}
NS_DECL_ISUPPORTS
NS_DECL_NSIOBJECTOUTPUTSTREAM
@ -214,6 +217,8 @@ class StartupCacheDebugOutputStream MOZ_FINAL
class StartupCacheWrapper MOZ_FINAL
: public nsIStartupCache
{
~StartupCacheWrapper() {}
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSISTARTUPCACHE

View File

@ -43,10 +43,10 @@ public:
, mClosure(aClosure)
{}
~ProfileSaveEvent() {}
NS_IMETHOD AddSubProfile(const char* aProfile);
private:
~ProfileSaveEvent() {}
AddSubProfileFunc mFunc;
void* mClosure;
};

View File

@ -14,7 +14,6 @@ class nsProfiler MOZ_FINAL : public nsIProfiler, public nsIObserver
{
public:
nsProfiler();
~nsProfiler();
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
@ -22,6 +21,7 @@ public:
nsresult Init();
private:
~nsProfiler();
bool mLockedForPrivateBrowsing;
};