no bug - mark several classes final to avoid warnings about deleting objects of polymorphic type
authorTrevor Saunders <trev.saunders@gmail.com>
Fri, 11 Jan 2013 04:43:29 -0500
changeset 128541 b91053186723750677a0e07e9b4d756075aa0f06
parent 128540 c911625fe20b86ad81317867ce6b2a65f2d99861
child 128542 46c4522fee6bcbe5b769a5ad39141fcdf8f817bb
push idunknown
push userunknown
push dateunknown
milestone21.0a1
no bug - mark several classes final to avoid warnings about deleting objects of polymorphic type
dom/plugins/ipc/COMMessageFilter.h
dom/system/windows/nsHapticFeedback.h
extensions/auth/nsAuthSSPI.h
gfx/2d/ScaledFontDWrite.h
gfx/layers/d3d10/ReadbackManagerD3D10.cpp
gfx/layers/d3d10/ReadbackManagerD3D10.h
gfx/layers/d3d9/DeviceManagerD3D9.h
gfx/thebes/gfxDWriteCommon.h
gfx/thebes/gfxDWriteFontList.h
hal/windows/WindowsSensor.cpp
intl/locale/src/windows/nsCollationWin.h
xpcom/tests/windows/TestCOM.cpp
--- a/dom/plugins/ipc/COMMessageFilter.h
+++ b/dom/plugins/ipc/COMMessageFilter.h
@@ -9,17 +9,17 @@
 #include "nsISupportsImpl.h"
 #include "nsAutoPtr.h"
 
 namespace mozilla {
 namespace plugins {
 
 class PluginModuleChild;
 
-class COMMessageFilter : public IMessageFilter
+class COMMessageFilter MOZ_FINAL : public IMessageFilter
 {
 public:
   static void Initialize(PluginModuleChild* plugin);
 
   COMMessageFilter(PluginModuleChild* plugin)
     : mPlugin(plugin)
   { }
 
--- a/dom/system/windows/nsHapticFeedback.h
+++ b/dom/system/windows/nsHapticFeedback.h
@@ -1,13 +1,13 @@
 /* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
  * 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 "nsIHapticFeedback.h"
 
-class nsHapticFeedback : public nsIHapticFeedback
+class nsHapticFeedback MOZ_FINAL : public nsIHapticFeedback
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIHAPTICFEEDBACK
 };
--- a/extensions/auth/nsAuthSSPI.h
+++ b/extensions/auth/nsAuthSSPI.h
@@ -21,17 +21,17 @@
 // as specified by Microsoft in draft-brezak-spnego-http-04.txt
 
 // It can also be configured to talk raw NTLM.  This implementation of NTLM has
 // the advantage of being able to access the user's logon credentials.  This
 // implementation of NTLM should only be used for single-signon.  It should be
 // avoided when authenticating over the internet since it may use a lower-grade
 // version of password hashing depending on the version of Windows being used.
 
-class nsAuthSSPI : public nsIAuthModule
+class nsAuthSSPI MOZ_FINAL : public nsIAuthModule
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIAUTHMODULE
 
     nsAuthSSPI(pType package = PACKAGE_TYPE_NEGOTIATE);
 
 private:
--- a/gfx/2d/ScaledFontDWrite.h
+++ b/gfx/2d/ScaledFontDWrite.h
@@ -9,17 +9,17 @@
 #include <dwrite.h>
 #include "ScaledFontBase.h"
 
 struct ID2D1GeometrySink;
 
 namespace mozilla {
 namespace gfx {
 
-class ScaledFontDWrite : public ScaledFontBase
+class ScaledFontDWrite MOZ_FINAL : public ScaledFontBase
 {
 public:
   ScaledFontDWrite(IDWriteFontFace *aFont, Float aSize)
     : mFontFace(aFont)
     , ScaledFontBase(aSize)
   {}
   ScaledFontDWrite(uint8_t *aData, uint32_t aSize, uint32_t aIndex, Float aGlyphSize);
 
--- a/gfx/layers/d3d10/ReadbackManagerD3D10.cpp
+++ b/gfx/layers/d3d10/ReadbackManagerD3D10.cpp
@@ -31,17 +31,17 @@ struct ReadbackTask {
   // mLayer->GetBackgroundOffset() when the task is created.  We have
   // to save this in the ReadbackTask because it might change before
   // the update is delivered to the readback sink.
   nsIntPoint mBackgroundOffset;
 };
 
 // This class is created and dispatched from the Readback thread but it must be
 // destroyed by the main thread.
-class ReadbackResultWriter : public nsIRunnable
+class ReadbackResultWriter MOZ_FINAL : public nsIRunnable
 {
   NS_DECL_ISUPPORTS
 public:
   ReadbackResultWriter(ReadbackTask *aTask) : mTask(aTask) {}
 
   NS_IMETHODIMP Run()
   {
     ReadbackProcessor::Update *update = &mTask->mUpdate;
--- a/gfx/layers/d3d10/ReadbackManagerD3D10.h
+++ b/gfx/layers/d3d10/ReadbackManagerD3D10.h
@@ -15,17 +15,17 @@
 
 namespace mozilla {
 namespace layers {
 
 DWORD WINAPI StartTaskThread(void *aManager);
 
 struct ReadbackTask;
 
-class ReadbackManagerD3D10 : public IUnknown
+class ReadbackManagerD3D10 MOZ_FINAL : public IUnknown
 {
 public:
   ReadbackManagerD3D10();
   ~ReadbackManagerD3D10();
 
   /**
    * Tell the readback manager to post a readback task.
    *
@@ -67,9 +67,9 @@ private:
   nsTArray<nsAutoPtr<ReadbackTask>> mPendingReadbackTasks;
 
   ULONG mRefCnt;
 };
 
 }
 }
 
-#endif /* GFX_READBACKMANAGERD3D10_H */
\ No newline at end of file
+#endif /* GFX_READBACKMANAGERD3D10_H */
--- a/gfx/layers/d3d9/DeviceManagerD3D9.h
+++ b/gfx/layers/d3d9/DeviceManagerD3D9.h
@@ -74,17 +74,17 @@ private:
   HWND mWnd;
 };
 
 /**
  * Device manager, this class is used by the layer managers to share the D3D9
  * device and create swap chains for the individual windows the layer managers
  * belong to.
  */
-class THEBES_API DeviceManagerD3D9
+class THEBES_API DeviceManagerD3D9 MOZ_FINAL
 {
 public:
   DeviceManagerD3D9();
   NS_IMETHOD_(nsrefcnt) AddRef(void);
   NS_IMETHOD_(nsrefcnt) Release(void);
 protected:
   nsAutoRefCnt mRefCnt;
   NS_DECL_OWNINGTHREAD
--- a/gfx/thebes/gfxDWriteCommon.h
+++ b/gfx/thebes/gfxDWriteCommon.h
@@ -135,17 +135,17 @@ public:
         }
         return mInstance;
     }
 
 private:
     static IDWriteFontFileLoader* mInstance;
 }; 
 
-class gfxDWriteFontFileStream : public IDWriteFontFileStream
+class gfxDWriteFontFileStream MOZ_FINAL : public IDWriteFontFileStream
 {
 public:
     /**
      * Used by the FontFileLoader to create a new font stream,
      * this font stream is created from data in memory. The memory
      * passed may be released after object creation, it will be
      * copied internally.
      *
--- a/gfx/thebes/gfxDWriteFontList.h
+++ b/gfx/thebes/gfxDWriteFontList.h
@@ -178,17 +178,17 @@ protected:
     nsRefPtr<IDWriteFontFile> mFontFile;
     DWRITE_FONT_FACE_TYPE mFaceType;
 
     int8_t mIsCJK;
     bool mForceGDIClassic;
 };
 
 // custom text renderer used to determine the fallback font for a given char
-class FontFallbackRenderer : public IDWriteTextRenderer
+class FontFallbackRenderer MOZ_FINAL : public IDWriteTextRenderer
 {
 public:
     FontFallbackRenderer(IDWriteFactory *aFactory)
         : mRefCount(0)
     {
         HRESULT hr = S_OK;
 
         hr = aFactory->GetSystemFontCollection(getter_AddRefs(mSystemFonts));
--- a/hal/windows/WindowsSensor.cpp
+++ b/hal/windows/WindowsSensor.cpp
@@ -13,17 +13,17 @@
 
 using namespace mozilla::hal;
 
 namespace mozilla {
 namespace hal_impl {
 
 static nsRefPtr<ISensor> sAccelerometer;
 
-class SensorEvent : public ISensorEvents {
+class SensorEvent MOZ_FINAL : public ISensorEvents {
 public:
   SensorEvent() : mCount(0) {
   }
 
   // IUnknown interface
 
   STDMETHODIMP_(ULONG) AddRef() {
     return InterlockedIncrement(&mCount);
--- a/intl/locale/src/windows/nsCollationWin.h
+++ b/intl/locale/src/windows/nsCollationWin.h
@@ -9,17 +9,17 @@
 
 
 #include "nsICollation.h"
 #include "nsCollation.h"  // static library
 #include "plstr.h"
 
 
 
-class nsCollationWin : public nsICollation {
+class nsCollationWin MOZ_FINAL : public nsICollation {
 
 protected:
   nsCollation   *mCollation;  // XP collation class
   uint32_t      mLCID;        // Windows platform locale ID
 
 public: 
   nsCollationWin();
   ~nsCollationWin(); 
--- a/xpcom/tests/windows/TestCOM.cpp
+++ b/xpcom/tests/windows/TestCOM.cpp
@@ -25,17 +25,17 @@ public:
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsITestCom, NS_ITEST_COM_IID)
 
 /*
  * nsTestCom
  */
 
-class nsTestCom: public nsITestCom {
+class nsTestCom MOZ_FINAL : public nsITestCom {
   NS_DECL_ISUPPORTS
 
 public:
   nsTestCom() {
   }
 
   NS_IMETHOD Test() {
     printf("Accessed nsITestCom::Test() from COM\n");
@@ -64,17 +64,17 @@ nsrefcnt nsTestCom::Release()
   NS_LOG_RELEASE(this, mRefCnt, "nsTestCom");
   printf("nsTestCom: Releasing = %d\n", res);
   if (res == 0) {
     delete this;
   }
   return res;
 }
 
-class nsTestComFactory: public nsIFactory {
+class nsTestComFactory MOZ_FINAL : public nsIFactory {
   NS_DECL_ISUPPORTS
 public:
   nsTestComFactory() {
   }
   
   NS_IMETHOD CreateInstance(nsISupports *aOuter,
                             const nsIID &aIID,
                             void **aResult);