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 (uriloader parts); r=bzbarsky
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 12 Jun 2012 23:53:09 -0400
changeset 96548 4142308ec401baf9504115c3492fd698f2c99a4f
parent 96547 484b7ec3f2ec9452a7231911af6cef71c60ea6c5
child 96549 beba1a053f5e66077fab002f3901fbeed15d095d
push id22911
push useremorley@mozilla.com
push dateWed, 13 Jun 2012 12:49:30 +0000
treeherdermozilla-central@efbb6480e98e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs758992
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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 (uriloader parts); r=bzbarsky
uriloader/base/nsURILoader.h
uriloader/exthandler/nsExternalHelperAppService.h
uriloader/exthandler/nsExternalProtocolHandler.h
uriloader/prefetch/OfflineCacheUpdateGlue.h
uriloader/prefetch/nsOfflineCacheUpdate.cpp
uriloader/prefetch/nsOfflineCacheUpdate.h
uriloader/prefetch/nsOfflineCacheUpdateService.cpp
uriloader/prefetch/nsPrefetchService.cpp
uriloader/prefetch/nsPrefetchService.h
--- a/uriloader/base/nsURILoader.h
+++ b/uriloader/base/nsURILoader.h
@@ -9,26 +9,27 @@
 #include "nsCURILoader.h"
 #include "nsISupportsUtils.h"
 #include "nsCOMArray.h"
 #include "nsCOMPtr.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsString.h"
 #include "nsIWeakReference.h"
+#include "mozilla/Attributes.h"
 
 #ifdef MOZ_LOGGING
 // Uncomment the next line to force logging on in release builds
 // #define FORCE_PR_LOG
 #endif
 #include "prlog.h"
 
 class nsDocumentOpenInfo;
 
-class nsURILoader : public nsIURILoader
+class nsURILoader MOZ_FINAL : public nsIURILoader
 {
 public:
   NS_DECL_NSIURILOADER
   NS_DECL_ISUPPORTS
 
   nsURILoader();
   ~nsURILoader();
 
--- a/uriloader/exthandler/nsExternalHelperAppService.h
+++ b/uriloader/exthandler/nsExternalHelperAppService.h
@@ -31,16 +31,17 @@
 
 #include "nsIHandlerService.h"
 #include "nsCOMPtr.h"
 #include "nsIObserver.h"
 #include "nsCOMArray.h"
 #include "nsWeakReference.h"
 #include "nsIPrompt.h"
 #include "nsAutoPtr.h"
+#include "mozilla/Attributes.h"
 
 class nsExternalAppHandler;
 class nsIMIMEInfo;
 class nsITransfer;
 class nsIDOMWindow;
 
 /**
  * The helper app service. Responsible for handling content that Mozilla
@@ -200,19 +201,19 @@ protected:
 /**
  * An external app handler is just a small little class that presents itself as
  * a nsIStreamListener. It saves the incoming data into a temp file. The handler
  * is bound to an application when it is created. When it receives an
  * OnStopRequest it launches the application using the temp file it has
  * stored the data into.  We create a handler every time we have to process
  * data using a helper app.
  */
-class nsExternalAppHandler : public nsIStreamListener,
-                             public nsIHelperAppLauncher,
-                             public nsITimerCallback
+class nsExternalAppHandler MOZ_FINAL : public nsIStreamListener,
+                                       public nsIHelperAppLauncher,
+                                       public nsITimerCallback
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSIHELPERAPPLAUNCHER
   NS_DECL_NSICANCELABLE
   NS_DECL_NSITIMERCALLBACK
--- a/uriloader/exthandler/nsExternalProtocolHandler.h
+++ b/uriloader/exthandler/nsExternalProtocolHandler.h
@@ -7,21 +7,22 @@
 #ifndef nsExternalProtocolHandler_h___
 #define nsExternalProtocolHandler_h___
 
 #include "nsIExternalProtocolHandler.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsWeakReference.h"
 #include "nsIExternalProtocolService.h"
+#include "mozilla/Attributes.h"
 
 class nsIURI;
 
 // protocol handlers need to support weak references if we want the netlib nsIOService to cache them.
-class nsExternalProtocolHandler : public nsIExternalProtocolHandler, public nsSupportsWeakReference
+class nsExternalProtocolHandler MOZ_FINAL : public nsIExternalProtocolHandler, public nsSupportsWeakReference
 {
 public:
 	NS_DECL_ISUPPORTS
 	NS_DECL_NSIPROTOCOLHANDLER
 	NS_DECL_NSIEXTERNALPROTOCOLHANDLER
 
 	nsExternalProtocolHandler();
 	~nsExternalProtocolHandler();
--- a/uriloader/prefetch/OfflineCacheUpdateGlue.h
+++ b/uriloader/prefetch/OfflineCacheUpdateGlue.h
@@ -7,16 +7,17 @@
 #define nsOfflineCacheUpdateGlue_h
 
 #include "nsIOfflineCacheUpdate.h"
 
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsString.h"
 #include "nsWeakReference.h"
+#include "mozilla/Attributes.h"
 
 class nsOfflineCacheUpdate;
 
 namespace mozilla {
 namespace docshell {
 
 // Like FORWARD_SAFE except methods:
 //    Schedule
@@ -29,19 +30,19 @@ namespace docshell {
   NS_SCRIPTABLE NS_IMETHOD GetManifestURI(nsIURI **aManifestURI) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetManifestURI(aManifestURI); } \
   NS_SCRIPTABLE NS_IMETHOD GetSucceeded(bool *aSucceeded) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSucceeded(aSucceeded); } \
   NS_SCRIPTABLE NS_IMETHOD InitPartial(nsIURI *aManifestURI, const nsACString & aClientID, nsIURI *aDocumentURI) { return !_to ? NS_ERROR_NULL_POINTER : _to->InitPartial(aManifestURI, aClientID, aDocumentURI); } \
   NS_SCRIPTABLE NS_IMETHOD AddDynamicURI(nsIURI *aURI) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddDynamicURI(aURI); } \
   NS_SCRIPTABLE NS_IMETHOD AddObserver(nsIOfflineCacheUpdateObserver *aObserver, bool aHoldWeak) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddObserver(aObserver, aHoldWeak); } \
   NS_SCRIPTABLE NS_IMETHOD RemoveObserver(nsIOfflineCacheUpdateObserver *aObserver) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveObserver(aObserver); } \
   NS_SCRIPTABLE NS_IMETHOD GetByteProgress(PRUint64 * _result) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetByteProgress(_result); }
 
-class OfflineCacheUpdateGlue : public nsSupportsWeakReference
-                             , public nsIOfflineCacheUpdate
-                             , public nsIOfflineCacheUpdateObserver
+class OfflineCacheUpdateGlue MOZ_FINAL : public nsSupportsWeakReference
+                                       , public nsIOfflineCacheUpdate
+                                       , public nsIOfflineCacheUpdateObserver
 {
 public:
     NS_DECL_ISUPPORTS
 
 private:
     nsIOfflineCacheUpdate* EnsureUpdate();
 
 public:
--- a/uriloader/prefetch/nsOfflineCacheUpdate.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdate.cpp
@@ -32,16 +32,17 @@
 #include "nsNetUtil.h"
 #include "nsServiceManagerUtils.h"
 #include "nsStreamUtils.h"
 #include "nsThreadUtils.h"
 #include "nsProxyRelease.h"
 #include "prlog.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/Attributes.h"
 
 #include "nsXULAppAPI.h"
 
 using namespace mozilla;
 
 static const PRUint32 kRescheduleLimit = 3;
 // Max number of retries for every entry of pinned app.
 static const PRUint32 kPinnedEntryRetriesLimit = 3;
@@ -83,19 +84,19 @@ DropReferenceFromURL(nsIURI * aURI)
     // want to call aURI->CloneIgnoringRef() and use the result of that.
     return aURI->SetRef(EmptyCString());
 }
 
 //-----------------------------------------------------------------------------
 // nsManifestCheck
 //-----------------------------------------------------------------------------
 
-class nsManifestCheck : public nsIStreamListener
-                      , public nsIChannelEventSink
-                      , public nsIInterfaceRequestor
+class nsManifestCheck MOZ_FINAL : public nsIStreamListener
+                                , public nsIChannelEventSink
+                                , public nsIInterfaceRequestor
 {
 public:
     nsManifestCheck(nsOfflineCacheUpdate *aUpdate,
                     nsIURI *aURI,
                     nsIURI *aReferrerURI)
         : mUpdate(aUpdate)
         , mURI(aURI)
         , mReferrerURI(aReferrerURI)
--- a/uriloader/prefetch/nsOfflineCacheUpdate.h
+++ b/uriloader/prefetch/nsOfflineCacheUpdate.h
@@ -26,16 +26,17 @@
 #include "nsIStreamListener.h"
 #include "nsIURI.h"
 #include "nsIWebProgressListener.h"
 #include "nsClassHashtable.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsWeakReference.h"
 #include "nsICryptoHash.h"
+#include "mozilla/Attributes.h"
 
 class nsOfflineCacheUpdate;
 
 class nsICacheEntryDescriptor;
 class nsIUTF8StringEnumerator;
 
 class nsOfflineCacheUpdateItem : public nsIDOMLoadStatus
                                , public nsIStreamListener
@@ -177,20 +178,20 @@ private:
 };
 
 class nsOfflineCacheUpdateOwner
 {
 public:
     virtual nsresult UpdateFinished(nsOfflineCacheUpdate *aUpdate) = 0;
 };
 
-class nsOfflineCacheUpdate : public nsIOfflineCacheUpdate
-                           , public nsIOfflineCacheUpdateObserver
-                           , public nsIRunnable
-                           , public nsOfflineCacheUpdateOwner
+class nsOfflineCacheUpdate MOZ_FINAL : public nsIOfflineCacheUpdate
+                                     , public nsIOfflineCacheUpdateObserver
+                                     , public nsIRunnable
+                                     , public nsOfflineCacheUpdateOwner
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIOFFLINECACHEUPDATE
     NS_DECL_NSIOFFLINECACHEUPDATEOBSERVER
     NS_DECL_NSIRUNNABLE
 
     nsOfflineCacheUpdate();
@@ -288,20 +289,20 @@ private:
 
     nsRefPtr<nsOfflineCacheUpdate> mImplicitUpdate;
 
     bool                           mPinned;
 
     PRUint64                       mByteProgress;
 };
 
-class nsOfflineCacheUpdateService : public nsIOfflineCacheUpdateService
-                                  , public nsIObserver
-                                  , public nsOfflineCacheUpdateOwner
-                                  , public nsSupportsWeakReference
+class nsOfflineCacheUpdateService MOZ_FINAL : public nsIOfflineCacheUpdateService
+                                            , public nsIObserver
+                                            , public nsOfflineCacheUpdateOwner
+                                            , public nsSupportsWeakReference
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIOFFLINECACHEUPDATESERVICE
     NS_DECL_NSIOBSERVER
 
     nsOfflineCacheUpdateService();
     ~nsOfflineCacheUpdateService();
--- a/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
+++ b/uriloader/prefetch/nsOfflineCacheUpdateService.cpp
@@ -35,16 +35,17 @@
 #include "nsNetUtil.h"
 #include "nsServiceManagerUtils.h"
 #include "nsStreamUtils.h"
 #include "nsThreadUtils.h"
 #include "nsProxyRelease.h"
 #include "prlog.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/Attributes.h"
 
 using namespace mozilla;
 
 static nsOfflineCacheUpdateService *gOfflineCacheUpdateService = nsnull;
 
 typedef mozilla::docshell::OfflineCacheUpdateParent OfflineCacheUpdateParent;
 typedef mozilla::docshell::OfflineCacheUpdateChild OfflineCacheUpdateChild;
 typedef mozilla::docshell::OfflineCacheUpdateGlue OfflineCacheUpdateGlue;
@@ -73,18 +74,18 @@ private:
     PRUint32 mCount;
     char **mValues;
 };
 
 //-----------------------------------------------------------------------------
 // nsOfflineCachePendingUpdate
 //-----------------------------------------------------------------------------
 
-class nsOfflineCachePendingUpdate : public nsIWebProgressListener
-                                  , public nsSupportsWeakReference
+class nsOfflineCachePendingUpdate MOZ_FINAL : public nsIWebProgressListener
+                                            , public nsSupportsWeakReference
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIWEBPROGRESSLISTENER
 
     nsOfflineCachePendingUpdate(nsOfflineCacheUpdateService *aService,
                                 nsIURI *aManifestURI,
                                 nsIURI *aDocumentURI,
--- a/uriloader/prefetch/nsPrefetchService.cpp
+++ b/uriloader/prefetch/nsPrefetchService.cpp
@@ -21,16 +21,17 @@
 #include "nsReadableUtils.h"
 #include "nsStreamUtils.h"
 #include "nsAutoPtr.h"
 #include "prtime.h"
 #include "prlog.h"
 #include "plstr.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/Attributes.h"
 
 using namespace mozilla;
 
 #if defined(PR_LOGGING)
 //
 // To enable logging (see prlog.h for full details):
 //
 //    set NSPR_LOG_MODULES=nsPrefetch:5
@@ -61,17 +62,17 @@ PRTimeToSeconds(PRTime t_usec)
     return t_sec;
 }
 
 #define NowInSeconds() PRTimeToSeconds(PR_Now())
 
 //-----------------------------------------------------------------------------
 // nsPrefetchQueueEnumerator
 //-----------------------------------------------------------------------------
-class nsPrefetchQueueEnumerator : public nsISimpleEnumerator
+class nsPrefetchQueueEnumerator MOZ_FINAL : public nsISimpleEnumerator
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISIMPLEENUMERATOR
     nsPrefetchQueueEnumerator(nsPrefetchService *aService);
     ~nsPrefetchQueueEnumerator();
 
 private:
--- a/uriloader/prefetch/nsPrefetchService.h
+++ b/uriloader/prefetch/nsPrefetchService.h
@@ -13,29 +13,30 @@
 #include "nsIStreamListener.h"
 #include "nsIChannel.h"
 #include "nsIURI.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMLoadStatus.h"
 #include "nsWeakReference.h"
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
+#include "mozilla/Attributes.h"
 
 class nsPrefetchService;
 class nsPrefetchListener;
 class nsPrefetchNode;
 
 //-----------------------------------------------------------------------------
 // nsPrefetchService
 //-----------------------------------------------------------------------------
 
-class nsPrefetchService : public nsIPrefetchService
-                        , public nsIWebProgressListener
-                        , public nsIObserver
-                        , public nsSupportsWeakReference
+class nsPrefetchService MOZ_FINAL : public nsIPrefetchService
+                                  , public nsIWebProgressListener
+                                  , public nsIObserver
+                                  , public nsSupportsWeakReference
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIPREFETCHSERVICE
     NS_DECL_NSIWEBPROGRESSLISTENER
     NS_DECL_NSIOBSERVER
 
     nsPrefetchService();
@@ -76,20 +77,20 @@ private:
     PRInt32                           mHaveProcessed;
     bool                              mDisabled;
 };
 
 //-----------------------------------------------------------------------------
 // nsPrefetchNode
 //-----------------------------------------------------------------------------
 
-class nsPrefetchNode : public nsIDOMLoadStatus
-                     , public nsIStreamListener
-                     , public nsIInterfaceRequestor
-                     , public nsIChannelEventSink
+class nsPrefetchNode MOZ_FINAL : public nsIDOMLoadStatus
+                               , public nsIStreamListener
+                               , public nsIInterfaceRequestor
+                               , public nsIChannelEventSink
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIDOMLOADSTATUS
     NS_DECL_NSIREQUESTOBSERVER
     NS_DECL_NSISTREAMLISTENER
     NS_DECL_NSIINTERFACEREQUESTOR
     NS_DECL_NSICHANNELEVENTSINK