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 (content parts); r=bzbarsky
authorEhsan Akhgari <ehsan@mozilla.com>
Mon, 18 Jun 2012 22:30:09 -0400
changeset 102310 6ea80e3155b6f86a7867580776415d3d0e41e420
parent 102309 97bbf868d76d1a48fcf017e13cfb00a82a27e571
child 102311 823dc103bf3ebf860b112622dcb71425a2a606ef
push id191
push userlsblakk@mozilla.com
push dateFri, 05 Oct 2012 17:12:53 +0000
treeherdermozilla-release@ddb22ac6c03b [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 (content parts); r=bzbarsky
content/base/src/ThirdPartyUtil.h
content/base/src/nsCCUncollectableMarker.h
content/base/src/nsContentUtils.cpp
content/base/src/nsCrossSiteListenerProxy.cpp
content/base/src/nsCrossSiteListenerProxy.h
content/base/src/nsDOMBlobBuilder.h
content/base/src/nsDOMFile.cpp
content/base/src/nsDOMTokenList.h
content/base/src/nsDataDocumentContentPolicy.h
content/base/src/nsDocument.cpp
content/base/src/nsDocument.h
content/base/src/nsEventSource.cpp
content/base/src/nsFrameLoader.h
content/base/src/nsFrameMessageManager.h
content/base/src/nsGenericElement.h
content/base/src/nsMappedAttributes.h
content/base/src/nsNoDataProtocolContentPolicy.h
content/base/src/nsScriptLoader.cpp
content/base/src/nsXMLHttpRequest.cpp
content/events/src/nsDOMDataTransfer.h
content/events/src/nsDOMDeviceMotionEvent.h
content/events/src/nsDOMEventTargetHelper.h
content/events/src/nsDOMTouchEvent.h
content/events/src/nsEventListenerService.h
content/events/src/nsEventStateManager.cpp
content/events/src/nsIMEStateManager.cpp
content/events/src/nsPaintRequest.h
content/events/src/nsPrivateTextRange.h
content/events/src/nsXMLEventsManager.h
content/media/MediaResource.h
content/media/MediaStreamGraph.cpp
content/media/nsMediaCache.cpp
content/svg/content/src/DOMSVGAnimatedLengthList.h
content/svg/content/src/DOMSVGAnimatedNumberList.h
content/svg/content/src/DOMSVGAnimatedTransformList.h
content/svg/content/src/DOMSVGLength.h
content/svg/content/src/DOMSVGLengthList.h
content/svg/content/src/DOMSVGMatrix.h
content/svg/content/src/DOMSVGNumber.h
content/svg/content/src/DOMSVGNumberList.h
content/svg/content/src/DOMSVGPathSegList.h
content/svg/content/src/DOMSVGPoint.h
content/svg/content/src/DOMSVGPointList.h
content/svg/content/src/DOMSVGStringList.h
content/svg/content/src/DOMSVGTests.h
content/svg/content/src/DOMSVGTransform.h
content/svg/content/src/DOMSVGTransformList.h
content/svg/content/src/SVGAnimatedPreserveAspectRatio.h
content/svg/content/src/nsSVGAngle.cpp
content/svg/content/src/nsSVGAngle.h
content/svg/content/src/nsSVGBoolean.h
content/svg/content/src/nsSVGClass.h
content/svg/content/src/nsSVGEnum.h
content/svg/content/src/nsSVGInteger.h
content/svg/content/src/nsSVGIntegerPair.h
content/svg/content/src/nsSVGMarkerElement.h
content/svg/content/src/nsSVGNumber2.cpp
content/svg/content/src/nsSVGNumber2.h
content/svg/content/src/nsSVGNumberPair.h
content/svg/content/src/nsSVGRect.h
content/svg/content/src/nsSVGSVGElement.h
content/svg/content/src/nsSVGString.h
content/svg/content/src/nsSVGViewBox.h
content/xbl/src/nsXBLService.cpp
content/xslt/src/xpath/nsXPathEvaluator.h
content/xslt/src/xpath/nsXPathExpression.h
content/xslt/src/xpath/nsXPathNSResolver.h
content/xslt/src/xpath/nsXPathResult.h
content/xslt/src/xpath/txXPCOMExtensionFunction.cpp
content/xslt/src/xpath/txXPathObjectAdaptor.h
content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp
content/xslt/src/xslt/txMozillaXMLOutput.h
content/xslt/src/xslt/txMozillaXSLTProcessor.h
content/xtf/src/nsXMLContentBuilder.cpp
content/xtf/src/nsXTFElementWrapper.h
content/xtf/src/nsXTFInterfaceAggregator.cpp
content/xtf/src/nsXTFService.cpp
content/xtf/src/nsXTFWeakTearoff.cpp
content/xul/content/src/nsXULElement.cpp
content/xul/templates/src/nsRDFQuery.h
content/xul/templates/src/nsXMLBinding.h
content/xul/templates/src/nsXULTemplateQueryProcessorRDF.h
content/xul/templates/src/nsXULTemplateQueryProcessorStorage.h
content/xul/templates/src/nsXULTemplateQueryProcessorXML.h
content/xul/templates/src/nsXULTemplateResultRDF.h
content/xul/templates/src/nsXULTemplateResultSetRDF.h
content/xul/templates/src/nsXULTemplateResultStorage.h
content/xul/templates/src/nsXULTemplateResultXML.h
layout/forms/nsFileControlFrame.h
layout/printing/nsPagePrintTimer.h
layout/printing/nsPrintEngine.h
layout/printing/nsPrintPreviewListener.h
layout/style/AnimationCommon.h
layout/style/Loader.h
layout/xul/base/src/tree/src/nsTreeColumns.h
layout/xul/base/src/tree/src/nsTreeContentView.h
layout/xul/base/src/tree/src/nsTreeImageListener.h
--- a/content/base/src/ThirdPartyUtil.h
+++ b/content/base/src/ThirdPartyUtil.h
@@ -4,22 +4,23 @@
 
 #ifndef ThirdPartyUtil_h__
 #define ThirdPartyUtil_h__
 
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "mozIThirdPartyUtil.h"
 #include "nsIEffectiveTLDService.h"
+#include "mozilla/Attributes.h"
 
 class nsIURI;
 class nsIChannel;
 class nsIDOMWindow;
 
-class ThirdPartyUtil : public mozIThirdPartyUtil
+class ThirdPartyUtil MOZ_FINAL : public mozIThirdPartyUtil
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_MOZITHIRDPARTYUTIL
 
   nsresult Init();
 
 private:
--- a/content/base/src/nsCCUncollectableMarker.h
+++ b/content/base/src/nsCCUncollectableMarker.h
@@ -1,19 +1,20 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsIObserver.h"
 #include "nsCycleCollectionParticipant.h"
+#include "mozilla/Attributes.h"
 
 struct JSTracer;
 
-class nsCCUncollectableMarker : public nsIObserver
+class nsCCUncollectableMarker MOZ_FINAL : public nsIObserver
 {
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
   /**
    * Inits a global nsCCUncollectableMarker. Should only be called once.
    */
   static nsresult Init();
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -176,16 +176,17 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_
 
 #include "nsWrapperCacheInlines.h"
 #include "nsIDOMDocumentType.h"
 #include "nsCharSeparatedTokenizer.h"
 
 #include "nsICharsetDetector.h"
 #include "nsICharsetDetectionObserver.h"
 #include "nsIPlatformCharset.h"
+#include "mozilla/Attributes.h"
 
 extern "C" int MOZ_XMLTranslateEntity(const char* ptr, const char* end,
                                       const char** next, PRUnichar* result);
 extern "C" int MOZ_XMLCheckQName(const char* ptr, const char* end,
                                  int ns_aware, const char** colon);
 
 using namespace mozilla::dom;
 using namespace mozilla::layers;
@@ -302,25 +303,25 @@ EventListenerManagerHashClearEntry(PLDHa
 {
   EventListenerManagerMapEntry *lm =
     static_cast<EventListenerManagerMapEntry *>(entry);
 
   // Let the EventListenerManagerMapEntry clean itself up...
   lm->~EventListenerManagerMapEntry();
 }
 
-class SameOriginChecker : public nsIChannelEventSink,
-                          public nsIInterfaceRequestor
+class SameOriginChecker MOZ_FINAL : public nsIChannelEventSink,
+                                    public nsIInterfaceRequestor
 {
   NS_DECL_ISUPPORTS
   NS_DECL_NSICHANNELEVENTSINK
   NS_DECL_NSIINTERFACEREQUESTOR
 };
 
-class CharsetDetectionObserver : public nsICharsetDetectionObserver
+class CharsetDetectionObserver MOZ_FINAL : public nsICharsetDetectionObserver
 {
 public:
   NS_DECL_ISUPPORTS
 
   NS_IMETHOD Notify(const char *aCharset, nsDetectionConfident aConf)
   {
     mCharset = aCharset;
     return NS_OK;
--- a/content/base/src/nsCrossSiteListenerProxy.cpp
+++ b/content/base/src/nsCrossSiteListenerProxy.cpp
@@ -804,19 +804,19 @@ nsCORSListenerProxy::UpdateChannel(nsICh
   return NS_OK;
 }
 
 //////////////////////////////////////////////////////////////////////////
 // Preflight proxy
 
 // Class used as streamlistener and notification callback when
 // doing the initial OPTIONS request for a CORS check
-class nsCORSPreflightListener : public nsIStreamListener,
-                                public nsIInterfaceRequestor,
-                                public nsIChannelEventSink
+class nsCORSPreflightListener MOZ_FINAL : public nsIStreamListener,
+                                          public nsIInterfaceRequestor,
+                                          public nsIChannelEventSink
 {
 public:
   nsCORSPreflightListener(nsIChannel* aOuterChannel,
                           nsIStreamListener* aOuterListener,
                           nsISupports* aOuterContext,
                           nsIPrincipal* aReferrerPrincipal,
                           const nsACString& aRequestMethod,
                           bool aWithCredentials)
--- a/content/base/src/nsCrossSiteListenerProxy.h
+++ b/content/base/src/nsCrossSiteListenerProxy.h
@@ -10,36 +10,37 @@
 #include "nsIInterfaceRequestor.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
 #include "nsIURI.h"
 #include "nsTArray.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIChannelEventSink.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
+#include "mozilla/Attributes.h"
 
 class nsIURI;
 class nsIParser;
 class nsIPrincipal;
 
 extern bool
 IsValidHTTPToken(const nsCSubstring& aToken);
 
 nsresult
 NS_StartCORSPreflight(nsIChannel* aRequestChannel,
                       nsIStreamListener* aListener,
                       nsIPrincipal* aPrincipal,
                       bool aWithCredentials,
                       nsTArray<nsCString>& aACUnsafeHeaders,
                       nsIChannel** aPreflightChannel);
 
-class nsCORSListenerProxy : public nsIStreamListener,
-                            public nsIInterfaceRequestor,
-                            public nsIChannelEventSink,
-                            public nsIAsyncVerifyRedirectCallback
+class nsCORSListenerProxy MOZ_FINAL : public nsIStreamListener,
+                                      public nsIInterfaceRequestor,
+                                      public nsIChannelEventSink,
+                                      public nsIAsyncVerifyRedirectCallback
 {
 public:
   nsCORSListenerProxy(nsIStreamListener* aOuter,
                       nsIPrincipal* aRequestingPrincipal,
                       nsIChannel* aChannel,
                       bool aWithCredentials,
                       nsresult* aResult);
   nsCORSListenerProxy(nsIStreamListener* aOuter,
--- a/content/base/src/nsDOMBlobBuilder.h
+++ b/content/base/src/nsDOMBlobBuilder.h
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsDOMBlobBuilder_h
 #define nsDOMBlobBuilder_h
 
 #include "nsDOMFile.h"
 
 #include "mozilla/CheckedInt.h"
+#include "mozilla/Attributes.h"
 
 using namespace mozilla;
 
 class nsDOMMultipartFile : public nsDOMFile,
                            public nsIJSNativeInitializer
 {
 public:
   // Create as a file
@@ -136,18 +137,18 @@ protected:
   }
 
   nsTArray<nsCOMPtr<nsIDOMBlob> > mBlobs;
   void* mData;
   PRUint64 mDataLen;
   PRUint64 mDataBufferLen;
 };
 
-class nsDOMBlobBuilder : public nsIDOMMozBlobBuilder,
-                         public nsIJSNativeInitializer
+class nsDOMBlobBuilder MOZ_FINAL : public nsIDOMMozBlobBuilder,
+                                   public nsIJSNativeInitializer
 {
 public:
   nsDOMBlobBuilder()
     : mBlobSet()
   {}
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMMOZBLOBBUILDER
--- a/content/base/src/nsDOMFile.cpp
+++ b/content/base/src/nsDOMFile.cpp
@@ -26,31 +26,32 @@
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
 #include "nsIUUIDGenerator.h"
 #include "nsBlobProtocolHandler.h"
 #include "nsStringStream.h"
 #include "nsJSUtils.h"
 #include "mozilla/CheckedInt.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/Attributes.h"
 
 #include "plbase64.h"
 #include "prmem.h"
 #include "dombindings.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 // XXXkhuey the input stream that we pass out of a DOMFile
 // can outlive the actual DOMFile object.  Thus, we must
 // ensure that the buffer underlying the stream we get
 // from NS_NewByteInputStream is held alive as long as the
 // stream is.  We do that by passing back this class instead.
-class DataOwnerAdapter : public nsIInputStream,
-                         public nsISeekableStream
+class DataOwnerAdapter MOZ_FINAL : public nsIInputStream,
+                                   public nsISeekableStream
 {
   typedef nsDOMMemoryFile::DataOwner DataOwner;
 public:
   static nsresult Create(DataOwner* aDataOwner,
                          PRUint32 aStart,
                          PRUint32 aLength,
                          nsIInputStream** _retval);
 
--- a/content/base/src/nsDOMTokenList.h
+++ b/content/base/src/nsDOMTokenList.h
@@ -39,17 +39,17 @@ public:
   const nsAttrValue* GetParsedAttr() {
     if (!mElement) {
       return nsnull;
     }
     return mElement->GetAttrInfo(kNameSpaceID_None, mAttrAtom).mValue;
   }
 
 protected:
-  ~nsDOMTokenList();
+  virtual ~nsDOMTokenList();
 
   nsresult CheckToken(const nsAString& aStr);
   void AddInternal(const nsAttrValue* aAttr, const nsAString& aToken);
   void RemoveInternal(const nsAttrValue* aAttr, const nsAString& aToken);
 
   nsGenericElement* mElement;
   nsCOMPtr<nsIAtom> mAttrAtom;
 };
--- a/content/base/src/nsDataDocumentContentPolicy.h
+++ b/content/base/src/nsDataDocumentContentPolicy.h
@@ -15,18 +15,19 @@
 /* 1147d32c-215b-4014-b180-07fe7aedf915 */
 #define NS_DATADOCUMENTCONTENTPOLICY_CID \
  {0x1147d32c, 0x215b, 0x4014, {0xb1, 0x80, 0x07, 0xfe, 0x7a, 0xed, 0xf9, 0x15}}
 #define NS_DATADOCUMENTCONTENTPOLICY_CONTRACTID \
  "@mozilla.org/data-document-content-policy;1"
 
 
 #include "nsIContentPolicy.h"
+#include "mozilla/Attributes.h"
 
-class nsDataDocumentContentPolicy : public nsIContentPolicy
+class nsDataDocumentContentPolicy MOZ_FINAL : public nsIContentPolicy
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSICONTENTPOLICY
 
   nsDataDocumentContentPolicy()
   {}
   ~nsDataDocumentContentPolicy()
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -1164,18 +1164,17 @@ nsExternalResourceMap::ExternalResource:
 
 // ==================================================================
 // =
 // ==================================================================
 
 // If we ever have an nsIDocumentObserver notification for stylesheet title
 // changes, we could make this inherit from nsDOMStringList instead of
 // reimplementing nsIDOMDOMStringList.
-class nsDOMStyleSheetSetList : public nsIDOMDOMStringList
-                          
+class nsDOMStyleSheetSetList MOZ_FINAL : public nsIDOMDOMStringList
 {
 public:
   NS_DECL_ISUPPORTS
 
   NS_DECL_NSIDOMDOMSTRINGLIST
 
   nsDOMStyleSheetSetList(nsIDocument* aDocument);
 
@@ -7682,17 +7681,17 @@ nsDocument::GetDocumentState()
 }
 
 namespace {
 
 /**
  * Stub for LoadSheet(), since all we want is to get the sheet into
  * the CSSLoader's style cache
  */
-class StubCSSLoaderObserver : public nsICSSLoaderObserver {
+class StubCSSLoaderObserver MOZ_FINAL : public nsICSSLoaderObserver {
 public:
   NS_IMETHOD
   StyleSheetLoaded(nsCSSStyleSheet*, bool, nsresult)
   {
     return NS_OK;
   }
   NS_DECL_ISUPPORTS
 };
--- a/content/base/src/nsDocument.h
+++ b/content/base/src/nsDocument.h
@@ -63,16 +63,17 @@
 #include "nsISecurityEventSink.h"
 #include "nsIChannelEventSink.h"
 #include "imgIRequest.h"
 #include "nsIDOMDOMImplementation.h"
 #include "nsIDOMTouchEvent.h"
 #include "nsIInlineEventHandlers.h"
 #include "nsDataHashtable.h"
 #include "mozilla/TimeStamp.h"
+#include "mozilla/Attributes.h"
 
 #define XML_DECLARATION_BITS_DECLARATION_EXISTS   (1 << 0)
 #define XML_DECLARATION_BITS_ENCODING_EXISTS      (1 << 1)
 #define XML_DECLARATION_BITS_STANDALONE_EXISTS    (1 << 2)
 #define XML_DECLARATION_BITS_STANDALONE_YES       (1 << 3)
 
 
 class nsEventListenerManager;
@@ -281,17 +282,17 @@ public:
     return static_cast<nsDOMStyleSheetList*>(list);
   }
 
 protected:
   PRInt32       mLength;
   nsIDocument*  mDocument;
 };
 
-class nsOnloadBlocker : public nsIRequest
+class nsOnloadBlocker MOZ_FINAL : public nsIRequest
 {
 public:
   nsOnloadBlocker() {}
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIREQUEST
 
 private:
@@ -383,17 +384,17 @@ protected:
 
   private:
     nsRefPtr<nsDocument> mDisplayDocument;
     nsCOMPtr<nsIStreamListener> mTargetListener;
     nsCOMPtr<nsIURI> mURI;
   };
   friend class PendingLoad;
 
-  class LoadgroupCallbacks : public nsIInterfaceRequestor
+  class LoadgroupCallbacks MOZ_FINAL : public nsIInterfaceRequestor
   {
   public:
     LoadgroupCallbacks(nsIInterfaceRequestor* aOtherCallbacks)
       : mCallbacks(aOtherCallbacks)
     {}
     NS_DECL_ISUPPORTS
     NS_DECL_NSIINTERFACEREQUESTOR
   private:
@@ -404,18 +405,18 @@ protected:
 
     // Use shims for interfaces that docshell implements directly so that we
     // don't hand out references to the docshell.  The shims should all allow
     // getInterface back on us, but other than that each one should only
     // implement one interface.
     
     // XXXbz I wish we could just derive the _allcaps thing from _i
 #define DECL_SHIM(_i, _allcaps)                                              \
-    class _i##Shim : public nsIInterfaceRequestor,                           \
-                     public _i                                               \
+    class _i##Shim MOZ_FINAL : public nsIInterfaceRequestor,                 \
+                               public _i                                     \
     {                                                                        \
     public:                                                                  \
       _i##Shim(nsIInterfaceRequestor* aIfreq, _i* aRealPtr)                  \
         : mIfReq(aIfreq), mRealPtr(aRealPtr)                                 \
       {                                                                      \
         NS_ASSERTION(mIfReq, "Expected non-null here");                      \
         NS_ASSERTION(mRealPtr, "Expected non-null here");                    \
       }                                                                      \
--- a/content/base/src/nsEventSource.cpp
+++ b/content/base/src/nsEventSource.cpp
@@ -26,16 +26,17 @@
 #include "nsIChannelPolicy.h"
 #include "nsIContentSecurityPolicy.h"
 #include "nsContentUtils.h"
 #include "mozilla/Preferences.h"
 #include "xpcpublic.h"
 #include "nsCrossSiteListenerProxy.h"
 #include "nsWrapperCacheInlines.h"
 #include "nsDOMEventTargetHelper.h"
+#include "mozilla/Attributes.h"
 
 using namespace mozilla;
 
 #define REPLACEMENT_CHAR     (PRUnichar)0xFFFD
 #define BOM_CHAR             (PRUnichar)0xFEFF
 #define SPACE_CHAR           (PRUnichar)0x0020
 #define CR_CHAR              (PRUnichar)0x000D
 #define LF_CHAR              (PRUnichar)0x000A
@@ -633,17 +634,17 @@ nsEventSource::OnStopRequest(nsIRequest 
 
   return healthOfRequestResult;
 }
 
 /**
  * Simple helper class that just forwards the redirect callback back
  * to the nsEventSource.
  */
-class AsyncVerifyRedirectCallbackFwr : public nsIAsyncVerifyRedirectCallback
+class AsyncVerifyRedirectCallbackFwr MOZ_FINAL : public nsIAsyncVerifyRedirectCallback
 {
 public:
   AsyncVerifyRedirectCallbackFwr(nsEventSource* aEventsource)
     : mEventSource(aEventsource)
   {
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
--- a/content/base/src/nsFrameLoader.h
+++ b/content/base/src/nsFrameLoader.h
@@ -16,16 +16,17 @@
 #include "nsIFrameLoader.h"
 #include "nsPoint.h"
 #include "nsSize.h"
 #include "nsIURI.h"
 #include "nsAutoPtr.h"
 #include "nsFrameMessageManager.h"
 #include "Layers.h"
 #include "mozilla/dom/Element.h"
+#include "mozilla/Attributes.h"
 
 class nsIURI;
 class nsSubDocumentFrame;
 class nsIView;
 class nsIInProcessContentFrameMessageManager;
 class AutoResetInShow;
 class nsITabParent;
 
@@ -51,17 +52,17 @@ class QX11EmbedContainer;
  * Defines a target configuration for this <browser>'s content
  * document's view.  If the content document's actual view
  * doesn't match this nsIContentView, then on paints its pixels
  * are transformed to compensate for the difference.
  *
  * Used to support asynchronous re-paints of content pixels; see
  * nsIContentView.
  */
-class nsContentView : public nsIContentView
+class nsContentView MOZ_FINAL : public nsIContentView
 {
 public:
   typedef mozilla::layers::FrameMetrics::ViewID ViewID;
   NS_DECL_ISUPPORTS
   NS_DECL_NSICONTENTVIEW
  
   struct ViewConfig {
     ViewConfig()
@@ -128,18 +129,18 @@ public:
 private:
   nsresult Update(const ViewConfig& aConfig);
 
   ViewID mScrollId;
   ViewConfig mConfig;
 };
 
 
-class nsFrameLoader : public nsIFrameLoader,
-                      public nsIContentViewManager
+class nsFrameLoader MOZ_FINAL : public nsIFrameLoader,
+                                public nsIContentViewManager
 {
   friend class AutoResetInShow;
   typedef mozilla::dom::PBrowserParent PBrowserParent;
   typedef mozilla::dom::TabParent TabParent;
   typedef mozilla::layout::RenderFrameParent RenderFrameParent;
 
 protected:
   nsFrameLoader(mozilla::dom::Element* aOwner, bool aNetworkCreated);
--- a/content/base/src/nsFrameMessageManager.h
+++ b/content/base/src/nsFrameMessageManager.h
@@ -15,16 +15,17 @@
 #include "nsCycleCollectionParticipant.h"
 #include "nsTArray.h"
 #include "nsIPrincipal.h"
 #include "nsIXPConnect.h"
 #include "nsDataHashtable.h"
 #include "mozilla/Services.h"
 #include "nsIObserverService.h"
 #include "nsThreadUtils.h"
+#include "mozilla/Attributes.h"
 
 namespace mozilla {
 namespace dom {
 class ContentParent;
 }
 }
 
 class nsAXPCNativeCallContext;
@@ -41,18 +42,18 @@ typedef bool (*nsLoadScriptCallback)(voi
 typedef bool (*nsSyncMessageCallback)(void* aCallbackData,
                                       const nsAString& aMessage,
                                       const nsAString& aJSON,
                                       InfallibleTArray<nsString>* aJSONRetVal);
 typedef bool (*nsAsyncMessageCallback)(void* aCallbackData,
                                        const nsAString& aMessage,
                                        const nsAString& aJSON);
 
-class nsFrameMessageManager : public nsIContentFrameMessageManager,
-                              public nsIChromeFrameMessageManager
+class nsFrameMessageManager MOZ_FINAL : public nsIContentFrameMessageManager,
+                                        public nsIChromeFrameMessageManager
 {
 public:
   nsFrameMessageManager(bool aChrome,
                         nsSyncMessageCallback aSyncCallback,
                         nsAsyncMessageCallback aAsyncCallback,
                         nsLoadScriptCallback aLoadScriptCallback,
                         void* aCallbackData,
                         nsFrameMessageManager* aParentManager,
@@ -231,17 +232,17 @@ public:
         mExec->mDelayedCxDestroy) {
       mExec->DestroyCx();
     }
   }
   nsCOMPtr<nsISupports> mOwner;
   nsFrameScriptExecutor* mExec;
 };
 
-class nsScriptCacheCleaner : public nsIObserver
+class nsScriptCacheCleaner MOZ_FINAL : public nsIObserver
 {
   NS_DECL_ISUPPORTS
 
   nsScriptCacheCleaner()
   {
     nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
     if (obsSvc)
       obsSvc->AddObserver(this, "xpcom-shutdown", false);
--- a/content/base/src/nsGenericElement.h
+++ b/content/base/src/nsGenericElement.h
@@ -29,16 +29,17 @@
 #include "nsIDOMXPathNSResolver.h"
 #include "nsPresContext.h"
 #include "nsIDOMDOMStringMap.h"
 #include "nsContentList.h"
 #include "nsDOMClassInfoID.h" // DOMCI_DATA
 #include "nsIDOMTouchEvent.h"
 #include "nsIInlineEventHandlers.h"
 #include "mozilla/CORSMode.h"
+#include "mozilla/Attributes.h"
 
 #include "nsISMILAttr.h"
 
 class nsIDOMAttr;
 class nsIDOMEventListener;
 class nsIFrame;
 class nsIDOMNamedNodeMap;
 class nsICSSDeclaration;
@@ -57,17 +58,17 @@ struct nsRect;
 typedef PRUptrdiff PtrBits;
 
 /**
  * Class that implements the nsIDOMNodeList interface (a list of children of
  * the content), by holding a reference to the content and delegating GetLength
  * and Item to its existing child list.
  * @see nsIDOMNodeList
  */
-class nsChildContentList : public nsINodeList
+class nsChildContentList MOZ_FINAL : public nsINodeList
 {
 public:
   nsChildContentList(nsINode* aNode)
     : mNode(aNode)
   {
     SetIsDOMBinding();
   }
 
@@ -121,17 +122,17 @@ protected:
 private:
   nsCOMPtr<nsINode> mNode;
 };
 
 /**
  * A class that implements nsIWeakReference
  */
 
-class nsNodeWeakReference : public nsIWeakReference
+class nsNodeWeakReference MOZ_FINAL : public nsIWeakReference
 {
 public:
   nsNodeWeakReference(nsINode* aNode)
     : mNode(aNode)
   {
   }
 
   ~nsNodeWeakReference();
@@ -149,17 +150,17 @@ public:
 
 private:
   nsINode* mNode;
 };
 
 /**
  * Tearoff to use for nodes to implement nsISupportsWeakReference
  */
-class nsNodeSupportsWeakRefTearoff : public nsISupportsWeakReference
+class nsNodeSupportsWeakRefTearoff MOZ_FINAL : public nsISupportsWeakReference
 {
 public:
   nsNodeSupportsWeakRefTearoff(nsINode* aNode)
     : mNode(aNode)
   {
   }
 
   // nsISupports
@@ -172,17 +173,17 @@ public:
 
 private:
   nsCOMPtr<nsINode> mNode;
 };
 
 /**
  * A tearoff class for nsGenericElement to implement NodeSelector
  */
-class nsNodeSelectorTearoff : public nsIDOMNodeSelector
+class nsNodeSelectorTearoff MOZ_FINAL : public nsIDOMNodeSelector
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   NS_DECL_NSIDOMNODESELECTOR
 
   NS_DECL_CYCLE_COLLECTION_CLASS(nsNodeSelectorTearoff)
 
@@ -1033,17 +1034,17 @@ nsresult                                
   _class::Set##_method(const nsAString& aValue)                         \
   {                                                                     \
     return SetAttr(kNameSpaceID_None, nsGkAtoms::_atom, nsnull, aValue, true); \
   }
 
 /**
  * Tearoff class to implement nsITouchEventReceiver
  */
-class nsTouchEventReceiverTearoff : public nsITouchEventReceiver
+class nsTouchEventReceiverTearoff MOZ_FINAL : public nsITouchEventReceiver
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   NS_FORWARD_NSITOUCHEVENTRECEIVER(mElement->)
 
   NS_DECL_CYCLE_COLLECTION_CLASS(nsTouchEventReceiverTearoff)
 
@@ -1053,17 +1054,17 @@ public:
 
 private:
   nsRefPtr<nsGenericElement> mElement;
 };
 
 /**
  * Tearoff class to implement nsIInlineEventHandlers
  */
-class nsInlineEventHandlersTearoff : public nsIInlineEventHandlers
+class nsInlineEventHandlersTearoff MOZ_FINAL : public nsIInlineEventHandlers
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   NS_FORWARD_NSIINLINEEVENTHANDLERS(mElement->)
 
   NS_DECL_CYCLE_COLLECTION_CLASS(nsInlineEventHandlersTearoff)
 
--- a/content/base/src/nsMappedAttributes.h
+++ b/content/base/src/nsMappedAttributes.h
@@ -9,22 +9,23 @@
  */
 
 #ifndef nsMappedAttributes_h___
 #define nsMappedAttributes_h___
 
 #include "nsAttrAndChildArray.h"
 #include "nsMappedAttributeElement.h"
 #include "nsIStyleRule.h"
+#include "mozilla/Attributes.h"
 
 class nsIAtom;
 class nsHTMLStyleSheet;
 class nsRuleWalker;
 
-class nsMappedAttributes : public nsIStyleRule
+class nsMappedAttributes MOZ_FINAL : public nsIStyleRule
 {
 public:
   nsMappedAttributes(nsHTMLStyleSheet* aSheet,
                      nsMapRuleToAttributesFunc aMapRuleFunc);
 
   void* operator new(size_t size, PRUint32 aAttrCount = 1) CPP_THROW_NEW;
 
   nsMappedAttributes* Clone(bool aWillAddAttr);
--- a/content/base/src/nsNoDataProtocolContentPolicy.h
+++ b/content/base/src/nsNoDataProtocolContentPolicy.h
@@ -15,18 +15,19 @@
 /* ac9e3e82-bfbd-4f26-941e-f58c8ee178c1 */
 #define NS_NODATAPROTOCOLCONTENTPOLICY_CID \
  {0xac9e3e82, 0xbfbd, 0x4f26, {0x94, 0x1e, 0xf5, 0x8c, 0x8e, 0xe1, 0x78, 0xc1}}
 #define NS_NODATAPROTOCOLCONTENTPOLICY_CONTRACTID \
  "@mozilla.org/no-data-protocol-content-policy;1"
 
 
 #include "nsIContentPolicy.h"
+#include "mozilla/Attributes.h"
 
-class nsNoDataProtocolContentPolicy : public nsIContentPolicy
+class nsNoDataProtocolContentPolicy MOZ_FINAL : public nsIContentPolicy
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSICONTENTPOLICY
 
   nsNoDataProtocolContentPolicy()
   {}
   ~nsNoDataProtocolContentPolicy()
--- a/content/base/src/nsScriptLoader.cpp
+++ b/content/base/src/nsScriptLoader.cpp
@@ -40,29 +40,30 @@
 #include "nsChannelPolicy.h"
 #include "nsCRT.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsGenericElement.h"
 #include "nsCrossSiteListenerProxy.h"
 
 #include "mozilla/FunctionTimer.h"
 #include "mozilla/CORSMode.h"
+#include "mozilla/Attributes.h"
 
 #ifdef PR_LOGGING
 static PRLogModuleInfo* gCspPRLog;
 #endif
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 //////////////////////////////////////////////////////////////
 // Per-request data structure
 //////////////////////////////////////////////////////////////
 
-class nsScriptLoadRequest : public nsISupports {
+class nsScriptLoadRequest MOZ_FINAL : public nsISupports {
 public:
   nsScriptLoadRequest(nsIScriptElement* aElement,
                       PRUint32 aVersion,
                       CORSMode aCORSMode)
     : mElement(aElement),
       mLoading(true),
       mIsInline(true),
       mJSVersion(aVersion),
--- a/content/base/src/nsXMLHttpRequest.cpp
+++ b/content/base/src/nsXMLHttpRequest.cpp
@@ -71,16 +71,17 @@
 #include "nsDOMFile.h"
 #include "nsIFileChannel.h"
 #include "mozilla/Telemetry.h"
 #include "jsfriendapi.h"
 #include "sampler.h"
 #include "mozilla/dom/XMLHttpRequestBinding.h"
 #include "nsIDOMFormData.h"
 #include "DictionaryHelpers.h"
+#include "mozilla/Attributes.h"
 
 #include "nsWrapperCacheInlines.h"
 #include "nsStreamListenerWrapper.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 #define LOAD_STR "load"
@@ -3541,17 +3542,17 @@ nsXMLHttpRequest::ChangeState(PRUint32 a
 
   return rv;
 }
 
 /*
  * Simple helper class that just forwards the redirect callback back
  * to the nsXMLHttpRequest.
  */
-class AsyncVerifyRedirectCallbackForwarder : public nsIAsyncVerifyRedirectCallback
+class AsyncVerifyRedirectCallbackForwarder MOZ_FINAL : public nsIAsyncVerifyRedirectCallback
 {
 public:
   AsyncVerifyRedirectCallbackForwarder(nsXMLHttpRequest *xhr)
     : mXHR(xhr)
   {
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
--- a/content/events/src/nsDOMDataTransfer.h
+++ b/content/events/src/nsDOMDataTransfer.h
@@ -13,33 +13,34 @@
 #include "nsIDOMDataTransfer.h"
 #include "nsIDragService.h"
 #include "nsIDOMElement.h"
 #include "nsCycleCollectionParticipant.h"
 
 #include "nsAutoPtr.h"
 #include "nsIFile.h"
 #include "nsDOMFile.h"
+#include "mozilla/Attributes.h"
 
 class nsITransferable;
 
 /**
  * TransferItem is used to hold data for a particular format. Each piece of
  * data has a principal set from the caller which added it. This allows a
  * caller that wishes to retrieve the data to only be able to access the data
  * it is allowed to, yet still allow a chrome caller to retrieve any of the
  * data.
  */
 struct TransferItem {
   nsString mFormat;
   nsCOMPtr<nsIPrincipal> mPrincipal;
   nsCOMPtr<nsIVariant> mData;
 };
 
-class nsDOMDataTransfer : public nsIDOMDataTransfer
+class nsDOMDataTransfer MOZ_FINAL : public nsIDOMDataTransfer
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_NSIDOMDATATRANSFER
 
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsDOMDataTransfer, nsIDOMDataTransfer)
 
   friend class nsDOMDragEvent;
--- a/content/events/src/nsDOMDeviceMotionEvent.h
+++ b/content/events/src/nsDOMDeviceMotionEvent.h
@@ -2,49 +2,50 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsDOMDeviceMotionEvent_h__
 #define nsDOMDeviceMotionEvent_h__
 
 #include "nsIDOMDeviceMotionEvent.h"
 #include "nsDOMEvent.h"
+#include "mozilla/Attributes.h"
 
-class nsDOMDeviceRotationRate : public nsIDOMDeviceRotationRate
+class nsDOMDeviceRotationRate MOZ_FINAL : public nsIDOMDeviceRotationRate
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMDEVICEROTATIONRATE
 
   nsDOMDeviceRotationRate(double aAlpha, double aBeta, double aGamma);
 
 private:
   ~nsDOMDeviceRotationRate();
 
 protected:
   double mAlpha, mBeta, mGamma;
 };
 
-class nsDOMDeviceAcceleration : public nsIDOMDeviceAcceleration
+class nsDOMDeviceAcceleration MOZ_FINAL : public nsIDOMDeviceAcceleration
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMDEVICEACCELERATION
 
   nsDOMDeviceAcceleration(double aX, double aY, double aZ);
 
 private:
   ~nsDOMDeviceAcceleration();
 
 protected:
   double mX, mY, mZ;
 };
 
-class nsDOMDeviceMotionEvent : public nsDOMEvent,
-                               public nsIDOMDeviceMotionEvent
+class nsDOMDeviceMotionEvent MOZ_FINAL : public nsDOMEvent,
+                                         public nsIDOMDeviceMotionEvent
 {
 public:
 
   nsDOMDeviceMotionEvent(nsPresContext* aPresContext, nsEvent* aEvent)
   : nsDOMEvent(aPresContext, aEvent)
   {}
 
   NS_DECL_ISUPPORTS_INHERITED
--- a/content/events/src/nsDOMEventTargetHelper.h
+++ b/content/events/src/nsDOMEventTargetHelper.h
@@ -12,18 +12,19 @@
 #include "nsIDOMEventListener.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsPIDOMWindow.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsEventListenerManager.h"
 #include "nsIScriptContext.h"
 #include "nsWrapperCache.h"
 #include "mozilla/ErrorResult.h"
+#include "mozilla/Attributes.h"
 
-class nsDOMEventListenerWrapper : public nsIDOMEventListener
+class nsDOMEventListenerWrapper MOZ_FINAL : public nsIDOMEventListener
 {
 public:
   nsDOMEventListenerWrapper(nsIDOMEventListener* aListener)
   : mListener(aListener) {}
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(nsDOMEventListenerWrapper)
 
--- a/content/events/src/nsDOMTouchEvent.h
+++ b/content/events/src/nsDOMTouchEvent.h
@@ -6,18 +6,19 @@
 #define nsDOMTouchEvent_h_
 
 #include "nsDOMUIEvent.h"
 #include "nsIDOMTouchEvent.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsIDocument.h"
 #include "dombindings.h"
+#include "mozilla/Attributes.h"
 
-class nsDOMTouch : public nsIDOMTouch
+class nsDOMTouch MOZ_FINAL : public nsIDOMTouch
 {
 public:
   nsDOMTouch(nsIDOMEventTarget* aTarget,
              PRInt32 aIdentifier,
              PRInt32 aPageX,
              PRInt32 aPageY,
              PRInt32 aScreenX,
              PRInt32 aScreenY,
--- a/content/events/src/nsEventListenerService.h
+++ b/content/events/src/nsEventListenerService.h
@@ -7,16 +7,17 @@
 #define nsEventListenerService_h__
 #include "nsIEventListenerService.h"
 #include "nsAutoPtr.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMEventTarget.h"
 #include "nsString.h"
 #include "nsCycleCollectionParticipant.h"
 #include "jsapi.h"
+#include "mozilla/Attributes.h"
 
 
 class nsEventListenerInfo : public nsIEventListenerInfo
 {
 public:
   nsEventListenerInfo(const nsAString& aType, nsIDOMEventListener* aListener,
                       bool aCapturing, bool aAllowsUntrusted,
                       bool aInSystemEventGroup)
@@ -33,15 +34,15 @@ protected:
   nsString                      mType;
   // nsReftPtr because that is what nsListenerStruct uses too.
   nsRefPtr<nsIDOMEventListener> mListener;
   bool                          mCapturing;
   bool                          mAllowsUntrusted;
   bool                          mInSystemEventGroup;
 };
 
-class nsEventListenerService : public nsIEventListenerService
+class nsEventListenerService MOZ_FINAL : public nsIEventListenerService
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIEVENTLISTENERSERVICE
 };
 #endif
--- a/content/events/src/nsEventStateManager.cpp
+++ b/content/events/src/nsEventStateManager.cpp
@@ -91,16 +91,17 @@
 #include "nsIController.h"
 #include "nsICommandParams.h"
 #include "mozilla/Services.h"
 #include "mozAutoDocUpdate.h"
 #include "nsHTMLLabelElement.h"
 
 #include "mozilla/Preferences.h"
 #include "mozilla/LookAndFeel.h"
+#include "mozilla/Attributes.h"
 #include "sampler.h"
 
 #include "nsIDOMClientRect.h"
 
 #ifdef XP_MACOSX
 #import <ApplicationServices/ApplicationServices.h>
 #endif
 
@@ -212,17 +213,17 @@ PrintDocTreeAll(nsIDocShellTreeItem* aIt
       break;
     item = parent;
   }
 
   PrintDocTree(item, 0);
 }
 #endif
 
-class nsUITimerCallback : public nsITimerCallback
+class nsUITimerCallback MOZ_FINAL : public nsITimerCallback
 {
 public:
   nsUITimerCallback() : mPreviousCount(0) {}
   NS_DECL_ISUPPORTS
   NS_DECL_NSITIMERCALLBACK
 private:
   PRUint32 mPreviousCount;
 };
--- a/content/events/src/nsIMEStateManager.cpp
+++ b/content/events/src/nsIMEStateManager.cpp
@@ -29,16 +29,17 @@
 #include "nsISelectionController.h"
 #include "nsIMutationObserver.h"
 #include "nsContentEventHandler.h"
 #include "nsIObserverService.h"
 #include "mozilla/Services.h"
 #include "nsIFormControl.h"
 #include "nsIForm.h"
 #include "nsHTMLFormElement.h"
+#include "mozilla/Attributes.h"
 
 using namespace mozilla::widget;
 
 /******************************************************************/
 /* nsIMEStateManager                                              */
 /******************************************************************/
 
 nsIContent*    nsIMEStateManager::sContent      = nsnull;
@@ -381,18 +382,18 @@ nsIMEStateManager::GetWidget(nsPresConte
 }
 
 
 // nsTextStateManager notifies widget of any text and selection changes
 //  in the currently focused editor
 // sTextStateObserver points to the currently active nsTextStateManager
 // sTextStateObserver is null if there is no focused editor
 
-class nsTextStateManager : public nsISelectionListener,
-                           public nsStubMutationObserver
+class nsTextStateManager MOZ_FINAL : public nsISelectionListener,
+                                     public nsStubMutationObserver
 {
 public:
   nsTextStateManager();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSISELECTIONLISTENER
   NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
--- a/content/events/src/nsPaintRequest.h
+++ b/content/events/src/nsPaintRequest.h
@@ -6,18 +6,19 @@
 #ifndef NSPAINTREQUEST_H_
 #define NSPAINTREQUEST_H_
 
 #include "nsIDOMPaintRequest.h"
 #include "nsIDOMPaintRequestList.h"
 #include "nsPresContext.h"
 #include "nsIDOMEvent.h"
 #include "dombindings.h"
+#include "mozilla/Attributes.h"
 
-class nsPaintRequest : public nsIDOMPaintRequest
+class nsPaintRequest MOZ_FINAL : public nsIDOMPaintRequest
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMPAINTREQUEST
 
   nsPaintRequest() { mRequest.mFlags = 0; }
 
   void SetRequest(const nsInvalidateRequestList::Request& aRequest)
--- a/content/events/src/nsPrivateTextRange.h
+++ b/content/events/src/nsPrivateTextRange.h
@@ -4,18 +4,19 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsPrivateTextRange_h__
 #define nsPrivateTextRange_h__
 
 #include "nsIPrivateTextRange.h"
 #include "nsTArray.h"
 #include "nsAutoPtr.h"
+#include "mozilla/Attributes.h"
 
-class nsPrivateTextRange : public nsIPrivateTextRange 
+class nsPrivateTextRange MOZ_FINAL : public nsIPrivateTextRange
 {
 	NS_DECL_ISUPPORTS
 public:
 
 	nsPrivateTextRange(const nsTextRange &aTextRange);
 	virtual ~nsPrivateTextRange(void);
 
 	NS_IMETHOD    GetRangeStart(PRUint16* aRangeStart);
@@ -26,17 +27,17 @@ public:
 protected:
 
 	PRUint16	mRangeStart;
 	PRUint16	mRangeEnd;
 	PRUint16	mRangeType;
 	nsTextRangeStyle mRangeStyle;
 };
 
-class nsPrivateTextRangeList: public nsIPrivateTextRangeList 
+class nsPrivateTextRangeList MOZ_FINAL : public nsIPrivateTextRangeList
 {
 	NS_DECL_ISUPPORTS
 public:
 	nsPrivateTextRangeList(PRUint16 aLength) : mList(aLength) {}
 
 	void          AppendTextRange(nsRefPtr<nsPrivateTextRange>& aRange);
 
 	NS_IMETHOD_(PRUint16)    GetLength();
--- a/content/events/src/nsXMLEventsManager.h
+++ b/content/events/src/nsXMLEventsManager.h
@@ -9,23 +9,24 @@
 #include "nsCOMPtr.h"
 #include "nsIDocument.h"
 #include "nsIContent.h"
 #include "nsCOMArray.h"
 #include "nsIDOMEventListener.h"
 #include "nsInterfaceHashtable.h"
 #include "nsIAtom.h"
 #include "nsStubDocumentObserver.h"
+#include "mozilla/Attributes.h"
 
 /*
  * The implementation of the XML Events Basic profile
  */
 
 class nsXMLEventsManager;
-class nsXMLEventsListener : public nsIDOMEventListener {
+class nsXMLEventsListener MOZ_FINAL : public nsIDOMEventListener {
 public:
   static bool InitXMLEventsListener(nsIDocument * aDocument, 
                                       nsXMLEventsManager * aManager, 
                                       nsIContent * aContent);
   nsXMLEventsListener(nsXMLEventsManager * aManager,
                       nsIContent * aElement,
                       nsIContent* aObserver,
                       nsIContent * aHandler,
@@ -52,17 +53,17 @@ private:
   nsString mEvent;
   nsCOMPtr<nsIAtom> mTarget;
   bool mPhase;
   bool mStopPropagation;
   bool mCancelDefault;
   
 };
 
-class nsXMLEventsManager : public nsStubDocumentObserver {
+class nsXMLEventsManager MOZ_FINAL : public nsStubDocumentObserver {
 public:
   nsXMLEventsManager();
   ~nsXMLEventsManager();
   NS_DECL_ISUPPORTS
 
   // nsIDocumentObserver
   NS_DECL_NSIDOCUMENTOBSERVER_ENDLOAD
 
--- a/content/media/MediaResource.h
+++ b/content/media/MediaResource.h
@@ -10,16 +10,17 @@
 #include "mozilla/XPCOM.h"
 #include "nsIChannel.h"
 #include "nsIPrincipal.h"
 #include "nsIURI.h"
 #include "nsIStreamListener.h"
 #include "nsIChannelEventSink.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsMediaCache.h"
+#include "mozilla/Attributes.h"
 
 // For HTTP seeking, if number of bytes needing to be
 // seeked forward is less than this value then a read is
 // done rather than a byte range request.
 static const PRInt64 SEEK_VS_READ_THRESHOLD = 32*1024;
 
 static const PRUint32 HTTP_REQUESTED_RANGE_NOT_SATISFIABLE_CODE = 416;
 
@@ -385,19 +386,19 @@ public:
   virtual double  GetDownloadRate(bool* aIsReliable);
   virtual PRInt64 GetLength();
   virtual PRInt64 GetNextCachedData(PRInt64 aOffset);
   virtual PRInt64 GetCachedDataEnd(PRInt64 aOffset);
   virtual bool    IsDataCachedToEndOfResource(PRInt64 aOffset);
   virtual bool    IsSuspendedByCache(MediaResource** aActiveResource);
   virtual bool    IsSuspended();
 
-  class Listener : public nsIStreamListener,
-                   public nsIInterfaceRequestor,
-                   public nsIChannelEventSink
+  class Listener MOZ_FINAL : public nsIStreamListener,
+                             public nsIInterfaceRequestor,
+                             public nsIChannelEventSink
   {
   public:
     Listener(ChannelMediaResource* aResource) : mResource(aResource) {}
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIREQUESTOBSERVER
     NS_DECL_NSISTREAMLISTENER
     NS_DECL_NSICHANNELEVENTSINK
--- a/content/media/MediaStreamGraph.cpp
+++ b/content/media/MediaStreamGraph.cpp
@@ -12,16 +12,17 @@
 #include "nsContentUtils.h"
 #include "nsIAppShell.h"
 #include "nsIObserver.h"
 #include "nsServiceManagerUtils.h"
 #include "nsWidgetsCID.h"
 #include "nsXPCOMCIDInternal.h"
 #include "prlog.h"
 #include "VideoUtils.h"
+#include "mozilla/Attributes.h"
 
 using namespace mozilla::layers;
 
 namespace mozilla {
 
 namespace {
 
 #ifdef PR_LOGGING
@@ -1464,17 +1465,17 @@ public:
     mStream->GraphImpl()->AddStream(mStream);
   }
   virtual void Process()
   {
     mStream->Init();
   }
 };
 
-class MediaStreamGraphShutdownObserver : public nsIObserver
+class MediaStreamGraphShutdownObserver MOZ_FINAL : public nsIObserver
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
 };
 
 }
 
--- a/content/media/nsMediaCache.cpp
+++ b/content/media/nsMediaCache.cpp
@@ -15,16 +15,17 @@
 #include "prio.h"
 #include "nsContentUtils.h"
 #include "nsThreadUtils.h"
 #include "MediaResource.h"
 #include "nsMathUtils.h"
 #include "prlog.h"
 #include "mozilla/Preferences.h"
 #include "FileBlockCache.h"
+#include "mozilla/Attributes.h"
 
 using namespace mozilla;
 
 #ifdef PR_LOGGING
 PRLogModuleInfo* gMediaCacheLog;
 #define LOG(type, msg) PR_LOG(gMediaCacheLog, type, msg)
 #else
 #define LOG(type, msg)
@@ -54,18 +55,18 @@ static const PRUint32 FREE_BLOCK_SCAN_LI
 // #define DEBUG_VERIFY_CACHE
 #endif
 
 // There is at most one media cache (although that could quite easily be
 // relaxed if we wanted to manage multiple caches with independent
 // size limits).
 static nsMediaCache* gMediaCache;
 
-class nsMediaCacheFlusher : public nsIObserver,
-                            public nsSupportsWeakReference {
+class nsMediaCacheFlusher MOZ_FINAL : public nsIObserver,
+                                      public nsSupportsWeakReference {
   nsMediaCacheFlusher() {}
   ~nsMediaCacheFlusher();
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
   static void Init();
 };
--- a/content/svg/content/src/DOMSVGAnimatedLengthList.h
+++ b/content/svg/content/src/DOMSVGAnimatedLengthList.h
@@ -6,16 +6,17 @@
 #ifndef MOZILLA_DOMSVGANIMATEDLENGTHLIST_H__
 #define MOZILLA_DOMSVGANIMATEDLENGTHLIST_H__
 
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIDOMSVGAnimatedLengthList.h"
 #include "nsSVGElement.h"
+#include "mozilla/Attributes.h"
 
 namespace mozilla {
 
 class SVGAnimatedLengthList;
 class SVGLengthList;
 class DOMSVGLengthList;
 
 /**
@@ -98,17 +99,17 @@ class DOMSVGLengthList;
  *
  *      .----<!----.                .----<!----.        .----<!----.
  *      |          |                |          |        |          |
  *   element ~> DOMSVGAnimatedLengthList ~> DOMSVGLengthList ~> DOMSVGLength
  *
  * One drawback of this design is that objects must look up their parent
  * chain to find their element, but that overhead is relatively small.
  */
-class DOMSVGAnimatedLengthList : public nsIDOMSVGAnimatedLengthList
+class DOMSVGAnimatedLengthList MOZ_FINAL : public nsIDOMSVGAnimatedLengthList
 {
   friend class DOMSVGLengthList;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(DOMSVGAnimatedLengthList)
   NS_DECL_NSIDOMSVGANIMATEDLENGTHLIST
 
--- a/content/svg/content/src/DOMSVGAnimatedNumberList.h
+++ b/content/svg/content/src/DOMSVGAnimatedNumberList.h
@@ -6,16 +6,17 @@
 #ifndef MOZILLA_DOMSVGANIMATEDNUMBERLIST_H__
 #define MOZILLA_DOMSVGANIMATEDNUMBERLIST_H__
 
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIDOMSVGAnimatedNumberList.h"
 #include "nsSVGElement.h"
+#include "mozilla/Attributes.h"
 
 namespace mozilla {
 
 class DOMSVGNumberList;
 class SVGAnimatedNumberList;
 class SVGNumberList;
 
 /**
@@ -28,17 +29,17 @@ class SVGNumberList;
  * LENGTH list). The comment for that class largly applies to this one too
  * and will go a long way to helping you understand the architecture here.
  *
  * This class is strongly intertwined with DOMSVGNumberList and DOMSVGNumber.
  * Our DOMSVGNumberList base and anim vals are friends and take care of nulling
  * out our pointers to them when they die (making our pointers to them true
  * weak refs).
  */
-class DOMSVGAnimatedNumberList : public nsIDOMSVGAnimatedNumberList
+class DOMSVGAnimatedNumberList MOZ_FINAL : public nsIDOMSVGAnimatedNumberList
 {
   friend class DOMSVGNumberList;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(DOMSVGAnimatedNumberList)
   NS_DECL_NSIDOMSVGANIMATEDNUMBERLIST
 
--- a/content/svg/content/src/DOMSVGAnimatedTransformList.h
+++ b/content/svg/content/src/DOMSVGAnimatedTransformList.h
@@ -7,16 +7,17 @@
 #ifndef MOZILLA_DOMSVGANIMATEDTRANSFORMLIST_H__
 #define MOZILLA_DOMSVGANIMATEDTRANSFORMLIST_H__
 
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIDOMSVGAnimTransformList.h"
 #include "nsSVGElement.h"
+#include "mozilla/Attributes.h"
 
 namespace mozilla {
 
 class DOMSVGTransformList;
 class SVGAnimatedTransformList;
 
 /**
  * Class DOMSVGAnimatedTransformList
@@ -29,17 +30,17 @@ class SVGAnimatedTransformList;
  * and will go a long way to helping you understand the architecture here.
  *
  * This class is strongly intertwined with DOMSVGTransformList and
  * DOMSVGTransform.
  * Our DOMSVGTransformList base and anim vals are friends and take care of
  * nulling out our pointers to them when they die (making our pointers to them
  * true weak refs).
  */
-class DOMSVGAnimatedTransformList : public nsIDOMSVGAnimatedTransformList
+class DOMSVGAnimatedTransformList MOZ_FINAL : public nsIDOMSVGAnimatedTransformList
 {
   friend class DOMSVGTransformList;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(DOMSVGAnimatedTransformList)
   NS_DECL_NSIDOMSVGANIMATEDTRANSFORMLIST
 
--- a/content/svg/content/src/DOMSVGLength.h
+++ b/content/svg/content/src/DOMSVGLength.h
@@ -8,16 +8,17 @@
 
 #include "DOMSVGLengthList.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDebug.h"
 #include "nsIDOMSVGLength.h"
 #include "nsTArray.h"
 #include "SVGLength.h"
+#include "mozilla/Attributes.h"
 
 class nsSVGElement;
 
 // We make DOMSVGLength a pseudo-interface to allow us to QI to it in order to
 // check that the objects that scripts pass to DOMSVGLengthList methods are our
 // *native* length objects.
 //
 // {A8468350-7F7B-4976-9A7E-3765A1DADF9A}
@@ -60,17 +61,17 @@ namespace mozilla {
  * type can find their corresponding internal SVGLength.
  *
  * To use these classes for <length> attributes as well as <list-of-length>
  * attributes, we would need to take a bit from mListIndex and use that to
  * indicate whether the object belongs to a list or non-list attribute, then
  * if-else as appropriate. The bug for doing that work is:
  * https://bugzilla.mozilla.org/show_bug.cgi?id=571734
  */
-class DOMSVGLength : public nsIDOMSVGLength
+class DOMSVGLength MOZ_FINAL : public nsIDOMSVGLength
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGLENGTH_IID)
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(DOMSVGLength)
   NS_DECL_NSIDOMSVGLENGTH
 
   /**
--- a/content/svg/content/src/DOMSVGLengthList.h
+++ b/content/svg/content/src/DOMSVGLengthList.h
@@ -8,16 +8,17 @@
 
 #include "DOMSVGAnimatedLengthList.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDebug.h"
 #include "nsIDOMSVGLengthList.h"
 #include "nsTArray.h"
 #include "SVGLengthList.h"
+#include "mozilla/Attributes.h"
 
 class nsIDOMSVGLength;
 class nsSVGElement;
 
 namespace mozilla {
 
 class DOMSVGLength;
 
@@ -33,18 +34,18 @@ class DOMSVGLength;
  * DOMSVGLength. We are a friend of DOMSVGAnimatedLengthList, and are
  * responsible for nulling out our DOMSVGAnimatedLengthList's pointer to us
  * when we die, essentially making its pointer to us a weak pointer. Similarly,
  * our DOMSVGLength items are friends of us and responsible for nulling out our
  * pointers to them.
  *
  * Our DOM items are created lazily on demand as and when script requests them.
  */
-class DOMSVGLengthList : public nsIDOMSVGLengthList,
-                         public nsWrapperCache
+class DOMSVGLengthList MOZ_FINAL : public nsIDOMSVGLengthList,
+                                   public nsWrapperCache
 {
   friend class DOMSVGLength;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGLengthList)
   NS_DECL_NSIDOMSVGLENGTHLIST
 
--- a/content/svg/content/src/DOMSVGMatrix.h
+++ b/content/svg/content/src/DOMSVGMatrix.h
@@ -37,32 +37,33 @@
 #ifndef MOZILLA_DOMSVGMATRIX_H__
 #define MOZILLA_DOMSVGMATRIX_H__
 
 #include "DOMSVGTransform.h"
 #include "gfxMatrix.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIDOMSVGMatrix.h"
+#include "mozilla/Attributes.h"
 
 // We make DOMSVGMatrix a pseudo-interface to allow us to QI to it in order
 // to check that the objects that scripts pass in are our *native* matrix
 // objects.
 //
 // {633419E5-7E88-4C3E-8A9A-856F635E90A3}
 #define MOZILLA_DOMSVGMATRIX_IID \
   { 0x633419E5, 0x7E88, 0x4C3E, \
     { 0x8A, 0x9A, 0x85, 0x6F, 0x63, 0x5E, 0x90, 0xA3 } }
 
 namespace mozilla {
 
 /**
  * DOM wrapper for an SVG matrix.
  */
-class DOMSVGMatrix : public nsIDOMSVGMatrix
+class DOMSVGMatrix MOZ_FINAL : public nsIDOMSVGMatrix
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGMATRIX_IID)
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(DOMSVGMatrix)
   NS_DECL_NSIDOMSVGMATRIX
 
   /**
--- a/content/svg/content/src/DOMSVGNumber.h
+++ b/content/svg/content/src/DOMSVGNumber.h
@@ -6,16 +6,17 @@
 #ifndef MOZILLA_DOMSVGNUMBER_H__
 #define MOZILLA_DOMSVGNUMBER_H__
 
 #include "DOMSVGNumberList.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIDOMSVGNumber.h"
 #include "nsTArray.h"
+#include "mozilla/Attributes.h"
 
 class nsSVGElement;
 
 // We make DOMSVGNumber a pseudo-interface to allow us to QI to it in order to
 // check that the objects that scripts pass to DOMSVGNumberList methods are our
 // *native* number objects.
 //
 // {2CA92412-2E1F-4DDB-A16C-52B3B582270D}
@@ -35,17 +36,17 @@ namespace mozilla {
  * SVGSVGElement.createSVGNumber().
  *
  * For the DOM wrapper classes for non-list SVGNumber, see nsSVGNumber2.h.
  *
  * See the architecture comment in DOMSVGAnimatedNumberList.h.
  *
  * See the comment in DOMSVGLength.h (yes, LENGTH), which applies here too.
  */
-class DOMSVGNumber : public nsIDOMSVGNumber
+class DOMSVGNumber MOZ_FINAL : public nsIDOMSVGNumber
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGNUMBER_IID)
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(DOMSVGNumber)
   NS_DECL_NSIDOMSVGNUMBER
 
   /**
--- a/content/svg/content/src/DOMSVGNumberList.h
+++ b/content/svg/content/src/DOMSVGNumberList.h
@@ -8,16 +8,17 @@
 
 #include "DOMSVGAnimatedNumberList.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDebug.h"
 #include "nsIDOMSVGNumberList.h"
 #include "nsTArray.h"
 #include "SVGNumberList.h"
+#include "mozilla/Attributes.h"
 
 class nsSVGElement;
 
 namespace mozilla {
 
 class DOMSVGNumber;
 
 /**
@@ -32,18 +33,18 @@ class DOMSVGNumber;
  * DOMSVGNumber. We are a friend of DOMSVGAnimatedNumberList, and are
  * responsible for nulling out our DOMSVGAnimatedNumberList's pointer to us
  * when we die, essentially making its pointer to us a weak pointer. Similarly,
  * our DOMSVGNumber items are friends of us and responsible for nulling out our
  * pointers to them.
  *
  * Our DOM items are created lazily on demand as and when script requests them.
  */
-class DOMSVGNumberList : public nsIDOMSVGNumberList,
-                         public nsWrapperCache
+class DOMSVGNumberList MOZ_FINAL : public nsIDOMSVGNumberList,
+                                   public nsWrapperCache
 {
   friend class DOMSVGNumber;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGNumberList)
   NS_DECL_NSIDOMSVGNUMBERLIST
 
--- a/content/svg/content/src/DOMSVGPathSegList.h
+++ b/content/svg/content/src/DOMSVGPathSegList.h
@@ -9,16 +9,17 @@
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDebug.h"
 #include "nsIDOMSVGPathSegList.h"
 #include "nsSVGElement.h"
 #include "nsTArray.h"
 #include "SVGPathData.h" // IWYU pragma: keep
+#include "mozilla/Attributes.h"
 
 class nsIDOMSVGPathSeg;
 
 namespace mozilla {
 
 class DOMSVGPathSeg;
 class SVGAnimatedPathSegList;
 
@@ -42,18 +43,18 @@ class SVGAnimatedPathSegList;
  * DOMSVGAnimatedLengthList) is contained in this class.
  *
  * This class is strongly intertwined with DOMSVGPathSeg. Our DOMSVGPathSeg
  * items are friends of us and responsible for nulling out our pointers to
  * them when they die.
  *
  * Our DOM items are created lazily on demand as and when script requests them.
  */
-class DOMSVGPathSegList : public nsIDOMSVGPathSegList,
-                          public nsWrapperCache
+class DOMSVGPathSegList MOZ_FINAL : public nsIDOMSVGPathSegList,
+                                    public nsWrapperCache
 {
   friend class DOMSVGPathSeg;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGPathSegList)
   NS_DECL_NSIDOMSVGPATHSEGLIST
 
--- a/content/svg/content/src/DOMSVGPoint.h
+++ b/content/svg/content/src/DOMSVGPoint.h
@@ -9,16 +9,17 @@
 #include "DOMSVGPointList.h"
 #include "gfxPoint.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDebug.h"
 #include "nsIDOMSVGPoint.h"
 #include "nsTArray.h"
 #include "SVGPoint.h"
+#include "mozilla/Attributes.h"
 
 class nsSVGElement;
 
 // We make DOMSVGPoint a pseudo-interface to allow us to QI to it in order to
 // check that the objects that scripts pass to DOMSVGPointList methods are
 // our *native* point objects.
 //
 // {d6b6c440-af8d-40ee-856b-02a317cab275}
@@ -39,17 +40,17 @@ namespace mozilla {
  * objects.
  *
  * See the architecture comment in DOMSVGPointList.h for an overview of the
  * important points regarding these DOM wrapper structures.
  *
  * See the architecture comment in DOMSVGLength.h (yes, LENGTH) for an overview
  * of the important points regarding how this specific class works.
  */
-class DOMSVGPoint : public nsIDOMSVGPoint
+class DOMSVGPoint MOZ_FINAL : public nsIDOMSVGPoint
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGPOINT_IID)
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(DOMSVGPoint)
   NS_DECL_NSIDOMSVGPOINT
 
   /**
--- a/content/svg/content/src/DOMSVGPointList.h
+++ b/content/svg/content/src/DOMSVGPointList.h
@@ -9,16 +9,17 @@
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDebug.h"
 #include "nsIDOMSVGPointList.h"
 #include "nsSVGElement.h"
 #include "nsTArray.h"
 #include "SVGPointList.h" // IWYU pragma: keep
+#include "mozilla/Attributes.h"
 
 class nsIDOMSVGPoint;
 
 namespace mozilla {
 
 class DOMSVGPoint;
 class SVGAnimatedPointList;
 
@@ -42,18 +43,18 @@ class SVGAnimatedPointList;
  * DOMSVGAnimatedLengthList) is contained in this class.
  *
  * This class is strongly intertwined with DOMSVGPoint. Our DOMSVGPoint
  * items are friends of us and responsible for nulling out our pointers to
  * them when they die.
  *
  * Our DOM items are created lazily on demand as and when script requests them.
  */
-class DOMSVGPointList : public nsIDOMSVGPointList,
-                        public nsWrapperCache
+class DOMSVGPointList MOZ_FINAL : public nsIDOMSVGPointList,
+                                  public nsWrapperCache
 {
   friend class DOMSVGPoint;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGPointList)
   NS_DECL_NSIDOMSVGPOINTLIST
 
--- a/content/svg/content/src/DOMSVGStringList.h
+++ b/content/svg/content/src/DOMSVGStringList.h
@@ -6,16 +6,17 @@
 #ifndef MOZILLA_DOMSVGSTRINGLIST_H__
 #define MOZILLA_DOMSVGSTRINGLIST_H__
 
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIDOMSVGStringList.h"
 #include "nsSVGElement.h"
+#include "mozilla/Attributes.h"
 
 namespace mozilla {
 
 class SVGStringList;
 
 /**
  * Class DOMSVGStringList
  *
@@ -37,17 +38,17 @@ class SVGStringList;
  * Second, since there is no nsIDOMSVGString interface in SVG, we have no
  * DOMSVGString items to maintain. As far as script is concerned, objects
  * of this class contain a list of strings, not a list of mutable objects
  * like the other SVG list types. As a result, unlike the other SVG list
  * types, this class does not create its items lazily on demand and store
  * them so it can return the same objects each time. It simply returns a new
  * string each time any given item is requested.
  */
-class DOMSVGStringList : public nsIDOMSVGStringList
+class DOMSVGStringList MOZ_FINAL : public nsIDOMSVGStringList
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(DOMSVGStringList)
   NS_DECL_NSIDOMSVGSTRINGLIST
 
   /**
    * Factory method to create and return a DOMSVGStringList wrapper
--- a/content/svg/content/src/DOMSVGTests.h
+++ b/content/svg/content/src/DOMSVGTests.h
@@ -19,16 +19,18 @@ class DOMSVGStringList;
 }
 
 class DOMSVGTests : public nsIDOMSVGTests
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMSVGTESTS
 
+  virtual ~DOMSVGTests() {}
+
   friend class mozilla::DOMSVGStringList;
   typedef mozilla::SVGStringList SVGStringList;
 
   /**
    * Compare the language name(s) in a systemLanguage attribute to the
    * user's language preferences, as defined in
    * http://www.w3.org/TR/SVG11/struct.html#SystemLanguageAttribute
    * We have a match if a language name in the users language preferences
--- a/content/svg/content/src/DOMSVGTransform.h
+++ b/content/svg/content/src/DOMSVGTransform.h
@@ -10,16 +10,17 @@
 #include "DOMSVGTransformList.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDebug.h"
 #include "nsID.h"
 #include "nsIDOMSVGTransform.h"
 #include "nsTArray.h"
 #include "SVGTransform.h"
+#include "mozilla/Attributes.h"
 
 class nsSVGElement;
 
 struct gfxMatrix;
 
 // We make DOMSVGTransform a pseudo-interface to allow us to QI to it in order
 // to check that the objects that scripts pass in are our our *native* transform
 // objects.
@@ -33,17 +34,17 @@ struct gfxMatrix;
 
 namespace mozilla {
 
 class DOMSVGMatrix;
 
 /**
  * DOM wrapper for an SVG transform. See DOMSVGLength.h.
  */
-class DOMSVGTransform : public nsIDOMSVGTransform
+class DOMSVGTransform MOZ_FINAL : public nsIDOMSVGTransform
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGTRANSFORM_IID)
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(DOMSVGTransform)
   NS_DECL_NSIDOMSVGTRANSFORM
 
   /**
--- a/content/svg/content/src/DOMSVGTransformList.h
+++ b/content/svg/content/src/DOMSVGTransformList.h
@@ -9,34 +9,35 @@
 
 #include "DOMSVGAnimatedTransformList.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDebug.h"
 #include "nsIDOMSVGTransformList.h"
 #include "nsTArray.h"
 #include "SVGTransformList.h"
+#include "mozilla/Attributes.h"
 
 class nsIDOMSVGTransform;
 class nsSVGElement;
 
 namespace mozilla {
 
 class DOMSVGTransform;
 
 /**
  * Class DOMSVGTransformList
  *
  * This class is used to create the DOM tearoff objects that wrap internal
  * SVGTransformList objects.
  *
  * See the architecture comment in DOMSVGAnimatedTransformList.h.
  */
-class DOMSVGTransformList : public nsIDOMSVGTransformList,
-                            public nsWrapperCache
+class DOMSVGTransformList MOZ_FINAL : public nsIDOMSVGTransformList,
+                                      public nsWrapperCache
 {
   friend class DOMSVGTransform;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGTransformList)
   NS_DECL_NSIDOMSVGTRANSFORMLIST
 
--- a/content/svg/content/src/SVGAnimatedPreserveAspectRatio.h
+++ b/content/svg/content/src/SVGAnimatedPreserveAspectRatio.h
@@ -9,16 +9,17 @@
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDOMError.h"
 #include "nsError.h"
 #include "nsIDOMSVGAnimPresAspRatio.h"
 #include "nsIDOMSVGPresAspectRatio.h"
 #include "nsISMILAttr.h"
 #include "nsSVGElement.h"
+#include "mozilla/Attributes.h"
 
 class nsISMILAnimationElement;
 class nsSMILValue;
 
 namespace mozilla {
 
 class SVGAnimatedPreserveAspectRatio;
 
@@ -142,17 +143,17 @@ private:
   bool mIsBaseSet;
 
   nsresult ToDOMBaseVal(nsIDOMSVGPreserveAspectRatio **aResult,
                         nsSVGElement* aSVGElement);
   nsresult ToDOMAnimVal(nsIDOMSVGPreserveAspectRatio **aResult,
                         nsSVGElement* aSVGElement);
 
 public:
-  struct DOMBaseVal : public nsIDOMSVGPreserveAspectRatio
+  struct DOMBaseVal MOZ_FINAL : public nsIDOMSVGPreserveAspectRatio
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMBaseVal)
 
     DOMBaseVal(SVGAnimatedPreserveAspectRatio* aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
     
     SVGAnimatedPreserveAspectRatio* mVal; // kept alive because it belongs to mSVGElement
@@ -164,17 +165,17 @@ public:
       { return mVal->SetBaseAlign(aAlign, mSVGElement); }
 
     NS_IMETHOD GetMeetOrSlice(PRUint16* aMeetOrSlice)
       { *aMeetOrSlice = mVal->GetBaseValue().GetMeetOrSlice(); return NS_OK; }
     NS_IMETHOD SetMeetOrSlice(PRUint16 aMeetOrSlice)
       { return mVal->SetBaseMeetOrSlice(aMeetOrSlice, mSVGElement); }
   };
 
-  struct DOMAnimVal : public nsIDOMSVGPreserveAspectRatio
+  struct DOMAnimVal MOZ_FINAL : public nsIDOMSVGPreserveAspectRatio
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimVal)
 
     DOMAnimVal(SVGAnimatedPreserveAspectRatio* aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
     
     SVGAnimatedPreserveAspectRatio* mVal; // kept alive because it belongs to mSVGElement
@@ -196,17 +197,17 @@ public:
       mSVGElement->FlushAnimations();
       *aMeetOrSlice = mVal->GetAnimValue().GetMeetOrSlice();
       return NS_OK;
     }
     NS_IMETHOD SetMeetOrSlice(PRUint16 aValue)
       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
   };
 
-  struct DOMAnimPAspectRatio : public nsIDOMSVGAnimatedPreserveAspectRatio
+  struct DOMAnimPAspectRatio MOZ_FINAL : public nsIDOMSVGAnimatedPreserveAspectRatio
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimPAspectRatio)
 
     DOMAnimPAspectRatio(SVGAnimatedPreserveAspectRatio* aVal,
                         nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
 
@@ -217,17 +218,17 @@ public:
 
     NS_IMETHOD GetBaseVal(nsIDOMSVGPreserveAspectRatio **aBaseVal)
       { return mVal->ToDOMBaseVal(aBaseVal, mSVGElement); }
 
     NS_IMETHOD GetAnimVal(nsIDOMSVGPreserveAspectRatio **aAnimVal)
       { return mVal->ToDOMAnimVal(aAnimVal, mSVGElement); }
   };
 
-  struct SMILPreserveAspectRatio : public nsISMILAttr
+  struct SMILPreserveAspectRatio MOZ_FINAL : public nsISMILAttr
   {
   public:
     SMILPreserveAspectRatio(SVGAnimatedPreserveAspectRatio* aVal,
                             nsSVGElement* aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
 
     // These will stay alive because a nsISMILAttr only lives as long
     // as the Compositing step, and DOM elements don't get a chance to
--- a/content/svg/content/src/nsSVGAngle.cpp
+++ b/content/svg/content/src/nsSVGAngle.cpp
@@ -9,28 +9,29 @@
 #include "prdtoa.h"
 #include "nsTextFormatter.h"
 #include "nsSVGUtils.h"
 #include "nsSVGMarkerElement.h"
 #include "nsMathUtils.h"
 #include "nsContentUtils.h" // NS_ENSURE_FINITE
 #include "nsSMILValue.h"
 #include "SVGOrientSMILType.h"
+#include "mozilla/Attributes.h"
 
 using namespace mozilla;
 
 /**
  * Mutable SVGAngle class for SVGSVGElement.createSVGAngle().
  *
  * Note that this class holds its own nsSVGAngle, which therefore can't be
  * animated. This means SVGMarkerElement::setOrientToAngle(angle) must copy
  * any DOMSVGAngle passed in. Perhaps this is wrong and inconsistent with
  * other parts of SVG, but it's how the code works for now.
  */
-class DOMSVGAngle : public nsIDOMSVGAngle
+class DOMSVGAngle MOZ_FINAL : public nsIDOMSVGAngle
 {
 public:
   NS_DECL_ISUPPORTS
 
   DOMSVGAngle()
     { mVal.Init(); }
     
   NS_IMETHOD GetUnitType(PRUint16* aResult)
--- a/content/svg/content/src/nsSVGAngle.h
+++ b/content/svg/content/src/nsSVGAngle.h
@@ -9,16 +9,17 @@
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDOMError.h"
 #include "nsError.h"
 #include "nsIDOMSVGAngle.h"
 #include "nsIDOMSVGAnimatedAngle.h"
 #include "nsISMILAttr.h"
 #include "nsSVGElement.h"
+#include "mozilla/Attributes.h"
 
 class nsISMILAnimationElement;
 class nsSMILValue;
 class nsSVGOrientType;
 
 class nsSVGAngle
 {
   friend class DOMSVGAngle;
@@ -72,17 +73,17 @@ private:
   void SetBaseValueInSpecifiedUnits(float aValue, nsSVGElement *aSVGElement);
   nsresult NewValueSpecifiedUnits(PRUint16 aUnitType, float aValue,
                                   nsSVGElement *aSVGElement);
   nsresult ConvertToSpecifiedUnits(PRUint16 aUnitType, nsSVGElement *aSVGElement);
   nsresult ToDOMBaseVal(nsIDOMSVGAngle **aResult, nsSVGElement* aSVGElement);
   nsresult ToDOMAnimVal(nsIDOMSVGAngle **aResult, nsSVGElement* aSVGElement);
 
 public:
-  struct DOMBaseVal : public nsIDOMSVGAngle
+  struct DOMBaseVal MOZ_FINAL : public nsIDOMSVGAngle
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMBaseVal)
 
     DOMBaseVal(nsSVGAngle* aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
     
     nsSVGAngle* mVal; // kept alive because it belongs to mSVGElement
@@ -111,17 +112,17 @@ public:
                                       float valueInSpecifiedUnits)
       { return mVal->NewValueSpecifiedUnits(unitType, valueInSpecifiedUnits,
                                      mSVGElement); }
 
     NS_IMETHOD ConvertToSpecifiedUnits(PRUint16 unitType)
       { return mVal->ConvertToSpecifiedUnits(unitType, mSVGElement); }
   };
 
-  struct DOMAnimVal : public nsIDOMSVGAngle
+  struct DOMAnimVal MOZ_FINAL : public nsIDOMSVGAngle
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimVal)
 
     DOMAnimVal(nsSVGAngle* aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
     
     nsSVGAngle* mVal; // kept alive because it belongs to mSVGElement
@@ -148,17 +149,17 @@ public:
     NS_IMETHOD NewValueSpecifiedUnits(PRUint16 unitType,
                                       float valueInSpecifiedUnits)
       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
 
     NS_IMETHOD ConvertToSpecifiedUnits(PRUint16 unitType)
       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
   };
 
-  struct DOMAnimatedAngle : public nsIDOMSVGAnimatedAngle
+  struct DOMAnimatedAngle MOZ_FINAL : public nsIDOMSVGAnimatedAngle
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedAngle)
 
     DOMAnimatedAngle(nsSVGAngle* aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
     
     nsSVGAngle* mVal; // kept alive because it belongs to content
@@ -171,17 +172,17 @@ public:
       { return mVal->ToDOMAnimVal(aAnimVal, mSVGElement); }
   };
 
   // We do not currently implemente a SMILAngle struct because in SVG 1.1 the
   // only *animatable* attribute that takes an <angle> is 'orient', on the
   // 'marker' element, and 'orient' must be special cased since it can also
   // take the value 'auto', making it a more complex type.
 
-  struct SMILOrient : public nsISMILAttr
+  struct SMILOrient MOZ_FINAL : public nsISMILAttr
   {
   public:
     SMILOrient(nsSVGOrientType* aOrientType,
                nsSVGAngle* aAngle,
                nsSVGElement* aSVGElement)
       : mOrientType(aOrientType)
       , mAngle(aAngle)
       , mSVGElement(aSVGElement)
--- a/content/svg/content/src/nsSVGBoolean.h
+++ b/content/svg/content/src/nsSVGBoolean.h
@@ -8,16 +8,17 @@
 
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
 #include "nsIDOMSVGAnimatedBoolean.h"
 #include "nsISMILAttr.h"
 #include "nsISupportsImpl.h"
 #include "nsSVGElement.h"
+#include "mozilla/Attributes.h"
 
 class nsISMILAnimationElement;
 class nsSMILValue;
 
 class nsSVGBoolean
 {
 
 public:
@@ -46,17 +47,17 @@ public:
 private:
 
   bool mAnimVal;
   bool mBaseVal;
   bool mIsAnimated;
   PRUint8 mAttrEnum; // element specified tracking for attribute
 
 public:
-  struct DOMAnimatedBoolean : public nsIDOMSVGAnimatedBoolean
+  struct DOMAnimatedBoolean MOZ_FINAL : public nsIDOMSVGAnimatedBoolean
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedBoolean)
 
     DOMAnimatedBoolean(nsSVGBoolean* aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
 
     nsSVGBoolean* mVal; // kept alive because it belongs to content
--- a/content/svg/content/src/nsSVGClass.h
+++ b/content/svg/content/src/nsSVGClass.h
@@ -7,16 +7,17 @@
 #define __NS_SVGCLASS_H__
 
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDOMError.h"
 #include "nsIDOMSVGAnimatedString.h"
 #include "nsISMILAttr.h"
 #include "nsString.h"
+#include "mozilla/Attributes.h"
 
 class nsSVGStylableElement;
 
 class nsSVGClass
 {
 
 public:
   void Init() {
@@ -38,17 +39,17 @@ public:
   // Returns a new nsISMILAttr object that the caller must delete
   nsISMILAttr* ToSMILAttr(nsSVGStylableElement *aSVGElement);
 
 private:
 
   nsAutoPtr<nsString> mAnimVal;
 
 public:
-  struct DOMAnimatedString : public nsIDOMSVGAnimatedString
+  struct DOMAnimatedString MOZ_FINAL : public nsIDOMSVGAnimatedString
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedString)
 
     DOMAnimatedString(nsSVGClass *aVal, nsSVGStylableElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
 
     nsSVGClass* mVal; // kept alive because it belongs to content
--- a/content/svg/content/src/nsSVGEnum.h
+++ b/content/svg/content/src/nsSVGEnum.h
@@ -7,16 +7,17 @@
 #define __NS_SVGENUM_H__
 
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
 #include "nsIDOMSVGAnimatedEnum.h"
 #include "nsISMILAttr.h"
 #include "nsSVGElement.h"
+#include "mozilla/Attributes.h"
 
 class nsIAtom;
 class nsISMILAnimationElement;
 class nsSMILValue;
 
 typedef PRUint8 nsSVGEnumValue;
 
 struct nsSVGEnumMapping {
@@ -57,17 +58,17 @@ private:
   nsSVGEnumValue mBaseVal;
   PRUint8 mAttrEnum; // element specified tracking for attribute
   bool mIsAnimated;
   bool mIsBaseSet;
 
   nsSVGEnumMapping *GetMapping(nsSVGElement *aSVGElement);
 
 public:
-  struct DOMAnimatedEnum : public nsIDOMSVGAnimatedEnumeration
+  struct DOMAnimatedEnum MOZ_FINAL : public nsIDOMSVGAnimatedEnumeration
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedEnum)
 
     DOMAnimatedEnum(nsSVGEnum* aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
 
     nsSVGEnum *mVal; // kept alive because it belongs to content
--- a/content/svg/content/src/nsSVGInteger.h
+++ b/content/svg/content/src/nsSVGInteger.h
@@ -7,16 +7,17 @@
 #define __NS_SVGINTEGER_H__
 
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
 #include "nsIDOMSVGAnimatedInteger.h"
 #include "nsISMILAttr.h"
 #include "nsSVGElement.h"
+#include "mozilla/Attributes.h"
 
 class nsISMILAnimationElement;
 class nsSMILValue;
 
 class nsSVGInteger
 {
 
 public:
@@ -56,17 +57,17 @@ private:
 
   PRInt32 mAnimVal;
   PRInt32 mBaseVal;
   PRUint8 mAttrEnum; // element specified tracking for attribute
   bool mIsAnimated;
   bool mIsBaseSet;
 
 public:
-  struct DOMAnimatedInteger : public nsIDOMSVGAnimatedInteger
+  struct DOMAnimatedInteger MOZ_FINAL : public nsIDOMSVGAnimatedInteger
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedInteger)
 
     DOMAnimatedInteger(nsSVGInteger* aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
 
     nsSVGInteger* mVal; // kept alive because it belongs to content
--- a/content/svg/content/src/nsSVGIntegerPair.h
+++ b/content/svg/content/src/nsSVGIntegerPair.h
@@ -7,16 +7,17 @@
 #define __NS_SVGINTEGERPAIR_H__
 
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
 #include "nsIDOMSVGAnimatedInteger.h"
 #include "nsISMILAttr.h"
 #include "nsSVGElement.h"
+#include "mozilla/Attributes.h"
 
 class nsISMILAnimationElement;
 class nsSMILValue;
 
 class nsSVGIntegerPair
 {
 
 public:
@@ -63,17 +64,17 @@ private:
 
   PRInt32 mAnimVal[2];
   PRInt32 mBaseVal[2];
   PRUint8 mAttrEnum; // element specified tracking for attribute
   bool mIsAnimated;
   bool mIsBaseSet;
 
 public:
-  struct DOMAnimatedInteger : public nsIDOMSVGAnimatedInteger
+  struct DOMAnimatedInteger MOZ_FINAL : public nsIDOMSVGAnimatedInteger
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedInteger)
 
     DOMAnimatedInteger(nsSVGIntegerPair* aVal, PairIndex aIndex, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement), mIndex(aIndex) {}
 
     nsSVGIntegerPair* mVal; // kept alive because it belongs to content
--- a/content/svg/content/src/nsSVGMarkerElement.h
+++ b/content/svg/content/src/nsSVGMarkerElement.h
@@ -10,16 +10,17 @@
 #include "nsIDOMSVGFitToViewBox.h"
 #include "nsIDOMSVGMarkerElement.h"
 #include "nsSVGAngle.h"
 #include "nsSVGEnum.h"
 #include "nsSVGGraphicElement.h"
 #include "nsSVGLength2.h"
 #include "nsSVGViewBox.h"
 #include "SVGAnimatedPreserveAspectRatio.h"
+#include "mozilla/Attributes.h"
 
 class nsSVGOrientType
 {
 public:
   nsSVGOrientType()
    : mAnimVal(nsIDOMSVGMarkerElement::SVG_MARKER_ORIENT_ANGLE),
      mBaseVal(nsIDOMSVGMarkerElement::SVG_MARKER_ORIENT_ANGLE) {}
 
@@ -41,17 +42,17 @@ public:
 
   nsresult ToDOMAnimatedEnum(nsIDOMSVGAnimatedEnumeration **aResult,
                              nsSVGElement* aSVGElement);
 
 private:
   nsSVGEnumValue mAnimVal;
   nsSVGEnumValue mBaseVal;
 
-  struct DOMAnimatedEnum : public nsIDOMSVGAnimatedEnumeration
+  struct DOMAnimatedEnum MOZ_FINAL : public nsIDOMSVGAnimatedEnumeration
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedEnum)
 
     DOMAnimatedEnum(nsSVGOrientType* aVal,
                     nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
 
--- a/content/svg/content/src/nsSVGNumber2.cpp
+++ b/content/svg/content/src/nsSVGNumber2.cpp
@@ -7,18 +7,19 @@
 #include "nsSVGUtils.h"
 #include "nsTextFormatter.h"
 #include "prdtoa.h"
 #include "nsMathUtils.h"
 #include "nsContentUtils.h" // NS_ENSURE_FINITE
 #include "nsSMILValue.h"
 #include "nsSMILFloatType.h"
 #include "nsIDOMSVGNumber.h"
+#include "mozilla/Attributes.h"
 
-class DOMSVGNumber : public nsIDOMSVGNumber
+class DOMSVGNumber MOZ_FINAL : public nsIDOMSVGNumber
 {
 public:
   NS_DECL_ISUPPORTS
 
   DOMSVGNumber() 
     : mVal(0) {}
     
   NS_IMETHOD GetValue(float* aResult)
--- a/content/svg/content/src/nsSVGNumber2.h
+++ b/content/svg/content/src/nsSVGNumber2.h
@@ -8,16 +8,17 @@
 
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
 #include "nsIDOMSVGAnimatedNumber.h"
 #include "nsISMILAttr.h"
 #include "nsMathUtils.h"
 #include "nsSVGElement.h"
+#include "mozilla/Attributes.h"
 
 class nsISMILAnimationElement;
 class nsSMILValue;
 
 class nsSVGNumber2
 {
 
 public:
@@ -56,17 +57,17 @@ private:
 
   float mAnimVal;
   float mBaseVal;
   PRUint8 mAttrEnum; // element specified tracking for attribute
   bool mIsAnimated;
   bool mIsBaseSet;
 
 public:
-  struct DOMAnimatedNumber : public nsIDOMSVGAnimatedNumber
+  struct DOMAnimatedNumber MOZ_FINAL : public nsIDOMSVGAnimatedNumber
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedNumber)
 
     DOMAnimatedNumber(nsSVGNumber2* aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
 
     nsSVGNumber2* mVal; // kept alive because it belongs to content
--- a/content/svg/content/src/nsSVGNumberPair.h
+++ b/content/svg/content/src/nsSVGNumberPair.h
@@ -8,16 +8,17 @@
 
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsError.h"
 #include "nsIDOMSVGAnimatedNumber.h"
 #include "nsISMILAttr.h"
 #include "nsMathUtils.h"
 #include "nsSVGElement.h"
+#include "mozilla/Attributes.h"
 
 class nsISMILAnimationElement;
 class nsSMILValue;
 
 class nsSVGNumberPair
 {
 
 public:
@@ -64,17 +65,17 @@ private:
 
   float mAnimVal[2];
   float mBaseVal[2];
   PRUint8 mAttrEnum; // element specified tracking for attribute
   bool mIsAnimated;
   bool mIsBaseSet;
 
 public:
-  struct DOMAnimatedNumber : public nsIDOMSVGAnimatedNumber
+  struct DOMAnimatedNumber MOZ_FINAL : public nsIDOMSVGAnimatedNumber
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedNumber)
 
     DOMAnimatedNumber(nsSVGNumberPair* aVal, PairIndex aIndex, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement), mIndex(aIndex) {}
 
     nsSVGNumberPair* mVal; // kept alive because it belongs to content
--- a/content/svg/content/src/nsSVGRect.h
+++ b/content/svg/content/src/nsSVGRect.h
@@ -3,29 +3,30 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __NS_SVGRECT_H__
 #define __NS_SVGRECT_H__
 
 #include "gfxRect.h"
 #include "nsIDOMSVGRect.h"
+#include "mozilla/Attributes.h"
 
 nsresult
 NS_NewSVGRect(nsIDOMSVGRect** result,
               float x=0.0f, float y=0.0f,
               float width=0.0f, float height=0.0f);
 
 nsresult
 NS_NewSVGRect(nsIDOMSVGRect** result, const gfxRect& rect);
 
 ////////////////////////////////////////////////////////////////////////
 // nsSVGRect class
 
-class nsSVGRect : public nsIDOMSVGRect
+class nsSVGRect MOZ_FINAL : public nsIDOMSVGRect
 {
 public:
   nsSVGRect(float x=0.0f, float y=0.0f, float w=0.0f, float h=0.0f);
 
   // nsISupports interface:
   NS_DECL_ISUPPORTS
 
   // nsIDOMSVGRect interface:
--- a/content/svg/content/src/nsSVGSVGElement.h
+++ b/content/svg/content/src/nsSVGSVGElement.h
@@ -13,16 +13,17 @@
 #include "nsIDOMSVGPoint.h"
 #include "nsIDOMSVGSVGElement.h"
 #include "nsIDOMSVGZoomAndPan.h"
 #include "nsSVGEnum.h"
 #include "nsSVGLength2.h"
 #include "nsSVGStylableElement.h"
 #include "nsSVGViewBox.h"
 #include "SVGAnimatedPreserveAspectRatio.h"
+#include "mozilla/Attributes.h"
 
 class nsIDOMSVGMatrix;
 class nsSMILTimeContainer;
 class nsSVGViewElement;
 namespace mozilla {
   class SVGFragmentIdentifier;
 }
 
@@ -54,17 +55,17 @@ public:
   nsresult ToDOMVal(nsSVGSVGElement *aElement, nsIDOMSVGPoint **aResult);
 
   bool operator!=(const nsSVGTranslatePoint &rhs) const {
     return mX != rhs.mX || mY != rhs.mY;
   }
 
 private:
 
-  struct DOMVal : public nsIDOMSVGPoint {
+  struct DOMVal MOZ_FINAL : public nsIDOMSVGPoint {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMVal)
 
     DOMVal(nsSVGTranslatePoint* aVal, nsSVGSVGElement *aElement)
       : mVal(aVal), mElement(aElement) {}
 
     NS_IMETHOD GetX(float *aValue)
       { *aValue = mVal->GetX(); return NS_OK; }
--- a/content/svg/content/src/nsSVGString.h
+++ b/content/svg/content/src/nsSVGString.h
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __NS_SVGSTRING_H__
 #define __NS_SVGSTRING_H__
 
 #include "nsDOMError.h"
 #include "nsIDOMSVGAnimatedString.h"
 #include "nsSVGElement.h"
+#include "mozilla/Attributes.h"
 
 class nsSVGString
 {
 
 public:
   void Init(PRUint8 aAttrEnum) {
     mAnimVal = nsnull;
     mAttrEnum = aAttrEnum;
@@ -44,17 +45,17 @@ public:
 
 private:
 
   nsAutoPtr<nsString> mAnimVal;
   PRUint8 mAttrEnum; // element specified tracking for attribute
   bool mIsBaseSet;
 
 public:
-  struct DOMAnimatedString : public nsIDOMSVGAnimatedString
+  struct DOMAnimatedString MOZ_FINAL : public nsIDOMSVGAnimatedString
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedString)
 
     DOMAnimatedString(nsSVGString *aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
 
     nsSVGString* mVal; // kept alive because it belongs to content
--- a/content/svg/content/src/nsSVGViewBox.h
+++ b/content/svg/content/src/nsSVGViewBox.h
@@ -9,16 +9,17 @@
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsDOMError.h"
 #include "nsError.h"
 #include "nsIDOMSVGAnimatedRect.h"
 #include "nsIDOMSVGRect.h"
 #include "nsISMILAttr.h"
 #include "nsSVGElement.h"
+#include "mozilla/Attributes.h"
 
 class nsISMILAnimationElement;
 class nsSMILValue;
 
 struct nsSVGViewBoxRect
 {
   float x, y;
   float width, height;
@@ -73,17 +74,17 @@ public:
   nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement);
   
 private:
 
   nsSVGViewBoxRect mBaseVal;
   nsAutoPtr<nsSVGViewBoxRect> mAnimVal;
   bool mHasBaseVal;
 
-  struct DOMBaseVal : public nsIDOMSVGRect
+  struct DOMBaseVal MOZ_FINAL : public nsIDOMSVGRect
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMBaseVal)
 
     DOMBaseVal(nsSVGViewBox *aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
 
     nsSVGViewBox* mVal; // kept alive because it belongs to content
@@ -99,17 +100,17 @@ private:
       { *aHeight = mVal->GetBaseValue().height; return NS_OK; }
 
     NS_IMETHOD SetX(float aX);
     NS_IMETHOD SetY(float aY);
     NS_IMETHOD SetWidth(float aWidth);
     NS_IMETHOD SetHeight(float aHeight);
   };
 
-  struct DOMAnimVal : public nsIDOMSVGRect
+  struct DOMAnimVal MOZ_FINAL : public nsIDOMSVGRect
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimVal)
 
     DOMAnimVal(nsSVGViewBox *aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
 
     nsSVGViewBox* mVal; // kept alive because it belongs to content
@@ -148,17 +149,17 @@ private:
       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
     NS_IMETHOD SetWidth(float aWidth)
       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
     NS_IMETHOD SetHeight(float aHeight)
       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
   };
 
 public:
-  struct DOMAnimatedRect : public nsIDOMSVGAnimatedRect
+  struct DOMAnimatedRect MOZ_FINAL : public nsIDOMSVGAnimatedRect
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimatedRect)
 
     DOMAnimatedRect(nsSVGViewBox *aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
 
     nsSVGViewBox* mVal; // kept alive because it belongs to content
--- a/content/xbl/src/nsXBLService.cpp
+++ b/content/xbl/src/nsXBLService.cpp
@@ -48,16 +48,17 @@
 #include "nsXBLSerialize.h"
 
 #ifdef MOZ_XUL
 #include "nsXULPrototypeCache.h"
 #endif
 #include "nsIDOMEventListener.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/Element.h"
+#include "mozilla/Attributes.h"
 
 using namespace mozilla;
 
 #define NS_MAX_XBL_BINDING_RECURSION 20
 
 nsXBLService* nsXBLService::gInstance = nsnull;
 
 static bool
@@ -177,17 +178,18 @@ static const size_t kBucketSizes[] = {
 
 static const PRInt32 kNumBuckets = sizeof(kBucketSizes)/sizeof(size_t);
 static const PRInt32 kNumElements = 64;
 static const PRInt32 kInitialSize = sizeof(nsXBLBindingRequest) * kNumElements;
 
 // nsXBLStreamListener, a helper class used for 
 // asynchronous parsing of URLs
 /* Header file */
-class nsXBLStreamListener : public nsIStreamListener, public nsIDOMEventListener
+class nsXBLStreamListener MOZ_FINAL : public nsIStreamListener,
+                                      public nsIDOMEventListener
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSIDOMEVENTLISTENER
 
   nsXBLStreamListener(nsIDocument* aBoundDocument,
--- a/content/xslt/src/xpath/nsXPathEvaluator.h
+++ b/content/xslt/src/xpath/nsXPathEvaluator.h
@@ -9,22 +9,23 @@
 #include "nsIDOMXPathEvaluator.h"
 #include "nsIXPathEvaluatorInternal.h"
 #include "nsIWeakReference.h"
 #include "nsAutoPtr.h"
 #include "nsString.h"
 #include "txResultRecycler.h"
 #include "nsAgg.h"
 #include "nsTArray.h"
+#include "mozilla/Attributes.h"
 
 /**
  * A class for evaluating an XPath expression string
  */
-class nsXPathEvaluator : public nsIDOMXPathEvaluator,
-                         public nsIXPathEvaluatorInternal
+class nsXPathEvaluator MOZ_FINAL : public nsIDOMXPathEvaluator,
+                                   public nsIXPathEvaluatorInternal
 {
 public:
     nsXPathEvaluator(nsISupports *aOuter);
 
     nsresult Init();
 
     // nsISupports interface (support aggregation)
     NS_DECL_AGGREGATED
--- a/content/xslt/src/xpath/nsXPathExpression.h
+++ b/content/xslt/src/xpath/nsXPathExpression.h
@@ -7,25 +7,26 @@
 #define nsXPathExpression_h__
 
 #include "nsIDOMXPathExpression.h"
 #include "nsIDOMNSXPathExpression.h"
 #include "txIXPathContext.h"
 #include "txResultRecycler.h"
 #include "nsAutoPtr.h"
 #include "nsCycleCollectionParticipant.h"
+#include "mozilla/Attributes.h"
 
 class Expr;
 class txXPathNode;
 
 /**
  * A class for evaluating an XPath expression string
  */
-class nsXPathExpression : public nsIDOMXPathExpression,
-                          public nsIDOMNSXPathExpression
+class nsXPathExpression MOZ_FINAL : public nsIDOMXPathExpression,
+                                    public nsIDOMNSXPathExpression
 {
 public:
     nsXPathExpression(nsAutoPtr<Expr>& aExpression, txResultRecycler* aRecycler,
                       nsIDOMDocument *aDocument);
 
     // nsISupports interface
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXPathExpression,
--- a/content/xslt/src/xpath/nsXPathNSResolver.h
+++ b/content/xslt/src/xpath/nsXPathNSResolver.h
@@ -5,21 +5,22 @@
 
 #ifndef nsXPathNSResolver_h__
 #define nsXPathNSResolver_h__
 
 #include "nsIDOMXPathNSResolver.h"
 #include "nsIDOMNode.h"
 #include "nsCOMPtr.h"
 #include "nsCycleCollectionParticipant.h"
+#include "mozilla/Attributes.h"
 
 /**
  * A class for evaluating an XPath expression string
  */
-class nsXPathNSResolver : public nsIDOMXPathNSResolver
+class nsXPathNSResolver MOZ_FINAL : public nsIDOMXPathNSResolver
 {
 public:
     nsXPathNSResolver(nsIDOMNode* aNode);
 
     // nsISupports interface
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(nsXPathNSResolver)
 
--- a/content/xslt/src/xpath/nsXPathResult.h
+++ b/content/xslt/src/xpath/nsXPathResult.h
@@ -9,16 +9,17 @@
 #include "txExprResult.h"
 #include "nsIDOMXPathResult.h"
 #include "nsIDocument.h"
 #include "nsStubMutationObserver.h"
 #include "nsCOMPtr.h"
 #include "nsCOMArray.h"
 #include "nsWeakPtr.h"
 #include "nsCycleCollectionParticipant.h"
+#include "mozilla/Attributes.h"
 
 // {662f2c9a-c7cd-4cab-9349-e733df5a838c}
 #define NS_IXPATHRESULT_IID \
 { 0x662f2c9a, 0xc7cd, 0x4cab, {0x93, 0x49, 0xe7, 0x33, 0xdf, 0x5a, 0x83, 0x8c }}
 
 class nsIXPathResult : public nsISupports
 {
 public:
@@ -30,19 +31,19 @@ public:
     virtual nsresult Clone(nsIXPathResult **aResult) = 0;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPathResult, NS_IXPATHRESULT_IID)
 
 /**
  * A class for evaluating an XPath expression string
  */
-class nsXPathResult : public nsIDOMXPathResult,
-                      public nsStubMutationObserver,
-                      public nsIXPathResult
+class nsXPathResult MOZ_FINAL : public nsIDOMXPathResult,
+                                public nsStubMutationObserver,
+                                public nsIXPathResult
 {
 public:
     nsXPathResult();
     nsXPathResult(const nsXPathResult &aResult);
     ~nsXPathResult();
 
     // nsISupports interface
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
--- a/content/xslt/src/xpath/txXPCOMExtensionFunction.cpp
+++ b/content/xslt/src/xpath/txXPCOMExtensionFunction.cpp
@@ -11,20 +11,21 @@
 #include "nsServiceManagerUtils.h"
 #include "txExpr.h"
 #include "txIFunctionEvaluationContext.h"
 #include "txIXPathContext.h"
 #include "txNodeSetAdaptor.h"
 #include "txXPathTreeWalker.h"
 #include "xptcall.h"
 #include "txXPathObjectAdaptor.h"
+#include "mozilla/Attributes.h"
 
 NS_IMPL_ISUPPORTS1(txXPathObjectAdaptor, txIXPathObject)
 
-class txFunctionEvaluationContext : public txIFunctionEvaluationContext
+class txFunctionEvaluationContext MOZ_FINAL : public txIFunctionEvaluationContext
 {
 public:
     txFunctionEvaluationContext(txIEvalContext *aContext, nsISupports *aState);
 
     NS_DECL_ISUPPORTS
     NS_DECL_TXIFUNCTIONEVALUATIONCONTEXT
 
     void ClearContext()
--- a/content/xslt/src/xpath/txXPathObjectAdaptor.h
+++ b/content/xslt/src/xpath/txXPathObjectAdaptor.h
@@ -19,16 +19,17 @@ class txXPathObjectAdaptor : public txIX
 {
 public:
     txXPathObjectAdaptor(txAExprResult *aValue) : mValue(aValue)
     {
         NS_ASSERTION(aValue,
                      "Don't create a txXPathObjectAdaptor if you don't have a "
                      "txAExprResult");
     }
+    virtual ~txXPathObjectAdaptor() {}
 
     NS_DECL_ISUPPORTS
 
     NS_IMETHODIMP_(txAExprResult*) GetResult()
     {
         return mValue;
     }
 
--- a/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp
+++ b/content/xslt/src/xslt/txMozillaStylesheetCompiler.cpp
@@ -35,16 +35,17 @@
 #include "txStylesheetCompiler.h"
 #include "txXMLUtils.h"
 #include "nsAttrName.h"
 #include "nsIScriptError.h"
 #include "nsIURL.h"
 #include "nsCrossSiteListenerProxy.h"
 #include "nsDOMError.h"
 #include "mozilla/dom/Element.h"
+#include "mozilla/Attributes.h"
 
 using namespace mozilla;
 
 static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID);
 
 static void
 getSpec(nsIChannel* aChannel, nsAString& aSpec)
 {
@@ -58,20 +59,20 @@ getSpec(nsIChannel* aChannel, nsAString&
         return;
     }
 
     nsCAutoString spec;
     uri->GetSpec(spec);
     AppendUTF8toUTF16(spec, aSpec);
 }
 
-class txStylesheetSink : public nsIXMLContentSink,
-                         public nsIExpatSink,
-                         public nsIStreamListener,
-                         public nsIInterfaceRequestor
+class txStylesheetSink MOZ_FINAL : public nsIXMLContentSink,
+                                   public nsIExpatSink,
+                                   public nsIStreamListener,
+                                   public nsIInterfaceRequestor
 {
 public:
     txStylesheetSink(txStylesheetCompiler* aCompiler, nsIParser* aParser);
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIEXPATSINK
     NS_DECL_NSISTREAMLISTENER
     NS_DECL_NSIREQUESTOBSERVER
@@ -358,17 +359,17 @@ txStylesheetSink::GetInterface(const nsI
         *aResult = rawPtr;
 
         return NS_OK;
     }
 
     return NS_ERROR_NO_INTERFACE;
 }
 
-class txCompileObserver : public txACompileObserver
+class txCompileObserver MOZ_FINAL : public txACompileObserver
 {
 public:
     txCompileObserver(txMozillaXSLTProcessor* aProcessor,
                       nsILoadGroup* aLoadGroup);
 
     TX_DECL_ACOMPILEOBSERVER
     NS_INLINE_DECL_REFCOUNTING(txCompileObserver)
 
@@ -591,17 +592,17 @@ handleNode(nsINode* aNode, txStylesheetC
             rv = handleNode(child, aCompiler);
             NS_ENSURE_SUCCESS(rv, rv);
         }
     }
 
     return NS_OK;
 }
 
-class txSyncCompileObserver : public txACompileObserver
+class txSyncCompileObserver MOZ_FINAL : public txACompileObserver
 {
 public:
     txSyncCompileObserver(txMozillaXSLTProcessor* aProcessor);
 
     TX_DECL_ACOMPILEOBSERVER
     NS_INLINE_DECL_REFCOUNTING(txSyncCompileObserver)
 
 protected:
--- a/content/xslt/src/xslt/txMozillaXMLOutput.h
+++ b/content/xslt/src/xslt/txMozillaXMLOutput.h
@@ -8,31 +8,32 @@
 
 #include "txXMLEventHandler.h"
 #include "nsAutoPtr.h"
 #include "nsIScriptLoaderObserver.h"
 #include "txOutputFormat.h"
 #include "nsCOMArray.h"
 #include "nsICSSLoaderObserver.h"
 #include "txStack.h"
+#include "mozilla/Attributes.h"
 
 class nsIContent;
 class nsIDOMDocument;
 class nsIAtom;
 class nsIDOMDocumentFragment;
 class nsIDOMElement;
 class nsIStyleSheet;
 class nsIDOMNode;
 class nsITransformObserver;
 class nsNodeInfoManager;
 class nsIDocument;
 class nsINode;
 
-class txTransformNotifier : public nsIScriptLoaderObserver,
-                            public nsICSSLoaderObserver
+class txTransformNotifier MOZ_FINAL : public nsIScriptLoaderObserver,
+                                      public nsICSSLoaderObserver
 {
 public:
     txTransformNotifier();
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSISCRIPTLOADEROBSERVER
     
     // nsICSSLoaderObserver
--- a/content/xslt/src/xslt/txMozillaXSLTProcessor.h
+++ b/content/xslt/src/xslt/txMozillaXSLTProcessor.h
@@ -10,16 +10,17 @@
 #include "nsStubMutationObserver.h"
 #include "nsIDocumentTransformer.h"
 #include "nsIXSLTProcessor.h"
 #include "nsIXSLTProcessorPrivate.h"
 #include "txExpandedNameMap.h"
 #include "txNamespaceMap.h"
 #include "nsIJSNativeInitializer.h"
 #include "nsCycleCollectionParticipant.h"
+#include "mozilla/Attributes.h"
 
 class nsIDOMNode;
 class nsIPrincipal;
 class nsIURI;
 class nsIXMLContentSink;
 class txStylesheet;
 class txResultRecycler;
 class txIGlobalParameter;
@@ -31,21 +32,21 @@ class txIGlobalParameter;
 #define TRANSFORMIIX_XSLT_PROCESSOR_CONTRACTID \
 "@mozilla.org/document-transformer;1?type=xslt"
 
 #define XSLT_MSGS_URL  "chrome://global/locale/xslt/xslt.properties"
 
 /**
  * txMozillaXSLTProcessor is a front-end to the XSLT Processor.
  */
-class txMozillaXSLTProcessor : public nsIXSLTProcessor,
-                               public nsIXSLTProcessorPrivate,
-                               public nsIDocumentTransformer,
-                               public nsStubMutationObserver,
-                               public nsIJSNativeInitializer
+class txMozillaXSLTProcessor MOZ_FINAL : public nsIXSLTProcessor,
+                                         public nsIXSLTProcessorPrivate,
+                                         public nsIDocumentTransformer,
+                                         public nsStubMutationObserver,
+                                         public nsIJSNativeInitializer
 {
 public:
     /**
      * Creates a new txMozillaXSLTProcessor
      */
     txMozillaXSLTProcessor();
 
     /**
--- a/content/xtf/src/nsXMLContentBuilder.cpp
+++ b/content/xtf/src/nsXMLContentBuilder.cpp
@@ -15,20 +15,21 @@
 #include "nsContentCID.h"
 #include "nsIDocument.h"
 #include "nsIDOMElement.h"
 #include "nsIDOMDocument.h"
 #include "nsIDOMText.h"
 #include "nsNodeInfoManager.h"
 #include "nsContentCreatorFunctions.h"
 #include "nsContentUtils.h"
+#include "mozilla/Attributes.h"
 
 static NS_DEFINE_CID(kXMLDocumentCID, NS_XMLDOCUMENT_CID);
 
-class nsXMLContentBuilder : public nsIXMLContentBuilder
+class nsXMLContentBuilder MOZ_FINAL : public nsIXMLContentBuilder
 {
 protected:
   friend nsresult NS_NewXMLContentBuilder(nsIXMLContentBuilder** aResult);
   
   nsXMLContentBuilder();
   ~nsXMLContentBuilder();
   
 public:
--- a/content/xtf/src/nsXTFElementWrapper.h
+++ b/content/xtf/src/nsXTFElementWrapper.h
@@ -5,16 +5,17 @@
 
 #ifndef __NS_XTFELEMENTWRAPPER_H__
 #define __NS_XTFELEMENTWRAPPER_H__
 
 #include "nsIXTFElementWrapper.h"
 #include "nsXMLElement.h"
 #include "nsIXTFAttributeHandler.h"
 #include "nsIXTFElement.h"
+#include "mozilla/Attributes.h"
 
 typedef nsXMLElement nsXTFElementWrapperBase;
 class nsXTFClassInfo;
 
 // Pseudo IID for nsXTFElementWrapper
 // {599EB85F-ABC0-4B52-A1B0-EA103D48E3AE}
 #define NS_XTFELEMENTWRAPPER_IID \
 { 0x599eb85f, 0xabc0, 0x4b52, { 0xa1, 0xb0, 0xea, 0x10, 0x3d, 0x48, 0xe3, 0xae } }
@@ -161,17 +162,17 @@ protected:
 
   nsCOMPtr<nsIAtom> mClassAttributeName;
 
   nsRefPtr<nsXTFClassInfo> mClassInfo;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsXTFElementWrapper, NS_XTFELEMENTWRAPPER_IID)
 
-class nsXTFClassInfo : public nsXPCClassInfo
+class nsXTFClassInfo MOZ_FINAL : public nsXPCClassInfo
 {
 public:
   nsXTFClassInfo(nsXTFElementWrapper* aWrapper) : mWrapper(aWrapper) {}
 
   void Disconnect() { mWrapper = nsnull; }
 
   NS_DECL_ISUPPORTS
   NS_FORWARD_SAFE_NSICLASSINFO(mWrapper);
--- a/content/xtf/src/nsXTFInterfaceAggregator.cpp
+++ b/content/xtf/src/nsXTFInterfaceAggregator.cpp
@@ -4,24 +4,25 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsCOMPtr.h"
 #include "nsXPTCUtils.h"
 #include "nsIInterfaceInfo.h"
 #include "nsIInterfaceInfoManager.h"
 #include "nsServiceManagerUtils.h"
 #include "nsAutoPtr.h"
+#include "mozilla/Attributes.h"
 #ifdef DEBUG
 #include <stdio.h>
 #endif
 
 ////////////////////////////////////////////////////////////////////////
 // nsXTFInterfaceAggregator class
 
-class nsXTFInterfaceAggregator : protected nsAutoXPTCStub
+class nsXTFInterfaceAggregator MOZ_FINAL : protected nsAutoXPTCStub
 {
 protected:
   friend nsresult
   NS_NewXTFInterfaceAggregator(const nsIID& iid,
                                nsISupports* inner,
                                nsISupports* outer,
                                void** result);
 
--- a/content/xtf/src/nsXTFService.cpp
+++ b/content/xtf/src/nsXTFService.cpp
@@ -7,21 +7,22 @@
 #include "nsINodeInfo.h"
 #include "nsIServiceManager.h"
 #include "nsIXTFElement.h"
 #include "nsIXTFElementFactory.h"
 #include "nsIXTFService.h"
 #include "nsInterfaceHashtable.h"
 #include "nsString.h"
 #include "nsXTFElementWrapper.h"
+#include "mozilla/Attributes.h"
 
 
 ////////////////////////////////////////////////////////////////////////
 // nsXTFService class 
-class nsXTFService : public nsIXTFService
+class nsXTFService MOZ_FINAL : public nsIXTFService
 {
 protected:
   friend nsresult NS_NewXTFService(nsIXTFService** aResult);
   
   nsXTFService();
 
 public:
   // nsISupports interface
--- a/content/xtf/src/nsXTFWeakTearoff.cpp
+++ b/content/xtf/src/nsXTFWeakTearoff.cpp
@@ -4,24 +4,25 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsCOMPtr.h"
 #include "nsXPTCUtils.h"
 #include "nsIInterfaceInfo.h"
 #include "nsIInterfaceInfoManager.h"
 #include "nsServiceManagerUtils.h"
 #include "nsAutoPtr.h"
+#include "mozilla/Attributes.h"
 #ifdef DEBUG
 #include <stdio.h>
 #endif
 
 ////////////////////////////////////////////////////////////////////////
 // nsXTFWeakTearoff class
 
-class nsXTFWeakTearoff : protected nsAutoXPTCStub
+class nsXTFWeakTearoff MOZ_FINAL : protected nsAutoXPTCStub
 {
 protected:
   ~nsXTFWeakTearoff();
   
 public:
   nsXTFWeakTearoff(const nsIID& iid,
                    nsISupports* obj,
                    nsresult *rv);
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -82,16 +82,17 @@
 #include "nsGkAtoms.h"
 #include "nsXULContentUtils.h"
 #include "nsNodeUtils.h"
 #include "nsFrameLoader.h"
 #include "prlog.h"
 #include "rdf.h"
 #include "nsIControllers.h"
 #include "nsAttrValueOrString.h"
+#include "mozilla/Attributes.h"
 
 // The XUL doc interface
 #include "nsIDOMXULDocument.h"
 
 #include "nsReadableUtils.h"
 #include "nsIFrame.h"
 #include "nsNodeInfoManager.h"
 #include "nsXBLBinding.h"
@@ -101,17 +102,17 @@
 #include "nsIDOMNSEvent.h"
 #include "nsCCUncollectableMarker.h"
 
 namespace css = mozilla::css;
 
 /**
  * A tearoff class for nsXULElement to implement nsIScriptEventHandlerOwner.
  */
-class nsScriptEventHandlerOwnerTearoff : public nsIScriptEventHandlerOwner
+class nsScriptEventHandlerOwnerTearoff MOZ_FINAL : public nsIScriptEventHandlerOwner
 {
 public:
     nsScriptEventHandlerOwnerTearoff(nsXULElement* aElement)
     : mElement(aElement) {}
 
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(nsScriptEventHandlerOwnerTearoff)
 
@@ -140,18 +141,18 @@ PRUint32             nsXULPrototypeAttri
 PRUint32             nsXULPrototypeAttribute::gNumAttributes;
 PRUint32             nsXULPrototypeAttribute::gNumEventHandlers;
 PRUint32             nsXULPrototypeAttribute::gNumCacheTests;
 PRUint32             nsXULPrototypeAttribute::gNumCacheHits;
 PRUint32             nsXULPrototypeAttribute::gNumCacheSets;
 PRUint32             nsXULPrototypeAttribute::gNumCacheFills;
 #endif
 
-class nsXULElementTearoff : public nsIDOMElementCSSInlineStyle,
-                            public nsIFrameLoaderOwner
+class nsXULElementTearoff MOZ_FINAL : public nsIDOMElementCSSInlineStyle,
+                                      public nsIFrameLoaderOwner
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULElementTearoff,
                                            nsIDOMElementCSSInlineStyle)
 
   nsXULElementTearoff(nsXULElement *aElement)
     : mElement(aElement)
--- a/content/xul/templates/src/nsRDFQuery.h
+++ b/content/xul/templates/src/nsRDFQuery.h
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsRDFQuery_h__
 #define nsRDFQuery_h__
 
 #include "nsAutoPtr.h"
 #include "nsISimpleEnumerator.h"
 #include "nsCycleCollectionParticipant.h"
+#include "mozilla/Attributes.h"
 
 #define NS_ITEMPLATERDFQUERY_IID \
   {0x8929ff60, 0x1c9c, 0x4d87, \
     { 0xac, 0x02, 0x09, 0x14, 0x15, 0x3b, 0x48, 0xc4 }}
 
 /**
  * A compiled query in the RDF query processor. This interface should not be
  * used directly outside of the RDF query processor.
@@ -31,17 +32,17 @@ public:
 
     // return the <query> node the query was compiled from
     virtual void GetQueryNode(nsIDOMNode** aQueryNode) = 0;
 
     // remove any results that are cached by the query
     virtual void ClearCachedResults() = 0;
 };
 
-class nsRDFQuery : public nsITemplateRDFQuery
+class nsRDFQuery MOZ_FINAL : public nsITemplateRDFQuery
 {
 public:
 
     nsRDFQuery(nsXULTemplateQueryProcessorRDF* aProcessor)
       : mProcessor(aProcessor),
         mSimple(false),
         mRoot(nsnull),
         mCachedResults(nsnull)
--- a/content/xul/templates/src/nsXMLBinding.h
+++ b/content/xul/templates/src/nsXMLBinding.h
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsXMLBinding_h__
 #define nsXMLBinding_h__
 
 #include "nsAutoPtr.h"
 #include "nsIAtom.h"
 #include "nsCycleCollectionParticipant.h"
+#include "mozilla/Attributes.h"
 
 class nsXULTemplateResultXML;
 class nsXMLBindingValues;
 
 /**
  * Classes related to storing bindings for XML handling.
  */
 
@@ -37,17 +38,17 @@ struct nsXMLBinding {
     MOZ_COUNT_DTOR(nsXMLBinding);
   }
 };
 
 /**
  * a collection of <binding> descriptors. This object is refcounted by
  * nsXMLBindingValues objects and the query processor.
  */
-class nsXMLBindingSet
+class nsXMLBindingSet MOZ_FINAL
 {
 public:
 
   // results hold a reference to a binding set in their
   // nsXMLBindingValues fields
   nsAutoRefCnt mRefCnt;
 
   // pointer to the first binding in a linked list
--- a/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.h
+++ b/content/xul/templates/src/nsXULTemplateQueryProcessorRDF.h
@@ -25,30 +25,31 @@
 #include "nsRDFBinding.h"
 #include "nsXULTemplateResultSetRDF.h"
 #include "nsCOMArray.h"
 #include "nsIArray.h"
 #include "nsString.h"
 #include "nsClassHashtable.h"
 #include "nsRefPtrHashtable.h"
 #include "nsCycleCollectionParticipant.h"
+#include "mozilla/Attributes.h"
 
 #include "prlog.h"
 #ifdef PR_LOGGING
 extern PRLogModuleInfo* gXULTemplateLog;
 #endif
 
 class nsIRDFCompositeDataSource;
 class nsXULTemplateResultRDF;
 
 /**
  * An object that generates results from a query on an RDF graph
  */
-class nsXULTemplateQueryProcessorRDF : public nsIXULTemplateQueryProcessor,
-                                       public nsIRDFObserver
+class nsXULTemplateQueryProcessorRDF MOZ_FINAL : public nsIXULTemplateQueryProcessor,
+                                                 public nsIRDFObserver
 {
 public:
 
     nsXULTemplateQueryProcessorRDF();
 
     ~nsXULTemplateQueryProcessorRDF();
 
     nsresult InitGlobals();
--- a/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.h
+++ b/content/xul/templates/src/nsXULTemplateQueryProcessorStorage.h
@@ -11,20 +11,21 @@
 
 #include "nsISimpleEnumerator.h"
 #include "nsCOMArray.h"
 #include "nsIVariant.h"
 
 #include "mozIStorageValueArray.h"
 #include "mozIStorageStatement.h"
 #include "mozIStorageConnection.h"
+#include "mozilla/Attributes.h"
 
 class nsXULTemplateQueryProcessorStorage;
 
-class nsXULTemplateResultSetStorage : public nsISimpleEnumerator
+class nsXULTemplateResultSetStorage MOZ_FINAL : public nsISimpleEnumerator
 {
 private:
 
     nsCOMPtr<mozIStorageStatement> mStatement;
 
     nsCOMArray<nsIAtom> mColumnNames;
 
 public:
@@ -38,17 +39,17 @@ public:
     nsXULTemplateResultSetStorage(mozIStorageStatement* aStatement);
 
     PRInt32 GetColumnIndex(nsIAtom* aColumnName);
 
     void FillColumnValues(nsCOMArray<nsIVariant>& aArray);
 
 };
 
-class nsXULTemplateQueryProcessorStorage : public nsIXULTemplateQueryProcessor
+class nsXULTemplateQueryProcessorStorage MOZ_FINAL : public nsIXULTemplateQueryProcessor
 {
 public:
 
     nsXULTemplateQueryProcessorStorage();
 
     // nsISupports interface
     NS_DECL_ISUPPORTS
 
--- a/content/xul/templates/src/nsXULTemplateQueryProcessorXML.h
+++ b/content/xul/templates/src/nsXULTemplateQueryProcessorXML.h
@@ -16,24 +16,25 @@
 #include "nsIDOMElement.h"
 #include "nsIDOMEventListener.h"
 #include "nsIDOMXPathExpression.h"
 #include "nsIDOMXPathEvaluator.h"
 #include "nsIDOMXPathResult.h"
 #include "nsXMLBinding.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsIXMLHttpRequest.h"
+#include "mozilla/Attributes.h"
 
 class nsXULTemplateQueryProcessorXML;
 
 #define NS_IXMLQUERY_IID \
   {0x0358d692, 0xccce, 0x4a97, \
     { 0xb2, 0x51, 0xba, 0x8f, 0x17, 0x0f, 0x3b, 0x6f }}
  
-class nsXMLQuery : public nsISupports
+class nsXMLQuery MOZ_FINAL : public nsISupports
 {
   public:
     NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXMLQUERY_IID)
 
     NS_DECL_ISUPPORTS
 
     // return a weak reference to the processor the query was created from
     nsXULTemplateQueryProcessorXML* Processor() { return mProcessor; }
@@ -74,17 +75,17 @@ class nsXMLQuery : public nsISupports
 
     nsCOMPtr<nsIDOMXPathExpression> mResultsExpr;
 
     nsRefPtr<nsXMLBindingSet> mRequiredBindings;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsXMLQuery, NS_IXMLQUERY_IID)
 
-class nsXULTemplateResultSetXML : public nsISimpleEnumerator
+class nsXULTemplateResultSetXML MOZ_FINAL : public nsISimpleEnumerator
 {
 private:
 
     // reference back to the query
     nsCOMPtr<nsXMLQuery> mQuery;
 
     // the binding set created from <assign> nodes
     nsRefPtr<nsXMLBindingSet> mBindingSet;
@@ -108,18 +109,18 @@ public:
                               nsXMLBindingSet* aBindingSet)
         : mQuery(aQuery),
           mBindingSet(aBindingSet),
           mResults(aResults),
           mPosition(0)
     {}
 };
 
-class nsXULTemplateQueryProcessorXML : public nsIXULTemplateQueryProcessor,
-                                       public nsIDOMEventListener
+class nsXULTemplateQueryProcessorXML MOZ_FINAL : public nsIXULTemplateQueryProcessor,
+                                                 public nsIDOMEventListener
 {
 public:
 
     nsXULTemplateQueryProcessorXML()
         : mGenerationStarted(false)
     {}
 
     // nsISupports interface
--- a/content/xul/templates/src/nsXULTemplateResultRDF.h
+++ b/content/xul/templates/src/nsXULTemplateResultRDF.h
@@ -8,21 +8,22 @@
 
 #include "nsCOMPtr.h"
 #include "nsIRDFResource.h"
 #include "nsXULTemplateQueryProcessorRDF.h"
 #include "nsRDFQuery.h"
 #include "nsRuleNetwork.h"
 #include "nsIXULTemplateResult.h"
 #include "nsRDFBinding.h"
+#include "mozilla/Attributes.h"
 
 /**
  * A single result of a query on an RDF graph
  */
-class nsXULTemplateResultRDF : public nsIXULTemplateResult
+class nsXULTemplateResultRDF MOZ_FINAL : public nsIXULTemplateResult
 {
 public:
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(nsXULTemplateResultRDF)
 
     NS_DECL_NSIXULTEMPLATERESULT
 
     nsXULTemplateResultRDF(nsIRDFResource* aNode);
--- a/content/xul/templates/src/nsXULTemplateResultSetRDF.h
+++ b/content/xul/templates/src/nsXULTemplateResultSetRDF.h
@@ -6,24 +6,25 @@
 #ifndef nsXULTemplateResultSetRDF_h__
 #define nsXULTemplateResultSetRDF_h__
 
 #include "nsFixedSizeAllocator.h"
 #include "nsISimpleEnumerator.h"
 #include "nsRuleNetwork.h"
 #include "nsRDFQuery.h"
 #include "nsXULTemplateResultRDF.h"
+#include "mozilla/Attributes.h"
 
 class nsXULTemplateQueryProcessorRDF;
 class nsXULTemplateResultRDF;
 
 /**
  * An enumerator used to iterate over a set of results.
  */
-class nsXULTemplateResultSetRDF : public nsISimpleEnumerator
+class nsXULTemplateResultSetRDF MOZ_FINAL : public nsISimpleEnumerator
 {
 private:
     nsXULTemplateQueryProcessorRDF* mProcessor;
 
     nsRDFQuery* mQuery;
 
     const InstantiationSet* mInstantiations;
 
--- a/content/xul/templates/src/nsXULTemplateResultStorage.h
+++ b/content/xul/templates/src/nsXULTemplateResultStorage.h
@@ -5,21 +5,22 @@
 
 #ifndef nsXULTemplateResultStorage_h__
 #define nsXULTemplateResultStorage_h__
 
 #include "nsXULTemplateQueryProcessorStorage.h"
 #include "nsIRDFResource.h"
 #include "nsIXULTemplateResult.h"
 #include "nsAutoPtr.h"
+#include "mozilla/Attributes.h"
 
 /**
  * A single result of a query from mozstorage
  */
-class nsXULTemplateResultStorage : public nsIXULTemplateResult
+class nsXULTemplateResultStorage MOZ_FINAL : public nsIXULTemplateResult
 {
 public:
     NS_DECL_ISUPPORTS
 
     NS_DECL_NSIXULTEMPLATERESULT
 
     nsXULTemplateResultStorage(nsXULTemplateResultSetStorage* aResultSet);
 
--- a/content/xul/templates/src/nsXULTemplateResultXML.h
+++ b/content/xul/templates/src/nsXULTemplateResultXML.h
@@ -6,21 +6,22 @@
 #ifndef nsXULTemplateResultXML_h__
 #define nsXULTemplateResultXML_h__
 
 #include "nsCOMPtr.h"
 #include "nsIURI.h"
 #include "nsIRDFResource.h"
 #include "nsXULTemplateQueryProcessorXML.h"
 #include "nsIXULTemplateResult.h"
+#include "mozilla/Attributes.h"
 
 /**
  * An single result of an query
  */
-class nsXULTemplateResultXML : public nsIXULTemplateResult
+class nsXULTemplateResultXML MOZ_FINAL : public nsIXULTemplateResult
 {
 public:
     NS_DECL_ISUPPORTS
 
     NS_DECL_NSIXULTEMPLATERESULT
 
     nsXULTemplateResultXML(nsXMLQuery* aQuery,
                            nsIDOMNode* aNode,
--- a/layout/forms/nsFileControlFrame.h
+++ b/layout/forms/nsFileControlFrame.h
@@ -7,16 +7,17 @@
 #define nsFileControlFrame_h___
 
 #include "nsBlockFrame.h"
 #include "nsIFormControlFrame.h"
 #include "nsIDOMEventListener.h"
 #include "nsIAnonymousContentCreator.h"
 #include "nsICapturePicker.h"
 #include "nsCOMPtr.h"
+#include "mozilla/Attributes.h"
 
 class nsTextControlFrame;
 class nsIDOMDragEvent;
 
 class nsFileControlFrame : public nsBlockFrame,
                            public nsIFormControlFrame,
                            public nsIAnonymousContentCreator
 {
@@ -72,17 +73,17 @@ protected:
     nsICapturePicker* picker;
     PRUint32 mode;
   };
   
   PRUint32 GetCaptureMode(const CaptureCallbackData& aData);
   
   class MouseListener;
   friend class MouseListener;
-  class MouseListener : public nsIDOMEventListener {
+  class MouseListener MOZ_FINAL : public nsIDOMEventListener {
   public:
     NS_DECL_ISUPPORTS
     
     MouseListener(nsFileControlFrame* aFrame)
      : mFrame(aFrame) 
     {}
 
     void ForgetFrame() {
--- a/layout/printing/nsPagePrintTimer.h
+++ b/layout/printing/nsPagePrintTimer.h
@@ -5,23 +5,24 @@
 #ifndef nsPagePrintTimer_h___
 #define nsPagePrintTimer_h___
 
 // Timer Includes
 #include "nsITimer.h"
 
 #include "nsIDocumentViewerPrint.h"
 #include "nsPrintObject.h"
+#include "mozilla/Attributes.h"
 
 class nsPrintEngine;
 
 //---------------------------------------------------
 //-- Page Timer Class
 //---------------------------------------------------
-class nsPagePrintTimer : public nsITimerCallback
+class nsPagePrintTimer MOZ_FINAL : public nsITimerCallback
 {
 public:
 
   NS_DECL_ISUPPORTS
 
   nsPagePrintTimer();
   ~nsPagePrintTimer();
 
--- a/layout/printing/nsPrintEngine.h
+++ b/layout/printing/nsPrintEngine.h
@@ -7,16 +7,17 @@
 
 #include "mozilla/Attributes.h"
 
 #include "nsCOMPtr.h"
 
 #include "nsPrintObject.h"
 #include "nsPrintData.h"
 #include "nsFrameList.h"
+#include "mozilla/Attributes.h"
 
 // Interfaces
 #include "nsIDocument.h"
 #include "nsIDOMWindow.h"
 #include "nsIObserver.h"
 
 // Classes
 class nsPagePrintTimer;
@@ -27,17 +28,17 @@ class nsPrintObject;
 class nsIDocShell;
 class nsIPageSequenceFrame;
 class nsIWeakReference;
 
 //------------------------------------------------------------------------
 // nsPrintEngine Class
 //
 //------------------------------------------------------------------------
-class nsPrintEngine : public nsIObserver
+class nsPrintEngine MOZ_FINAL : public nsIObserver
 {
 public:
   // nsISupports interface...
   NS_DECL_ISUPPORTS
 
   // nsIObserver
   NS_DECL_NSIOBSERVER
 
--- a/layout/printing/nsPrintPreviewListener.h
+++ b/layout/printing/nsPrintPreviewListener.h
@@ -7,26 +7,27 @@
 #ifndef nsPrintPreviewListener_h__
 #define nsPrintPreviewListener_h__
 
 // Interfaces needed to be included
 #include "nsIDOMEventListener.h"
 #include "nsIDOMEventTarget.h"
 // Helper Classes
 #include "nsCOMPtr.h"
+#include "mozilla/Attributes.h"
 
 //
 // class nsPrintPreviewListener
 //
 // The class that listens to the chrome events and tells the embedding
 // chrome to show context menus, as appropriate. Handles registering itself
 // with the DOM with AddChromeListeners() and removing itself with
 // RemoveChromeListeners().
 //
-class nsPrintPreviewListener : public nsIDOMEventListener
+class nsPrintPreviewListener MOZ_FINAL : public nsIDOMEventListener
 
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMEVENTLISTENER
   
   nsPrintPreviewListener(nsIDOMEventTarget* aTarget);
 
--- a/layout/style/AnimationCommon.h
+++ b/layout/style/AnimationCommon.h
@@ -10,16 +10,17 @@
 #include "nsIStyleRule.h"
 #include "nsRefreshDriver.h"
 #include "prclist.h"
 #include "nsStyleAnimation.h"
 #include "nsCSSProperty.h"
 #include "mozilla/dom/Element.h"
 #include "nsSMILKeySpline.h"
 #include "nsStyleStruct.h"
+#include "mozilla/Attributes.h"
 
 class nsPresContext;
 
 namespace mozilla {
 namespace css {
 
 struct CommonElementAnimationData;
 
@@ -61,17 +62,17 @@ protected:
 
   PRCList mElementData;
   nsPresContext *mPresContext; // weak (non-null from ctor to Disconnect)
 };
 
 /**
  * A style rule that maps property-nsStyleAnimation::Value pairs.
  */
-class AnimValuesStyleRule : public nsIStyleRule
+class AnimValuesStyleRule MOZ_FINAL : public nsIStyleRule
 {
 public:
   // nsISupports implementation
   NS_DECL_ISUPPORTS
 
   // nsIStyleRule implementation
   virtual void MapRuleInfoInto(nsRuleData* aRuleData);
 #ifdef DEBUG
--- a/layout/style/Loader.h
+++ b/layout/style/Loader.h
@@ -13,16 +13,17 @@
 #include "nsAutoPtr.h"
 #include "nsCompatibility.h"
 #include "nsDataHashtable.h"
 #include "nsInterfaceHashtable.h"
 #include "nsRefPtrHashtable.h"
 #include "nsTArray.h"
 #include "nsTObserverArray.h"
 #include "nsURIHashKey.h"
+#include "mozilla/Attributes.h"
 
 class nsIAtom;
 class nsICSSLoaderObserver;
 class nsCSSStyleSheet;
 class nsIContent;
 class nsIDocument;
 class nsCSSParser;
 class nsMediaList;
@@ -101,17 +102,17 @@ class ImportRule;
 enum StyleSheetState {
   eSheetStateUnknown = 0,
   eSheetNeedsParser,
   eSheetPending,
   eSheetLoading,
   eSheetComplete
 };
 
-class Loader {
+class Loader MOZ_FINAL {
 public:
   Loader();
   Loader(nsIDocument*);
   ~Loader();
 
   // This isn't a COM class but it's reference-counted like one.
   NS_IMETHOD_(nsrefcnt) AddRef();
   NS_IMETHOD_(nsrefcnt) Release();
--- a/layout/xul/base/src/tree/src/nsTreeColumns.h
+++ b/layout/xul/base/src/tree/src/nsTreeColumns.h
@@ -5,31 +5,32 @@
 
 #ifndef nsTreeColumns_h__
 #define nsTreeColumns_h__
 
 #include "nsITreeColumns.h"
 #include "nsITreeBoxObject.h"
 #include "nsIContent.h"
 #include "nsIFrame.h"
+#include "mozilla/Attributes.h"
 
 class nsTreeBodyFrame;
 class nsTreeColumns;
 
 #define NS_TREECOLUMN_IMPL_CID                       \
 { /* 02cd1963-4b5d-4a6c-9223-814d3ade93a3 */         \
     0x02cd1963,                                      \
     0x4b5d,                                          \
     0x4a6c,                                          \
     {0x92, 0x23, 0x81, 0x4d, 0x3a, 0xde, 0x93, 0xa3} \
 }
 
 // This class is our column info.  We use it to iterate our columns and to obtain
 // information about each column.
-class nsTreeColumn : public nsITreeColumn {
+class nsTreeColumn MOZ_FINAL : public nsITreeColumn {
 public:
   nsTreeColumn(nsTreeColumns* aColumns, nsIContent* aContent);
   ~nsTreeColumn();
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_TREECOLUMN_IMPL_CID)
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(nsTreeColumn)
@@ -105,17 +106,17 @@ private:
   PRInt8 mTextAlignment;
 
   nsRefPtr<nsTreeColumn> mNext;
   nsTreeColumn* mPrevious;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsTreeColumn, NS_TREECOLUMN_IMPL_CID)
 
-class nsTreeColumns : public nsITreeColumns {
+class nsTreeColumns MOZ_FINAL : public nsITreeColumns {
 public:
   nsTreeColumns(nsITreeBoxObject* aTree);
   ~nsTreeColumns();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSITREECOLUMNS
 
   nsITreeColumn* GetColumnAt(PRInt32 aIndex);
--- a/layout/xul/base/src/tree/src/nsTreeContentView.h
+++ b/layout/xul/base/src/tree/src/nsTreeContentView.h
@@ -10,24 +10,25 @@
 #include "nsTArray.h"
 #include "nsIDocument.h"
 #include "nsStubDocumentObserver.h"
 #include "nsITreeBoxObject.h"
 #include "nsITreeColumns.h"
 #include "nsITreeView.h"
 #include "nsITreeContentView.h"
 #include "nsITreeSelection.h"
+#include "mozilla/Attributes.h"
 
 class Row;
 
 nsresult NS_NewTreeContentView(nsITreeView** aResult);
 
-class nsTreeContentView : public nsINativeTreeView,
-                          public nsITreeContentView,
-                          public nsStubDocumentObserver
+class nsTreeContentView MOZ_FINAL : public nsINativeTreeView,
+                                    public nsITreeContentView,
+                                    public nsStubDocumentObserver
 {
   public:
     nsTreeContentView(void);
 
     ~nsTreeContentView(void);
 
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsTreeContentView,
--- a/layout/xul/base/src/tree/src/nsTreeImageListener.h
+++ b/layout/xul/base/src/tree/src/nsTreeImageListener.h
@@ -6,19 +6,20 @@
 #ifndef nsTreeImageListener_h__
 #define nsTreeImageListener_h__
 
 #include "nsString.h"
 #include "nsCOMPtr.h"
 #include "nsITreeColumns.h"
 #include "nsStubImageDecoderObserver.h"
 #include "nsTreeBodyFrame.h"
+#include "mozilla/Attributes.h"
 
 // This class handles image load observation.
-class nsTreeImageListener : public nsStubImageDecoderObserver
+class nsTreeImageListener MOZ_FINAL : public nsStubImageDecoderObserver
 {
 public:
   nsTreeImageListener(nsTreeBodyFrame *aTreeFrame);
   ~nsTreeImageListener();
 
   NS_DECL_ISUPPORTS
   // imgIDecoderObserver (override nsStubImageDecoderObserver)
   NS_IMETHOD OnStartContainer(imgIRequest *aRequest, imgIContainer *aImage);