Skip to content

Commit

Permalink
Bug 1028588 - Fix dangerous public destructors in miscellaneous place…
Browse files Browse the repository at this point in the history
…s - r=ehsan
  • Loading branch information
Benoit Jacob committed Jun 23, 2014
1 parent dac776f commit 0a40ab9
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 8 deletions.
2 changes: 1 addition & 1 deletion browser/components/about/AboutRedirector.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ class AboutRedirector : public nsIAboutModule
NS_DECL_NSIABOUTMODULE

AboutRedirector() {}
virtual ~AboutRedirector() {}

static nsresult
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);

protected:
virtual ~AboutRedirector() {}
};

} // namespace browser
Expand Down
4 changes: 4 additions & 0 deletions browser/components/dirprovider/DirectoryProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class DirectoryProvider MOZ_FINAL : public nsIDirectoryServiceProvider2
NS_DECL_NSIDIRECTORYSERVICEPROVIDER2

private:
~DirectoryProvider() {}

class AppendingEnumerator MOZ_FINAL : public nsISimpleEnumerator
{
public:
Expand All @@ -35,6 +37,8 @@ class DirectoryProvider MOZ_FINAL : public nsIDirectoryServiceProvider2
char const *const *aAppendList);

private:
~AppendingEnumerator() {}

nsCOMPtr<nsISimpleEnumerator> mBase;
char const *const *const mAppendList;
nsCOMPtr<nsIFile> mNext;
Expand Down
2 changes: 2 additions & 0 deletions browser/components/feeds/src/nsFeedSniffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class nsFeedSniffer MOZ_FINAL : public nsIContentSniffer,
uint32_t* writeCount);

protected:
~nsFeedSniffer() {}

nsresult ConvertEncodedData(nsIRequest* request, const uint8_t* data,
uint32_t length);

Expand Down
5 changes: 3 additions & 2 deletions caps/include/DomainPolicy.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ class DomainPolicy : public nsIDomainPolicy
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMAINPOLICY
DomainPolicy();
virtual ~DomainPolicy();

private:
virtual ~DomainPolicy();

nsCOMPtr<nsIDomainSet> mBlacklist;
nsCOMPtr<nsIDomainSet> mSuperBlacklist;
nsCOMPtr<nsIDomainSet> mWhitelist;
Expand All @@ -35,9 +36,9 @@ class DomainSet : public nsIDomainSet
NS_DECL_NSIDOMAINSET

DomainSet() {}
virtual ~DomainSet() {}

protected:
virtual ~DomainSet() {}
nsTHashtable<nsURIHashKey> mHashTable;
};

Expand Down
2 changes: 2 additions & 0 deletions caps/src/nsNullPrincipalURI.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class nsNullPrincipalURI MOZ_FINAL : public nsIURI
nsNullPrincipalURI(const nsCString &aSpec);

private:
~nsNullPrincipalURI() {}

nsCString mScheme;
nsCString mPath;
};
Expand Down
2 changes: 2 additions & 0 deletions chrome/src/nsChromeProtocolHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class nsChromeProtocolHandler MOZ_FINAL : public nsIProtocolHandler,

// nsChromeProtocolHandler methods:
nsChromeProtocolHandler() {}

private:
~nsChromeProtocolHandler() {}
};

Expand Down
3 changes: 2 additions & 1 deletion chrome/src/nsChromeRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class nsChromeRegistry : public nsIToolkitChromeRegistry,

// nsChromeRegistry methods:
nsChromeRegistry() : mInitialized(false) { }
virtual ~nsChromeRegistry();

virtual nsresult Init();

Expand All @@ -71,6 +70,8 @@ class nsChromeRegistry : public nsIToolkitChromeRegistry,
static nsresult Canonify(nsIURL* aChromeURL);

protected:
virtual ~nsChromeRegistry();

void FlushSkinCaches();
void FlushAllCaches();

Expand Down
2 changes: 2 additions & 0 deletions hal/HalWakeLock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions services/crypto/component/nsSyncJPAKE.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class nsSyncJPAKE : public nsISyncJPAKE
NS_DECL_ISUPPORTS
NS_DECL_NSISYNCJPAKE
nsSyncJPAKE();
protected:
virtual ~nsSyncJPAKE();
private:
enum { JPAKENotStarted, JPAKEBeforeRound2, JPAKEAfterRound2 } round;
Expand Down
7 changes: 6 additions & 1 deletion startupcache/StartupCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand Down Expand Up @@ -187,7 +188,9 @@ friend class StartupCacheWrapper;
#ifdef DEBUG
class StartupCacheDebugOutputStream MOZ_FINAL
: public nsIObjectOutputStream
{
{
~StartupCacheDebugOutputStream() {}

NS_DECL_ISUPPORTS
NS_DECL_NSIOBJECTOUTPUTSTREAM

Expand All @@ -214,6 +217,8 @@ class StartupCacheDebugOutputStream MOZ_FINAL
class StartupCacheWrapper MOZ_FINAL
: public nsIStartupCache
{
~StartupCacheWrapper() {}

NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSISTARTUPCACHE

Expand Down
4 changes: 2 additions & 2 deletions tools/profiler/SaveProfileTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ class ProfileSaveEvent MOZ_FINAL : public nsIProfileSaveEvent {
, mClosure(aClosure)
{}

~ProfileSaveEvent() {}

NS_IMETHOD AddSubProfile(const char* aProfile);
private:
~ProfileSaveEvent() {}

AddSubProfileFunc mFunc;
void* mClosure;
};
Expand Down
2 changes: 1 addition & 1 deletion tools/profiler/nsProfiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ class nsProfiler MOZ_FINAL : public nsIProfiler, public nsIObserver
{
public:
nsProfiler();
~nsProfiler();

NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
NS_DECL_NSIPROFILER

nsresult Init();
private:
~nsProfiler();
bool mLockedForPrivateBrowsing;
};

Expand Down

0 comments on commit 0a40ab9

Please sign in to comment.