Bug 758992 - Make the classes which use the XPCOM nsISupports implementation macros final, to avoid the warning about deleting using a pointer to a base class with virtual functions and no virtual dtor (security parts); blanket-r=bzbarsky

This commit is contained in:
Ehsan Akhgari 2012-07-19 00:37:09 -04:00
parent 4bdd46e24a
commit f35f75fd3c
12 changed files with 29 additions and 18 deletions

View File

@ -6,12 +6,13 @@
#define __NS_NSFORMSIGNINGDIALOG_H__
#include "nsIFormSigningDialog.h"
#include "mozilla/Attributes.h"
#define NS_FORMSIGNINGDIALOG_CID \
{ 0xa4bd2161, 0x7892, 0x4389, \
{ 0x8d, 0x5a, 0x31, 0x11, 0xa6, 0xd1, 0x7e, 0xc7 }}
class nsFormSigningDialog : public nsIFormSigningDialog
class nsFormSigningDialog MOZ_FINAL : public nsIFormSigningDialog
{
public:
nsFormSigningDialog();

View File

@ -6,11 +6,12 @@
#include "nsIStringBundle.h"
#include "nsCOMPtr.h"
#include "mozilla/Attributes.h"
namespace mozilla {
namespace psm {
class NSSErrorsService : public nsINSSErrorsService
class NSSErrorsService MOZ_FINAL : public nsINSSErrorsService
{
NS_DECL_ISUPPORTS
NS_DECL_NSINSSERRORSSERVICE

View File

@ -15,6 +15,7 @@
#include "nsIFile.h"
#include "secoidt.h"
#include "nsWeakReference.h"
#include "mozilla/Attributes.h"
class nsCertOverride
{
@ -62,7 +63,7 @@ public:
// hash entry class
class nsCertOverrideEntry : public PLDHashEntryHdr
class nsCertOverrideEntry MOZ_FINAL : public PLDHashEntryHdr
{
public:
// Hash methods
@ -125,9 +126,9 @@ class nsCertOverrideEntry : public PLDHashEntryHdr
nsCString mHostWithPort;
};
class nsCertOverrideService : public nsICertOverrideService
, public nsIObserver
, public nsSupportsWeakReference
class nsCertOverrideService MOZ_FINAL : public nsICertOverrideService
, public nsIObserver
, public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS

View File

@ -18,6 +18,7 @@
#include "pldhash.h"
#include "nsIX509CertDB.h"
#include "nsCertOverrideService.h"
#include "mozilla/Attributes.h"
typedef struct treeArrayElStr treeArrayEl;
@ -37,7 +38,7 @@ struct CompareCacheHashEntryPtr : PLDHashEntryHdr {
CompareCacheHashEntry *entry;
};
class nsCertAddonInfo : public nsISupports
class nsCertAddonInfo MOZ_FINAL : public nsISupports
{
public:
NS_DECL_ISUPPORTS

View File

@ -15,6 +15,7 @@
#include "nsNSSCertificate.h"
#include "nsString.h"
#include "nsWeakReference.h"
#include "mozilla/Attributes.h"
class nsClientAuthRemember
{
@ -44,7 +45,7 @@ public:
// hash entry class
class nsClientAuthRememberEntry : public PLDHashEntryHdr
class nsClientAuthRememberEntry MOZ_FINAL : public PLDHashEntryHdr
{
public:
// Hash methods
@ -106,8 +107,8 @@ class nsClientAuthRememberEntry : public PLDHashEntryHdr
nsCString mHostWithCert;
};
class nsClientAuthRememberService : public nsIObserver,
public nsSupportsWeakReference
class nsClientAuthRememberService MOZ_FINAL : public nsIObserver,
public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS

View File

@ -6,6 +6,7 @@
#define _NS_DATASIGNATUREVERIFIER_H_
#include "nsIDataSignatureVerifier.h"
#include "mozilla/Attributes.h"
#include "keythi.h"
@ -16,7 +17,7 @@
#define NS_DATASIGNATUREVERIFIER_CONTRACTID \
"@mozilla.org/security/datasignatureverifier;1"
class nsDataSignatureVerifier : public nsIDataSignatureVerifier
class nsDataSignatureVerifier MOZ_FINAL : public nsIDataSignatureVerifier
{
public:
NS_DECL_ISUPPORTS

View File

@ -7,6 +7,7 @@
#include "nsIKeyModule.h"
#include "pk11pub.h"
#include "mozilla/Attributes.h"
#define NS_KEYMODULEOBJECT_CLASSNAME "Key Object Component"
/* eae599aa-ecef-49c6-a8af-6ddcc6feb484 */
@ -21,7 +22,7 @@
#define NS_KEYMODULEOBJECTFACTORY_CONTRACTID \
"@mozilla.org/security/keyobjectfactory;1"
class nsKeyObject : public nsIKeyObject
class nsKeyObject MOZ_FINAL : public nsIKeyObject
{
public:
nsKeyObject();
@ -48,7 +49,7 @@ private:
};
class nsKeyObjectFactory : public nsIKeyObjectFactory
class nsKeyObjectFactory MOZ_FINAL : public nsIKeyObjectFactory
{
public:
nsKeyObjectFactory();

View File

@ -13,6 +13,7 @@
#include "nsIStreamLoader.h"
#include "mozilla/CondVar.h"
#include "mozilla/Mutex.h"
#include "mozilla/Attributes.h"
char* PR_CALLBACK
PK11PasswordPrompt(PK11SlotInfo *slot, PRBool retry, void* arg);
@ -22,7 +23,7 @@ void PR_CALLBACK HandshakeCallback(PRFileDesc *fd, void *client_data);
SECStatus RegisterMyOCSPAIAInfoCallback();
SECStatus UnregisterMyOCSPAIAInfoCallback();
class nsHTTPListener : public nsIStreamLoaderObserver
class nsHTTPListener MOZ_FINAL : public nsIStreamLoaderObserver
{
private:
// For XPCOM implementations that are not a base class for some other

View File

@ -7,8 +7,9 @@
#define _NS_NSSVERSION_H_
#include "nsINSSVersion.h"
#include "mozilla/Attributes.h"
class nsNSSVersion : public nsINSSVersion
class nsNSSVersion MOZ_FINAL : public nsINSSVersion
{
public:
NS_DECL_ISUPPORTS

View File

@ -6,6 +6,7 @@
#define _NSRANDOMGENERATOR_H_
#include "nsIRandomGenerator.h"
#include "mozilla/Attributes.h"
#define NS_RANDOMGENERATOR_CID \
{0xbe65e2b7, 0xfe46, 0x4e0f, {0x88, 0xe0, 0x4b, 0x38, 0x5d, 0xb4, 0xd6, 0x8a}}
@ -13,7 +14,7 @@
#define NS_RANDOMGENERATOR_CONTRACTID \
"@mozilla.org/security/random-generator;1"
class nsRandomGenerator : public nsIRandomGenerator
class nsRandomGenerator MOZ_FINAL : public nsIRandomGenerator
{
public:
NS_DECL_ISUPPORTS

View File

@ -53,7 +53,7 @@ private:
RecentBadCert &operator=(const RecentBadCert &other) MOZ_DELETE;
};
class nsRecentBadCertsService : public nsIRecentBadCertsService
class nsRecentBadCertsService MOZ_FINAL : public nsIRecentBadCertsService
{
public:
NS_DECL_ISUPPORTS

View File

@ -8,6 +8,7 @@
#include "nsIStreamCipher.h"
#include "nsString.h"
#include "pk11func.h"
#include "mozilla/Attributes.h"
#define NS_STREAMCIPHER_CLASSNAME "Stream Cipher Component"
/* dbfcbe4a-10f7-4d6f-a481-68e6d6b71d21 */
@ -15,7 +16,7 @@
{ 0xdbfcbe4a, 0x10f7, 0x4d6f, {0xa4, 0x81, 0x68, 0xe6, 0xd6, 0xb7, 0x1d, 0x21}}
#define NS_STREAMCIPHER_CONTRACTID "@mozilla.org/security/streamcipher;1"
class nsStreamCipher : public nsIStreamCipher
class nsStreamCipher MOZ_FINAL : public nsIStreamCipher
{
public:
nsStreamCipher();