Bug 711799 - Add MOZ_FINAL a bunch of places to silence Clang warnings. r=dbaron
authorJeff Walden <jwalden@mit.edu>
Sat, 17 Dec 2011 22:47:45 -0500
changeset 83702 a3bade82ac92e28f49245a63f27ddafbb6c1dd6c
parent 83701 6e57fcb02e687aca62247c66986e481ade69325e
child 83703 bcf9ce858829d8f46dc8927062b16e251ebee0d5
push idunknown
push userunknown
push dateunknown
reviewersdbaron
bugs711799
milestone11.0a1
Bug 711799 - Add MOZ_FINAL a bunch of places to silence Clang warnings. r=dbaron
netwerk/base/src/nsDirectoryIndexStream.h
netwerk/base/src/nsIncrementalDownload.cpp
xpcom/base/nsConsoleService.h
xpcom/base/nsExceptionService.cpp
xpcom/base/nsExceptionService.h
xpcom/base/nsUUIDGenerator.h
xpcom/base/nsVersionComparatorImpl.h
xpcom/components/ModuleUtils.h
xpcom/ds/nsByteBuffer.h
xpcom/ds/nsSupportsPrimitives.h
xpcom/glue/nsCategoryCache.h
--- a/netwerk/base/src/nsDirectoryIndexStream.h
+++ b/netwerk/base/src/nsDirectoryIndexStream.h
@@ -33,24 +33,26 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsDirectoryIndexStream_h__
 #define nsDirectoryIndexStream_h__
 
+#include "mozilla/Attributes.h"
+
 #include "nsIFile.h"
 #include "nsString.h"
 #include "nsIInputStream.h"
 #include "nsCOMPtr.h"
 #include "nsCOMArray.h"
 #include "nsITextToSubURI.h"
 
-class nsDirectoryIndexStream : public nsIInputStream
+class nsDirectoryIndexStream MOZ_FINAL : public nsIInputStream
 {
 private:
     nsCString mBuf;
     PRInt32 mOffset;
     nsresult mStatus;
 
     PRInt32             mPos;   // position within mArray
     nsCOMArray<nsIFile> mArray; // file objects within the directory
--- a/netwerk/base/src/nsIncrementalDownload.cpp
+++ b/netwerk/base/src/nsIncrementalDownload.cpp
@@ -115,23 +115,24 @@ MakeRangeSpec(const PRInt64 &size, const
     end = maxSize;
   end -= 1;
 
   rangeSpec.AppendInt(PRInt64(end));
 }
 
 //-----------------------------------------------------------------------------
 
-class nsIncrementalDownload : public nsIIncrementalDownload
-                            , public nsIStreamListener
-                            , public nsIObserver
-                            , public nsIInterfaceRequestor
-                            , public nsIChannelEventSink
-                            , public nsSupportsWeakReference
-                            , public nsIAsyncVerifyRedirectCallback
+class nsIncrementalDownload MOZ_FINAL
+  : public nsIIncrementalDownload
+  , public nsIStreamListener
+  , public nsIObserver
+  , public nsIInterfaceRequestor
+  , public nsIChannelEventSink
+  , public nsSupportsWeakReference
+  , public nsIAsyncVerifyRedirectCallback
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIREQUEST
   NS_DECL_NSIINCREMENTALDOWNLOAD
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSIOBSERVER
--- a/xpcom/base/nsConsoleService.h
+++ b/xpcom/base/nsConsoleService.h
@@ -37,23 +37,25 @@
 
 /*
  * nsConsoleService class declaration.
  */
 
 #ifndef __nsconsoleservice_h__
 #define __nsconsoleservice_h__
 
+#include "mozilla/Attributes.h"
 #include "mozilla/Mutex.h"
+
 #include "nsCOMPtr.h"
 #include "nsHashtable.h"
 
 #include "nsIConsoleService.h"
 
-class nsConsoleService : public nsIConsoleService
+class nsConsoleService MOZ_FINAL : public nsIConsoleService
 {
 public:
     nsConsoleService();
     nsresult Init();
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSICONSOLESERVICE
 
--- a/xpcom/base/nsExceptionService.cpp
+++ b/xpcom/base/nsExceptionService.cpp
@@ -64,17 +64,17 @@ public:
   }
   nsHashKey *Clone() const {
     return new nsProviderKey(mKey);
   }
   PRUint32 GetValue() { return mKey; }
 };
 
 /** Exception Manager definition **/
-class nsExceptionManager : public nsIExceptionManager
+class nsExceptionManager MOZ_FINAL : public nsIExceptionManager
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIEXCEPTIONMANAGER
 
   nsExceptionManager(nsExceptionService *svc);
   /* additional members */
   nsCOMPtr<nsIException> mCurrentException;
--- a/xpcom/base/nsExceptionService.h
+++ b/xpcom/base/nsExceptionService.h
@@ -34,27 +34,29 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsExceptionService_h__
 #define nsExceptionService_h__
 
+#include "mozilla/Attributes.h"
 #include "mozilla/Mutex.h"
+
 #include "nsIException.h"
 #include "nsIExceptionService.h"
 #include "nsIObserverService.h"
 #include "nsHashtable.h"
 #include "nsIObserver.h"
 
 class nsExceptionManager;
 
 /** Exception Service definition **/
-class nsExceptionService : public nsIExceptionService, public nsIObserver
+class nsExceptionService MOZ_FINAL : public nsIExceptionService, public nsIObserver
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIEXCEPTIONSERVICE
   NS_DECL_NSIEXCEPTIONMANAGER
   NS_DECL_NSIOBSERVER
 
   nsExceptionService();
--- a/xpcom/base/nsUUIDGenerator.h
+++ b/xpcom/base/nsUUIDGenerator.h
@@ -34,20 +34,22 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef _NSUUIDGENERATOR_H_
 #define _NSUUIDGENERATOR_H_
 
+#include "mozilla/Attributes.h"
 #include "mozilla/Mutex.h"
+
 #include "nsIUUIDGenerator.h"
 
-class nsUUIDGenerator : public nsIUUIDGenerator {
+class nsUUIDGenerator MOZ_FINAL : public nsIUUIDGenerator {
 public:
     nsUUIDGenerator();
 
     NS_DECL_ISUPPORTS
 
     NS_DECL_NSIUUIDGENERATOR
 
     nsresult Init();
--- a/xpcom/base/nsVersionComparatorImpl.h
+++ b/xpcom/base/nsVersionComparatorImpl.h
@@ -32,17 +32,17 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIVersionComparator.h"
 
-class nsVersionComparatorImpl : public nsIVersionComparator
+class nsVersionComparatorImpl MOZ_FINAL : public nsIVersionComparator
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIVERSIONCOMPARATOR
 };
 
 #define NS_VERSIONCOMPARATOR_CONTRACTID "@mozilla.org/xpcom/version-comparator;1"
 
--- a/xpcom/components/ModuleUtils.h
+++ b/xpcom/components/ModuleUtils.h
@@ -34,16 +34,17 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef mozilla_GenericModule_h
 #define mozilla_GenericModule_h
 
+#include "mozilla/Attributes.h"
 #include "mozilla/Module.h"
 
 #define NS_GENERIC_FACTORY_CONSTRUCTOR(_InstanceClass)                        \
 static nsresult                                                               \
 _InstanceClass##Constructor(nsISupports *aOuter, REFNSIID aIID,               \
                             void **aResult)                                   \
 {                                                                             \
     nsresult rv;                                                              \
@@ -129,17 +130,17 @@ static nsresult                         
 
 #ifndef MOZILLA_INTERNAL_API
 
 #include "nsIModule.h"
 #include "nsISupportsUtils.h"
 
 namespace mozilla {
 
-class GenericModule : public nsIModule
+class GenericModule MOZ_FINAL : public nsIModule
 {
 public:
     GenericModule(const mozilla::Module* aData)
         : mData(aData)
     {
     }
 
     NS_DECL_ISUPPORTS
--- a/xpcom/ds/nsByteBuffer.h
+++ b/xpcom/ds/nsByteBuffer.h
@@ -33,19 +33,21 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsByteBuffer_h__
 #define nsByteBuffer_h__
 
+#include "mozilla/Attributes.h"
+
 #include "nsIByteBuffer.h"
 
-class ByteBufferImpl : public nsIByteBuffer {
+class ByteBufferImpl MOZ_FINAL : public nsIByteBuffer {
 public:
   ByteBufferImpl(void);
 
   NS_DECL_ISUPPORTS
 
   static nsresult
   Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
 
--- a/xpcom/ds/nsSupportsPrimitives.h
+++ b/xpcom/ds/nsSupportsPrimitives.h
@@ -34,294 +34,296 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsSupportsPrimitives_h__
 #define nsSupportsPrimitives_h__
 
+#include "mozilla/Attributes.h"
+
 #include "nsISupportsPrimitives.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsDependentString.h"
 
-class nsSupportsIDImpl : public nsISupportsID
+class nsSupportsIDImpl MOZ_FINAL : public nsISupportsID
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSID
 
     nsSupportsIDImpl();
 
 private:
     ~nsSupportsIDImpl() { }
 
     nsID *mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsCStringImpl : public nsISupportsCString
+class nsSupportsCStringImpl MOZ_FINAL : public nsISupportsCString
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSCSTRING
 
     nsSupportsCStringImpl() {}
 
 private:
     ~nsSupportsCStringImpl() {}
     
     nsCString mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsStringImpl : public nsISupportsString
+class nsSupportsStringImpl MOZ_FINAL : public nsISupportsString
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSSTRING
 
     nsSupportsStringImpl() {}
 
 private:
     ~nsSupportsStringImpl() {}
     
     nsString mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsPRBoolImpl : public nsISupportsPRBool
+class nsSupportsPRBoolImpl MOZ_FINAL : public nsISupportsPRBool
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSPRBOOL
 
     nsSupportsPRBoolImpl();
 
 private:
     ~nsSupportsPRBoolImpl() {}
 
     bool mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsPRUint8Impl : public nsISupportsPRUint8
+class nsSupportsPRUint8Impl MOZ_FINAL : public nsISupportsPRUint8
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSPRUINT8
 
     nsSupportsPRUint8Impl();
 
 private:
     ~nsSupportsPRUint8Impl() {}
 
     PRUint8 mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsPRUint16Impl : public nsISupportsPRUint16
+class nsSupportsPRUint16Impl MOZ_FINAL : public nsISupportsPRUint16
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSPRUINT16
 
     nsSupportsPRUint16Impl();
 
 private:
     ~nsSupportsPRUint16Impl() {}
 
     PRUint16 mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsPRUint32Impl : public nsISupportsPRUint32
+class nsSupportsPRUint32Impl MOZ_FINAL : public nsISupportsPRUint32
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSPRUINT32
 
     nsSupportsPRUint32Impl();
 
 private:
     ~nsSupportsPRUint32Impl() {}
 
     PRUint32 mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsPRUint64Impl : public nsISupportsPRUint64
+class nsSupportsPRUint64Impl MOZ_FINAL : public nsISupportsPRUint64
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSPRUINT64
 
     nsSupportsPRUint64Impl();
 
 private:
     ~nsSupportsPRUint64Impl() {}
 
     PRUint64 mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsPRTimeImpl : public nsISupportsPRTime
+class nsSupportsPRTimeImpl MOZ_FINAL : public nsISupportsPRTime
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSPRTIME
 
     nsSupportsPRTimeImpl();
 
 private:
     ~nsSupportsPRTimeImpl() {}
 
     PRTime mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsCharImpl : public nsISupportsChar
+class nsSupportsCharImpl MOZ_FINAL : public nsISupportsChar
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSCHAR
 
     nsSupportsCharImpl();
 
 private:
     ~nsSupportsCharImpl() {}
 
     char mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsPRInt16Impl : public nsISupportsPRInt16
+class nsSupportsPRInt16Impl MOZ_FINAL : public nsISupportsPRInt16
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSPRINT16
 
     nsSupportsPRInt16Impl();
 
 private:
     ~nsSupportsPRInt16Impl() {}
 
     PRInt16 mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsPRInt32Impl : public nsISupportsPRInt32
+class nsSupportsPRInt32Impl MOZ_FINAL : public nsISupportsPRInt32
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSPRINT32
 
     nsSupportsPRInt32Impl();
 
 private:
     ~nsSupportsPRInt32Impl() {}
 
     PRInt32 mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsPRInt64Impl : public nsISupportsPRInt64
+class nsSupportsPRInt64Impl MOZ_FINAL : public nsISupportsPRInt64
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSPRINT64
 
     nsSupportsPRInt64Impl();
 
 private:
     ~nsSupportsPRInt64Impl() {}
 
     PRInt64 mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsFloatImpl : public nsISupportsFloat
+class nsSupportsFloatImpl MOZ_FINAL : public nsISupportsFloat
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSFLOAT
 
     nsSupportsFloatImpl();
 
 private:
     ~nsSupportsFloatImpl() {}
 
     float mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsDoubleImpl : public nsISupportsDouble
+class nsSupportsDoubleImpl MOZ_FINAL : public nsISupportsDouble
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSDOUBLE
 
     nsSupportsDoubleImpl();
 
 private:
     ~nsSupportsDoubleImpl() {}
 
     double mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsVoidImpl : public nsISupportsVoid
+class nsSupportsVoidImpl MOZ_FINAL : public nsISupportsVoid
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSVOID
 
     nsSupportsVoidImpl();
 
 private:
     ~nsSupportsVoidImpl() {}
 
     void* mData;
 };
 
 /***************************************************************************/
 
-class nsSupportsInterfacePointerImpl : public nsISupportsInterfacePointer
+class nsSupportsInterfacePointerImpl MOZ_FINAL : public nsISupportsInterfacePointer
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISUPPORTSPRIMITIVE
     NS_DECL_NSISUPPORTSINTERFACEPOINTER
 
     nsSupportsInterfacePointerImpl();
 
@@ -335,17 +337,17 @@ private:
 /***************************************************************************/
 
 /**
  * Wraps a static const char* buffer for use with nsISupportsCString
  *
  * Only use this class with static buffers, or arena-allocated buffers of
  * permanent lifetime!
  */
-class nsSupportsDependentCString : public nsISupportsCString
+class nsSupportsDependentCString MOZ_FINAL : public nsISupportsCString
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSISUPPORTSPRIMITIVE
   NS_DECL_NSISUPPORTSCSTRING
 
   nsSupportsDependentCString(const char* aStr);
 
--- a/xpcom/glue/nsCategoryCache.h
+++ b/xpcom/glue/nsCategoryCache.h
@@ -32,16 +32,18 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsCategoryCache_h_
 #define nsCategoryCache_h_
 
+#include "mozilla/Attributes.h"
+
 #include "nsICategoryManager.h"
 #include "nsIObserver.h"
 #include "nsISimpleEnumerator.h"
 #include "nsISupportsPrimitives.h"
 
 #include "nsServiceManagerUtils.h"
 
 #include "nsAutoPtr.h"
@@ -57,17 +59,17 @@ class NS_NO_VTABLE nsCategoryListener {
     ~nsCategoryListener() {}
 
   public:
     virtual void EntryAdded(const nsCString& aValue) = 0;
     virtual void EntryRemoved(const nsCString& aValue) = 0;
     virtual void CategoryCleared() = 0;
 };
 
-class NS_COM_GLUE nsCategoryObserver : public nsIObserver {
+class NS_COM_GLUE nsCategoryObserver MOZ_FINAL : public nsIObserver {
   public:
     nsCategoryObserver(const char* aCategory,
                        nsCategoryListener* aCategoryListener);
     ~nsCategoryObserver();
 
     void ListenerDied();
 
     NS_DECL_ISUPPORTS