Bug 1028588 - Fix dangerous public destructors in the rest of dom/ - r=ehsan
authorBenoit Jacob <bjacob@mozilla.com>
Mon, 23 Jun 2014 15:56:07 -0400
changeset 212223 1679e9d569c36fa32df9977f13464f4325c9303a
parent 212222 dd07ffb3af8246f21c891f7903c1e44ad08b1e65
child 212224 967e19ae406cba0b46ad8cb57d38c765012c3c9b
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1028588
milestone33.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 1028588 - Fix dangerous public destructors in the rest of dom/ - r=ehsan
dom/alarm/AlarmHalService.h
dom/animation/AnimationTimeline.h
dom/archivereader/ArchiveEvent.h
dom/archivereader/ArchiveZipFile.cpp
dom/asmjscache/AsmJSCache.cpp
dom/audiochannel/tests/TestAudioChannelService.cpp
dom/base/BarProps.h
dom/base/CompositionStringSynthesizer.h
dom/base/Console.h
dom/base/Crypto.h
dom/base/DOMError.h
dom/base/DOMRequest.h
dom/base/MessageChannel.h
dom/base/MessagePortList.h
dom/base/Navigator.cpp
dom/base/Navigator.h
dom/base/PerformanceEntry.h
dom/base/SubtleCrypto.h
dom/base/URL.h
dom/base/URLSearchParams.h
dom/base/nsContentPermissionHelper.h
dom/base/nsDOMClassInfo.cpp
dom/base/nsDOMClassInfo.h
dom/base/nsDOMScriptObjectFactory.h
dom/base/nsDOMWindowList.h
dom/base/nsDOMWindowUtils.h
dom/base/nsGlobalWindow.cpp
dom/base/nsGlobalWindow.h
dom/base/nsGlobalWindowCommands.cpp
dom/base/nsHistory.h
dom/base/nsJSEnvironment.cpp
dom/base/nsJSEnvironment.h
dom/base/nsJSTimeoutHandler.cpp
dom/base/nsLocation.h
dom/base/nsMimeTypeArray.h
dom/base/nsPluginArray.h
dom/base/nsQueryContentEventResult.h
dom/base/nsScreen.h
dom/base/nsScriptNameSpaceManager.h
dom/base/nsStructuredCloneContainer.h
dom/base/nsWindowMemoryReporter.h
dom/base/nsWindowRoot.h
dom/camera/DOMCameraManager.cpp
dom/crypto/Key.h
dom/crypto/KeyAlgorithm.h
dom/crypto/KeyPair.h
dom/datastore/DataStoreCursor.h
dom/datastore/DataStoreDB.h
dom/datastore/DataStoreRevision.h
dom/datastore/DataStoreService.cpp
dom/devicestorage/DeviceStorage.h
dom/devicestorage/nsDeviceStorage.cpp
dom/events/DOMEventTargetHelper.h
dom/events/Event.h
dom/events/EventListenerManager.h
dom/events/EventListenerService.h
dom/events/EventStateManager.cpp
dom/events/EventStateManager.h
dom/events/IMEContentObserver.h
dom/events/JSEventHandler.h
dom/events/Touch.h
dom/events/TouchEvent.h
dom/filehandle/FileService.cpp
dom/filehandle/FileService.h
dom/filehandle/FileStreamWrappers.cpp
dom/filehandle/FileStreamWrappers.h
dom/filesystem/Directory.h
dom/indexedDB/CheckPermissionsHelper.h
dom/indexedDB/Client.h
dom/indexedDB/FileInfo.cpp
dom/indexedDB/IDBTransaction.h
dom/indexedDB/IndexedDatabaseManager.cpp
dom/indexedDB/OpenDatabaseHelper.cpp
dom/indexedDB/OpenDatabaseHelper.h
dom/indexedDB/TransactionThreadPool.cpp
dom/indexedDB/TransactionThreadPool.h
dom/ipc/ColorPickerParent.h
dom/ipc/ContentBridgeChild.h
dom/ipc/ContentBridgeParent.h
dom/ipc/ContentChild.cpp
dom/ipc/ContentParent.cpp
dom/ipc/ContentParent.h
dom/ipc/FilePickerParent.h
dom/ipc/PreallocatedProcessManager.cpp
dom/ipc/ProcessPriorityManager.cpp
dom/ipc/TabChild.h
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
dom/media/GetUserMediaRequest.h
dom/media/MediaManager.h
dom/mobilemessage/src/MmsMessage.h
dom/mobilemessage/src/MobileMessageService.h
dom/mobilemessage/src/MobileMessageThread.h
dom/mobilemessage/src/SmsFilter.h
dom/mobilemessage/src/SmsMessage.h
dom/mobilemessage/src/SmsSegmentInfo.h
dom/mobilemessage/src/ipc/SmsIPCService.h
dom/network/src/TCPServerSocketParent.h
dom/network/src/UDPSocketParent.h
dom/plugins/base/nsNPAPIPlugin.h
dom/plugins/base/nsNPAPIPluginInstance.h
dom/plugins/base/nsNPAPIPluginStreamListener.h
dom/plugins/base/nsPluginHost.h
dom/plugins/base/nsPluginInstanceOwner.cpp
dom/plugins/base/nsPluginInstanceOwner.h
dom/plugins/base/nsPluginPlayPreviewInfo.h
dom/plugins/base/nsPluginStreamListenerPeer.cpp
dom/plugins/base/nsPluginStreamListenerPeer.h
dom/plugins/base/nsPluginTags.h
dom/plugins/ipc/PluginModuleParent.cpp
dom/power/PowerManager.h
dom/power/WakeLock.h
dom/promise/Promise.cpp
dom/promise/PromiseCallback.h
dom/promise/PromiseNativeHandler.h
dom/quota/CheckQuotaHelper.cpp
dom/quota/CheckQuotaHelper.h
dom/smil/nsSMILAnimationController.h
dom/smil/nsSMILTimeValueSpec.h
dom/src/geolocation/nsGeoPosition.h
dom/src/geolocation/nsGeolocation.cpp
dom/src/json/nsJSON.h
dom/src/jsurl/nsJSProtocolHandler.h
dom/src/notification/DesktopNotification.cpp
dom/src/notification/DesktopNotification.h
dom/src/notification/Notification.cpp
dom/src/storage/DOMStorage.h
dom/src/storage/DOMStorageCache.cpp
dom/src/storage/DOMStorageCache.h
dom/src/storage/DOMStorageDBThread.cpp
dom/src/storage/DOMStorageIPC.h
dom/src/storage/DOMStorageObserver.h
dom/system/OSFileConstants.cpp
dom/system/nsDeviceSensors.h
dom/telephony/Telephony.cpp
dom/time/TimeManager.h
dom/time/TimeService.h
dom/workers/Location.h
dom/workers/Navigator.h
dom/workers/URL.h
dom/workers/WorkerPrivate.cpp
dom/xbl/XBLChildrenElement.h
dom/xbl/nsBindingManager.h
dom/xbl/nsXBLBinding.h
dom/xbl/nsXBLDocumentInfo.h
dom/xbl/nsXBLEventHandler.h
dom/xbl/nsXBLResourceLoader.h
dom/xbl/nsXBLService.cpp
dom/xbl/nsXBLWindowKeyHandler.cpp
dom/xbl/nsXBLWindowKeyHandler.h
dom/xslt/xpath/XPathEvaluator.cpp
dom/xslt/xpath/XPathEvaluator.h
dom/xslt/xpath/XPathResult.h
dom/xslt/xpath/nsXPathExpression.h
dom/xslt/xpath/nsXPathNSResolver.h
dom/xslt/xpath/txXPCOMExtensionFunction.cpp
dom/xslt/xpath/txXPathObjectAdaptor.h
dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
dom/xslt/xslt/txMozillaXMLOutput.cpp
dom/xslt/xslt/txMozillaXMLOutput.h
dom/xslt/xslt/txMozillaXSLTProcessor.h
--- a/dom/alarm/AlarmHalService.h
+++ b/dom/alarm/AlarmHalService.h
@@ -25,27 +25,28 @@ class AlarmHalService : public nsIAlarmH
                         public AlarmObserver,
                         public SystemTimezoneChangeObserver
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIALARMHALSERVICE
 
   void Init();
-  virtual ~AlarmHalService();
 
   static already_AddRefed<AlarmHalService> GetInstance();
 
   // Implementing hal::AlarmObserver
   void Notify(const void_t& aVoid);
 
   // Implementing hal::SystemTimezoneChangeObserver
   void Notify(const hal::SystemTimezoneChangeInformation& aSystemTimezoneChangeInfo);
 
 private:
+  virtual ~AlarmHalService();
+
   bool mAlarmEnabled;
   static StaticRefPtr<AlarmHalService> sSingleton;
 
   nsCOMPtr<nsIAlarmFiredCb> mAlarmFiredCb;
   nsCOMPtr<nsITimezoneChangedCb> mTimezoneChangedCb;
 };
 
 } // namespace alarm
--- a/dom/animation/AnimationTimeline.h
+++ b/dom/animation/AnimationTimeline.h
@@ -21,26 +21,26 @@ class AnimationTimeline MOZ_FINAL : publ
 {
 public:
   AnimationTimeline(nsIDocument* aDocument)
     : mDocument(aDocument)
   {
     SetIsDOMBinding();
   }
 
-  virtual ~AnimationTimeline() { }
-
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(AnimationTimeline)
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AnimationTimeline)
 
   nsISupports* GetParentObject() const { return mDocument; }
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   Nullable<double> GetCurrentTime() const;
 
 protected:
+  virtual ~AnimationTimeline() { }
+
   nsCOMPtr<nsIDocument> mDocument;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_AnimationTimeline_h
--- a/dom/archivereader/ArchiveEvent.h
+++ b/dom/archivereader/ArchiveEvent.h
@@ -22,29 +22,30 @@ BEGIN_ARCHIVEREADER_NAMESPACE
  * It must contain the implementation of the File() method.
  */
 class ArchiveItem : public nsISupports
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
   ArchiveItem();
-  virtual ~ArchiveItem();
 
   // Getter/Setter for the type
   nsCString GetType();
   void SetType(const nsCString& aType);
 
   // Getter for the filename
   virtual nsresult GetFilename(nsString& aFilename) = 0;
 
   // Generate a DOMFile
   virtual nsIDOMFile* File(ArchiveReader* aArchiveReader) = 0;
 
 protected:
+  virtual ~ArchiveItem();
+
   nsCString mType;
 };
 
 /**
  * This class must be extended by any archive format supported by ArchiveReader API
  * This class runs in a different thread and it calls the 'exec()' method.
  * The exec() must populate mFileList and mStatus then it must call RunShare();
  */
--- a/dom/archivereader/ArchiveZipFile.cpp
+++ b/dom/archivereader/ArchiveZipFile.cpp
@@ -38,27 +38,27 @@ public:
 
     // Reset the data:
     memset(&mData, 0, sizeof(mData));
 
     mData.parentSize = aParentSize;
     mData.inputStream = aInputStream;
   }
 
+  NS_DECL_THREADSAFE_ISUPPORTS
+  NS_DECL_NSIINPUTSTREAM
+  NS_DECL_NSISEEKABLESTREAM
+
+private:
   virtual ~ArchiveInputStream()
   {
     MOZ_COUNT_DTOR(ArchiveInputStream);
     Close();
   }
 
-  NS_DECL_THREADSAFE_ISUPPORTS
-  NS_DECL_NSIINPUTSTREAM
-  NS_DECL_NSISEEKABLESTREAM
-
-private:
   nsresult Init();
 
 private: // data
   ZipCentral mCentral;
   nsString mFilename;
   uint32_t mStart;
   uint32_t mLength;
 
--- a/dom/asmjscache/AsmJSCache.cpp
+++ b/dom/asmjscache/AsmJSCache.cpp
@@ -1718,16 +1718,18 @@ GetBuildId(JS::BuildIdCharVector* aBuild
     (*aBuildID)[i] = buildID[i];
   }
 
   return true;
 }
 
 class Client : public quota::Client
 {
+  ~Client() {}
+
 public:
   NS_IMETHOD_(MozExternalRefCountType)
   AddRef() MOZ_OVERRIDE;
 
   NS_IMETHOD_(MozExternalRefCountType)
   Release() MOZ_OVERRIDE;
 
   virtual Type
--- a/dom/audiochannel/tests/TestAudioChannelService.cpp
+++ b/dom/audiochannel/tests/TestAudioChannelService.cpp
@@ -23,35 +23,36 @@
     }                                       \
   PR_END_MACRO
 
 using namespace mozilla::dom;
 
 class Agent : public nsIAudioChannelAgentCallback,
               public nsSupportsWeakReference
 {
+protected:
+  virtual ~Agent()
+  {
+    if (mRegistered) {
+      StopPlaying();
+    }
+  }
+
 public:
   NS_DECL_ISUPPORTS
 
   Agent(AudioChannel aChannel)
   : mChannel(aChannel)
   , mWaitCallback(false)
   , mRegistered(false)
   , mCanPlay(AUDIO_CHANNEL_STATE_MUTED)
   {
     mAgent = do_CreateInstance("@mozilla.org/audiochannelagent;1");
   }
 
-  virtual ~Agent()
-  {
-    if (mRegistered) {
-      StopPlaying();
-    }
-  }
-
   nsresult Init(bool video=false)
   {
     nsresult rv = NS_OK;
     if (video) {
       rv = mAgent->InitWithVideo(nullptr, static_cast<int32_t>(mChannel),
                                  this, true);
     }
     else {
--- a/dom/base/BarProps.h
+++ b/dom/base/BarProps.h
@@ -28,30 +28,31 @@ class ErrorResult;
 namespace dom {
 
 // Script "BarProp" object
 class BarProp : public nsISupports,
                 public nsWrapperCache
 {
 public:
   explicit BarProp(nsGlobalWindow *aWindow);
-  virtual ~BarProp();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(BarProp)
 
   nsPIDOMWindow* GetParentObject() const;
 
   virtual JSObject*
   WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   virtual bool GetVisible(ErrorResult& aRv) = 0;
   virtual void SetVisible(bool aVisible, ErrorResult& aRv) = 0;
 
 protected:
+  virtual ~BarProp();
+
   bool GetVisibleByFlag(uint32_t aChromeFlag, ErrorResult& aRv);
   void SetVisibleByFlag(bool aVisible, uint32_t aChromeFlag, ErrorResult &aRv);
 
   already_AddRefed<nsIWebBrowserChrome> GetBrowserChrome();
 
   nsRefPtr<nsGlobalWindow> mDOMWindow;
 };
 
--- a/dom/base/CompositionStringSynthesizer.h
+++ b/dom/base/CompositionStringSynthesizer.h
@@ -18,22 +18,23 @@ class nsPIDOMWindow;
 namespace mozilla {
 namespace dom {
 
 class CompositionStringSynthesizer MOZ_FINAL :
   public nsICompositionStringSynthesizer
 {
 public:
   CompositionStringSynthesizer(nsPIDOMWindow* aWindow);
-  ~CompositionStringSynthesizer();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSICOMPOSITIONSTRINGSYNTHESIZER
 
 private:
+  ~CompositionStringSynthesizer();
+
   nsWeakPtr mWindow; // refers an instance of nsPIDOMWindow
   nsString mString;
   nsRefPtr<TextRangeArray> mClauses;
   TextRange mCaret;
 
   nsIWidget* GetWidget();
   void ClearInternal();
 };
--- a/dom/base/Console.h
+++ b/dom/base/Console.h
@@ -23,25 +23,26 @@ namespace dom {
 
 class ConsoleCallData;
 struct ConsoleStackEntry;
 
 class Console MOZ_FINAL : public nsITimerCallback
                         , public nsIObserver
                         , public nsWrapperCache
 {
+  ~Console();
+
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Console,
                                                          nsITimerCallback)
   NS_DECL_NSITIMERCALLBACK
   NS_DECL_NSIOBSERVER
 
   Console(nsPIDOMWindow* aWindow);
-  ~Console();
 
   // WebIDL methods
   nsISupports* GetParentObject() const
   {
     return mWindow;
   }
 
   virtual JSObject*
--- a/dom/base/Crypto.h
+++ b/dom/base/Crypto.h
@@ -27,19 +27,21 @@ namespace mozilla {
 
 class ErrorResult;
 
 namespace dom {
 
 class Crypto : public nsIDOMCrypto,
                public nsWrapperCache
 {
+protected:
+  virtual ~Crypto();
+
 public:
   Crypto();
-  virtual ~Crypto();
 
   NS_DECL_NSIDOMCRYPTO
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Crypto)
 
   void
   GetRandomValues(JSContext* aCx, const ArrayBufferView& aArray,
--- a/dom/base/DOMError.h
+++ b/dom/base/DOMError.h
@@ -27,16 +27,19 @@ class GlobalObject;
 
 class DOMError : public nsISupports,
                  public nsWrapperCache
 {
   nsCOMPtr<nsPIDOMWindow> mWindow;
   nsString mName;
   nsString mMessage;
 
+protected:
+  virtual ~DOMError();
+
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMError)
 
   NS_DECLARE_STATIC_IID_ACCESSOR(DOMERROR_IID)
 
   // aWindow can be null if this DOMError is not associated with a particular
   // window.
@@ -45,18 +48,16 @@ public:
 
   DOMError(nsPIDOMWindow* aWindow, nsresult aValue);
 
   DOMError(nsPIDOMWindow* aWindow, const nsAString& aName);
 
   DOMError(nsPIDOMWindow* aWindow, const nsAString& aName,
            const nsAString& aMessage);
 
-  virtual ~DOMError();
-
   nsPIDOMWindow* GetParentObject() const
   {
     return mWindow;
   }
 
   virtual JSObject*
   WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
--- a/dom/base/DOMRequest.h
+++ b/dom/base/DOMRequest.h
@@ -84,16 +84,18 @@ public:
 protected:
   void FireEvent(const nsAString& aType, bool aBubble, bool aCancelable);
 
   void RootResultVal();
 };
 
 class DOMRequestService MOZ_FINAL : public nsIDOMRequestService
 {
+  ~DOMRequestService() {}
+
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMREQUESTSERVICE
 
   // Returns an owning reference! No one should call this but the factory.
   static DOMRequestService* FactoryCreate()
   {
     DOMRequestService* res = new DOMRequestService;
--- a/dom/base/MessageChannel.h
+++ b/dom/base/MessageChannel.h
@@ -28,18 +28,16 @@ public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MessageChannel)
 
   static bool Enabled(JSContext* aCx, JSObject* aGlobal);
 
 public:
   MessageChannel(nsPIDOMWindow* aWindow);
 
-  ~MessageChannel();
-
   nsPIDOMWindow*
   GetParentObject() const
   {
     return mWindow;
   }
 
   virtual JSObject*
   WrapObject(JSContext* aCx) MOZ_OVERRIDE;
@@ -55,16 +53,18 @@ public:
 
   MessagePort*
   Port2() const
   {
     return mPort2;
   }
 
 private:
+  ~MessageChannel();
+
   nsCOMPtr<nsPIDOMWindow> mWindow;
 
   nsRefPtr<MessagePort> mPort1;
   nsRefPtr<MessagePort> mPort2;
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/MessagePortList.h
+++ b/dom/base/MessagePortList.h
@@ -16,16 +16,18 @@
 #include "nsTArray.h"
 
 namespace mozilla {
 namespace dom {
 
 class MessagePortList MOZ_FINAL : public nsISupports
                                 , public nsWrapperCache
 {
+  ~MessagePortList() {}
+
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MessagePortList)
 
 public:
   MessagePortList(nsISupports* aOwner, nsTArray<nsRefPtr<MessagePortBase>>& aPorts)
     : mOwner(aOwner)
     , mPorts(aPorts)
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -684,26 +684,26 @@ public:
 
     NS_NAMED_LITERAL_STRING(visibilitychange, "visibilitychange");
     aDocument->AddSystemEventListener(visibilitychange,
                                       this, /* listener */
                                       true, /* use capture */
                                       false /* wants untrusted */);
   }
 
-  virtual ~VibrateWindowListener()
-  {
-  }
-
   void RemoveListener();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMEVENTLISTENER
 
 private:
+  virtual ~VibrateWindowListener()
+  {
+  }
+
   nsWeakPtr mWindow;
   nsWeakPtr mDocument;
 };
 
 NS_IMPL_ISUPPORTS(VibrateWindowListener, nsIDOMEventListener)
 
 StaticRefPtr<VibrateWindowListener> gVibrateWindowListener;
 
@@ -1051,16 +1051,18 @@ Navigator::GetGeolocation(ErrorResult& a
     return nullptr;
   }
 
   return mGeolocation;
 }
 
 class BeaconStreamListener MOZ_FINAL : public nsIStreamListener
 {
+    ~BeaconStreamListener() {}
+
   public:
     BeaconStreamListener() {}
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSISTREAMLISTENER
     NS_DECL_NSIREQUESTOBSERVER
 };
 
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -109,17 +109,16 @@ class ServiceWorkerContainer;
 } // namespace workers
 
 class Navigator : public nsIDOMNavigator
                 , public nsIMozNavigatorNetwork
                 , public nsWrapperCache
 {
 public:
   Navigator(nsPIDOMWindow *aInnerWindow);
-  virtual ~Navigator();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Navigator,
                                                          nsIDOMNavigator)
   NS_DECL_NSIDOMNAVIGATOR
   NS_DECL_NSIMOZNAVIGATORNETWORK
 
   static void Init();
@@ -298,16 +297,18 @@ public:
   nsPIDOMWindow* GetParentObject() const
   {
     return GetWindow();
   }
 
   virtual JSObject* WrapObject(JSContext* cx) MOZ_OVERRIDE;
 
 private:
+  virtual ~Navigator();
+
   bool CheckPermission(const char* type);
   static bool CheckPermission(nsPIDOMWindow* aWindow, const char* aType);
   // GetWindowFromGlobal returns the inner window for this global, if
   // any, else null.
   static already_AddRefed<nsPIDOMWindow> GetWindowFromGlobal(JSObject* aGlobal);
 
   nsRefPtr<nsMimeTypeArray> mMimeTypes;
   nsRefPtr<nsPluginArray> mPlugins;
--- a/dom/base/PerformanceEntry.h
+++ b/dom/base/PerformanceEntry.h
@@ -11,19 +11,21 @@
 
 namespace mozilla {
 namespace dom {
 
 // http://www.w3.org/TR/performance-timeline/#performanceentry
 class PerformanceEntry : public nsISupports,
                          public nsWrapperCache
 {
+protected:
+  virtual ~PerformanceEntry();
+
 public:
   PerformanceEntry(nsPerformance* aPerformance);
-  virtual ~PerformanceEntry();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PerformanceEntry)
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   nsPerformance* GetParentObject() const
   {
--- a/dom/base/SubtleCrypto.h
+++ b/dom/base/SubtleCrypto.h
@@ -20,16 +20,18 @@ namespace dom {
 class Promise;
 
 typedef ArrayBufferViewOrArrayBuffer CryptoOperationData;
 typedef ArrayBufferViewOrArrayBuffer KeyData;
 
 class SubtleCrypto MOZ_FINAL : public nsISupports,
                                public nsWrapperCache
 {
+  ~SubtleCrypto() {}
+
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(SubtleCrypto)
 
 public:
   SubtleCrypto(nsPIDOMWindow* aWindow);
 
   nsPIDOMWindow* GetParentObject() const
--- a/dom/base/URL.h
+++ b/dom/base/URL.h
@@ -27,16 +27,18 @@ class GlobalObject;
 struct objectURLOptions;
 
 namespace workers {
 class URLProxy;
 }
 
 class URL MOZ_FINAL : public URLSearchParamsObserver
 {
+  ~URL() {}
+
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(URL)
 
   URL(nsIURI* aURI);
 
   // WebIDL methods
   JSObject*
--- a/dom/base/URLSearchParams.h
+++ b/dom/base/URLSearchParams.h
@@ -23,22 +23,23 @@ public:
   virtual ~URLSearchParamsObserver() {}
 
   virtual void URLSearchParamsUpdated() = 0;
 };
 
 class URLSearchParams MOZ_FINAL : public nsISupports,
                                   public nsWrapperCache
 {
+  ~URLSearchParams();
+
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(URLSearchParams)
 
   URLSearchParams();
-  ~URLSearchParams();
 
   // WebIDL methods
   nsISupports* GetParentObject() const
   {
     return nullptr;
   }
 
   virtual JSObject*
--- a/dom/base/nsContentPermissionHelper.h
+++ b/dom/base/nsContentPermissionHelper.h
@@ -33,19 +33,20 @@ class ContentPermissionType : public nsI
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSICONTENTPERMISSIONTYPE
 
   ContentPermissionType(const nsACString& aType,
                         const nsACString& aAccess,
                         const nsTArray<nsString>& aOptions);
+
+protected:
   virtual ~ContentPermissionType();
 
-protected:
   nsCString mType;
   nsCString mAccess;
   nsTArray<nsString> mOptions;
 };
 
 uint32_t ConvertPermissionRequestToArray(nsTArray<PermissionRequest>& aSrcArray,
                                          nsIMutableArray* aDesArray);
 
@@ -64,21 +65,22 @@ CreateContentPermissionRequestParent(con
 
 class nsContentPermissionRequestProxy : public nsIContentPermissionRequest
 {
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSICONTENTPERMISSIONREQUEST
 
   nsContentPermissionRequestProxy();
-  virtual ~nsContentPermissionRequestProxy();
 
   nsresult Init(const nsTArray<mozilla::dom::PermissionRequest>& requests,
                 mozilla::dom::ContentPermissionRequestParent* parent);
   void OnParentDestroyed();
 
  private:
+  virtual ~nsContentPermissionRequestProxy();
+
   // Non-owning pointer to the ContentPermissionRequestParent object which owns this proxy.
   mozilla::dom::ContentPermissionRequestParent* mParent;
   nsTArray<mozilla::dom::PermissionRequest> mPermissionRequests;
 };
 
 #endif // nsContentPermissionHelper_h
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -1960,16 +1960,18 @@ protected:
                    bool aIsConstructable,
                    nsPIDOMWindow* aOwner)
     : mClassName(aName),
       mConstructable(aIsConstructable),
       mWeakOwner(do_GetWeakReference(aOwner))
   {
   }
 
+  ~nsDOMConstructor() {}
+
 public:
 
   static nsresult Create(const char16_t* aName,
                          const nsDOMClassInfoData* aData,
                          const nsGlobalNameStruct* aNameStruct,
                          nsPIDOMWindow* aOwner,
                          nsDOMConstructor** aResult);
 
--- a/dom/base/nsDOMClassInfo.h
+++ b/dom/base/nsDOMClassInfo.h
@@ -67,19 +67,22 @@ struct nsExternalDOMClassInfoData : publ
 #define GET_CLEAN_CI_PTR(_ptr) (nsIClassInfo*)(uintptr_t(_ptr) & ~0x1)
 #define MARK_EXTERNAL(_ptr) (nsIClassInfo*)(uintptr_t(_ptr) | 0x1)
 #define IS_EXTERNAL(_ptr) (uintptr_t(_ptr) & 0x1)
 
 
 class nsDOMClassInfo : public nsXPCClassInfo
 {
   friend class nsHTMLDocumentSH;
+
+protected:
+  virtual ~nsDOMClassInfo();
+
 public:
   nsDOMClassInfo(nsDOMClassInfoData* aData);
-  virtual ~nsDOMClassInfo();
 
   NS_DECL_NSIXPCSCRIPTABLE
 
   NS_DECL_ISUPPORTS
 
   NS_DECL_NSICLASSINFO
 
   // Helper method that returns a *non* refcounted pointer to a
@@ -337,22 +340,22 @@ public:
 // when a "function interface" (nsIDOMEventListener) is called, this
 // class extracts 'this' fomr the first argument to the called
 // function (nsIDOMEventListener::HandleEvent(in nsIDOMEvent)), this
 // class will pass back nsIDOMEvent::currentTarget to be used as
 // 'this'.
 
 class nsEventListenerThisTranslator : public nsIXPCFunctionThisTranslator
 {
-public:
-  nsEventListenerThisTranslator()
+  virtual ~nsEventListenerThisTranslator()
   {
   }
 
-  virtual ~nsEventListenerThisTranslator()
+public:
+  nsEventListenerThisTranslator()
   {
   }
 
   // nsISupports
   NS_DECL_ISUPPORTS
 
   // nsIXPCFunctionThisTranslator
   NS_DECL_NSIXPCFUNCTIONTHISTRANSLATOR
--- a/dom/base/nsDOMScriptObjectFactory.h
+++ b/dom/base/nsDOMScriptObjectFactory.h
@@ -20,16 +20,18 @@
 
 #include "nsIDOMScriptObjectFactory.h"
 #include "nsIObserver.h"
 #include "mozilla/Attributes.h"
 
 class nsDOMScriptObjectFactory MOZ_FINAL : public nsIDOMScriptObjectFactory,
                                            public nsIObserver
 {
+  ~nsDOMScriptObjectFactory() {}
+
 public:
   nsDOMScriptObjectFactory();
 
   NS_DECL_ISUPPORTS
 
   // nsIObserver
   NS_DECL_NSIOBSERVER
 
--- a/dom/base/nsDOMWindowList.h
+++ b/dom/base/nsDOMWindowList.h
@@ -12,17 +12,16 @@
 
 class nsIDocShell;
 class nsIDOMWindow;
 
 class nsDOMWindowList : public nsIDOMWindowCollection
 {
 public:
   nsDOMWindowList(nsIDocShell *aDocShell);
-  virtual ~nsDOMWindowList();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMWINDOWCOLLECTION
 
   uint32_t GetLength();
   already_AddRefed<nsIDOMWindow> IndexedGetter(uint32_t aIndex, bool& aFound);
 
   //local methods
@@ -33,15 +32,17 @@ public:
     nsCOMPtr<nsIDocShellTreeItem> item;
     if (mDocShellNode) {
       mDocShellNode->GetChildAt(aIndex, getter_AddRefs(item));
     }
     return item.forget();
   }
 
 protected:
+  virtual ~nsDOMWindowList();
+
   // Note: this function may flush and cause mDocShellNode to become null.
   void EnsureFresh();
 
   nsIDocShell* mDocShellNode; //Weak Reference
 };
 
 #endif // nsDOMWindowList_h___
--- a/dom/base/nsDOMWindowUtils.h
+++ b/dom/base/nsDOMWindowUtils.h
@@ -41,31 +41,34 @@ public:
   void AppendElement(nsIDOMNode* aElement, bool aIsRoot)
   {
     mNodes.AppendElement(aElement);
     mNodeIsRoot.AppendElement(aIsRoot);
     mLength++;
   }
 
 private:
+  ~nsTranslationNodeList() {}
+
   nsTArray<nsCOMPtr<nsIDOMNode> > mNodes;
   nsTArray<bool> mNodeIsRoot;
   uint32_t mLength;
 };
 
 class nsDOMWindowUtils MOZ_FINAL : public nsIDOMWindowUtils,
                                    public nsSupportsWeakReference
 {
 public:
   nsDOMWindowUtils(nsGlobalWindow *aWindow);
-  ~nsDOMWindowUtils();
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMWINDOWUTILS
 
 protected:
+  ~nsDOMWindowUtils();
+
   nsWeakPtr mWindow;
 
   // If aOffset is non-null, it gets filled in with the offset of the root
   // frame of our window to the nearest widget in the app units of our window.
   // Add this offset to any event offset we're given to make it relative to the
   // widget returned by GetWidget.
   nsIWidget* GetWidget(nsPoint* aOffset = nullptr);
   nsIWidget* GetWidgetForElement(nsIDOMElement* aElement);
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -498,16 +498,18 @@ public:
   {
     if (mWindow && aIID.Equals(NS_GET_IID(nsIDOMWindow)) && mWindow) {
       return mWindow->QueryInterface(aIID, aResult);
     }
     return NS_NOINTERFACE;
   }
 
 private:
+  ~nsGlobalWindowObserver() {}
+
   nsGlobalWindow* mWindow;
 };
 
 NS_IMPL_ISUPPORTS(nsGlobalWindowObserver, nsIObserver, nsIInterfaceRequestor)
 
 nsTimeout::nsTimeout()
   : mCleared(false),
     mRunning(false),
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -141,20 +141,24 @@ NS_CreateJSTimeoutHandler(JSContext* aCx
                           const nsAString& aExpression,
                           mozilla::ErrorResult& aError);
 
 /*
  * Timeout struct that holds information about each script
  * timeout.  Holds a strong reference to an nsIScriptTimeoutHandler, which
  * abstracts the language specific cruft.
  */
-struct nsTimeout : mozilla::LinkedListElement<nsTimeout>
+struct nsTimeout MOZ_FINAL
+  : mozilla::LinkedListElement<nsTimeout>
 {
+private:
+  ~nsTimeout();
+
+public:
   nsTimeout();
-  ~nsTimeout();
 
   NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(nsTimeout)
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsTimeout)
 
   nsresult InitTimer(nsTimerCallbackFunc aFunc, uint32_t aDelay)
   {
     return mTimer->InitWithFuncCallback(aFunc, this, aDelay,
                                         nsITimer::TYPE_ONE_SHOT);
@@ -285,18 +289,19 @@ public:
   {
     if (aSubject->Subsumes(mOrigin)) {
       aError = nsContentUtils::XPConnect()->VariantToJS(aCx, aScope,
                                                         mValue, aResult);
     } else {
       aResult.setUndefined();
     }
   }
+private:
   virtual ~DialogValueHolder() {}
-private:
+
   nsCOMPtr<nsIPrincipal> mOrigin;
   nsCOMPtr<nsIVariant> mValue;
 };
 
 //*****************************************************************************
 // nsGlobalWindow: Global Object for Scripting
 //*****************************************************************************
 // Beware that all scriptable interfaces implemented by
--- a/dom/base/nsGlobalWindowCommands.cpp
+++ b/dom/base/nsGlobalWindowCommands.cpp
@@ -87,24 +87,23 @@ const char * const sSelectBottomString =
 #if 0
 #pragma mark -
 #endif
 
 // a base class for selection-related commands, for code sharing
 class nsSelectionCommandsBase : public nsIControllerCommand
 {
 public:
-  virtual ~nsSelectionCommandsBase() {}
-
   NS_DECL_ISUPPORTS
   NS_IMETHOD IsCommandEnabled(const char * aCommandName, nsISupports *aCommandContext, bool *_retval);
   NS_IMETHOD GetCommandStateParams(const char * aCommandName, nsICommandParams *aParams, nsISupports *aCommandContext);
   NS_IMETHOD DoCommandParams(const char * aCommandName, nsICommandParams *aParams, nsISupports *aCommandContext);
 
 protected:
+  virtual ~nsSelectionCommandsBase() {}
 
   static nsresult  GetPresShellFromWindow(nsPIDOMWindow *aWindow, nsIPresShell **aPresShell);
   static nsresult  GetSelectionControllerFromWindow(nsPIDOMWindow *aWindow, nsISelectionController **aSelCon);
 
   // no member variables, please, we're stateless!
 };
 
 // this class implements commands whose behavior depends on the 'browse with caret' setting
@@ -318,16 +317,18 @@ nsSelectCommand::DoCommand(const char *a
 }
 
 #if 0
 #pragma mark -
 #endif
 
 class nsClipboardCommand MOZ_FINAL : public nsIControllerCommand
 {
+  ~nsClipboardCommand() {}
+
 public:
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSICONTROLLERCOMMAND
 };
 
 NS_IMPL_ISUPPORTS(nsClipboardCommand, nsIControllerCommand)
 
@@ -382,22 +383,21 @@ nsClipboardCommand::DoCommandParams(cons
 
 #if 0
 #pragma mark -
 #endif
 
 class nsSelectionCommand : public nsIControllerCommand
 {
 public:
-  virtual ~nsSelectionCommand() {}
-
   NS_DECL_ISUPPORTS
   NS_DECL_NSICONTROLLERCOMMAND
 
 protected:
+  virtual ~nsSelectionCommand() {}
 
   virtual nsresult    IsClipboardCommandEnabled(const char * aCommandName, nsIContentViewerEdit* aEdit, bool *outCmdEnabled) = 0;
   virtual nsresult    DoClipboardCommand(const char *aCommandName, nsIContentViewerEdit* aEdit, nsICommandParams* aParams) = 0;
   
   static nsresult     GetContentViewerEditFromContext(nsISupports *aContext, nsIContentViewerEdit **aEditInterface);
   
   // no member variables, please, we're stateless!
 };
@@ -717,16 +717,18 @@ nsGoBackCommand::DoWebNavCommand(const c
       params        value type   possible values
       "addhook"     isupports    nsIClipboardDragDropHooks as nsISupports
       "removehook"  isupports    nsIClipboardDragDropHooks as nsISupports
 
 ----------------------------------------------------------------------------*/
 
 class nsClipboardDragDropHookCommand MOZ_FINAL : public nsIControllerCommand
 {
+  ~nsClipboardDragDropHookCommand() {}
+
 public:
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSICONTROLLERCOMMAND
 
 protected:                                                                                   
   // no member variables, please, we're stateless!
 };
--- a/dom/base/nsHistory.h
+++ b/dom/base/nsHistory.h
@@ -26,17 +26,16 @@ class nsHistory MOZ_FINAL : public nsIDO
                             public nsWrapperCache
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsHistory)
 
 public:
   nsHistory(nsPIDOMWindow* aInnerWindow);
-  virtual ~nsHistory();
 
   nsPIDOMWindow* GetParentObject() const;
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   uint32_t GetLength(mozilla::ErrorResult& aRv) const;
   void GetState(JSContext* aCx, JS::MutableHandle<JS::Value> aResult,
                 mozilla::ErrorResult& aRv) const;
   void Go(int32_t aDelta, mozilla::ErrorResult& aRv);
@@ -45,16 +44,18 @@ public:
   void PushState(JSContext* aCx, JS::Handle<JS::Value> aData,
                  const nsAString& aTitle, const nsAString& aUrl,
                  mozilla::ErrorResult& aRv);
   void ReplaceState(JSContext* aCx, JS::Handle<JS::Value> aData,
                     const nsAString& aTitle, const nsAString& aUrl,
                     mozilla::ErrorResult& aRv);
 
 protected:
+  virtual ~nsHistory();
+
   nsIDocShell* GetDocShell() const;
 
   void PushOrReplaceState(JSContext* aCx, JS::Handle<JS::Value> aData,
                           const nsAString& aTitle, const nsAString& aUrl,
                           mozilla::ErrorResult& aRv, bool aReplace);
 
   already_AddRefed<nsISHistory> GetSessionHistory() const;
 
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -255,16 +255,17 @@ NeedsGCAfterCC()
 {
   return sCCollectedWaitingForGC > 250 ||
     sLikelyShortLivingObjectsNeedingGC > 2500 ||
     sNeedsGCAfterCC;
 }
 
 class nsJSEnvironmentObserver MOZ_FINAL : public nsIObserver
 {
+  ~nsJSEnvironmentObserver() {}
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
 };
 
 NS_IMPL_ISUPPORTS(nsJSEnvironmentObserver, nsIObserver)
 
 NS_IMETHODIMP
@@ -3074,16 +3075,26 @@ mozilla::dom::ShutdownJSEnvironment()
     NS_IF_RELEASE(sRuntimeService);
     NS_IF_RELEASE(sSecurityManager);
   }
 
   sShuttingDown = true;
   sDidShutdown = true;
 }
 
+class nsJSArgArray;
+
+namespace mozilla {
+template<>
+struct HasDangerousPublicDestructor<nsJSArgArray>
+{
+  static const bool value = true;
+};
+}
+
 // A fast-array class for JS.  This class supports both nsIJSScriptArray and
 // nsIArray.  If it is JS itself providing and consuming this class, all work
 // can be done via nsIJSScriptArray, and avoid the conversion of elements
 // to/from nsISupports.
 // When consumed by non-JS (eg, another script language), conversion is done
 // on-the-fly.
 class nsJSArgArray MOZ_FINAL : public nsIJSArgArray {
 public:
--- a/dom/base/nsJSEnvironment.h
+++ b/dom/base/nsJSEnvironment.h
@@ -33,17 +33,16 @@ struct CycleCollectorResults;
 // The amount of time we wait between a request to GC (due to leaving
 // a page) and doing the actual GC.
 #define NS_GC_DELAY                 4000 // ms
 
 class nsJSContext : public nsIScriptContext
 {
 public:
   nsJSContext(bool aGCOnDestruction, nsIScriptGlobalObject* aGlobalObject);
-  virtual ~nsJSContext();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsJSContext,
                                                          nsIScriptContext)
 
   virtual nsIScriptGlobalObject *GetGlobalObject() MOZ_OVERRIDE;
   inline nsIScriptGlobalObject *GetGlobalObjectRef() { return mGlobalObjectRef; }
 
@@ -129,16 +128,18 @@ public:
   nsIScriptGlobalObject* GetCachedGlobalObject()
   {
     // Verify that we have a global so that this
     // does always return a null when GetGlobalObject() is null.
     JSObject* global = GetWindowProxy();
     return global ? mGlobalObjectRef.get() : nullptr;
   }
 protected:
+  virtual ~nsJSContext();
+
   // Helper to convert xpcom datatypes to jsvals.
   nsresult ConvertSupportsTojsvals(nsISupports *aArgs,
                                    JS::Handle<JSObject*> aScope,
                                    JS::AutoValueVector &aArgsOut);
 
   nsresult AddSupportsPrimitiveTojsvals(nsISupports *aArg, JS::Value *aArgv);
 
   // Report the pending exception on our mContext, if any.  This
--- a/dom/base/nsJSTimeoutHandler.cpp
+++ b/dom/base/nsJSTimeoutHandler.cpp
@@ -36,17 +36,16 @@ public:
   nsJSScriptTimeoutHandler();
   // This will call SwapElements on aArguments with an empty array.
   nsJSScriptTimeoutHandler(nsGlobalWindow *aWindow, Function& aFunction,
                            FallibleTArray<JS::Heap<JS::Value> >& aArguments,
                            ErrorResult& aError);
   nsJSScriptTimeoutHandler(JSContext* aCx, nsGlobalWindow *aWindow,
                            const nsAString& aExpression, bool* aAllowEval,
                            ErrorResult& aError);
-  ~nsJSScriptTimeoutHandler();
 
   virtual const char16_t *GetHandlerText();
   virtual Function* GetCallback()
   {
     return mFunction;
   }
   virtual void GetLocation(const char **aFileName, uint32_t *aLineNo)
   {
@@ -60,16 +59,18 @@ public:
   }
 
   nsresult Init(nsGlobalWindow *aWindow, bool *aIsInterval,
                 int32_t *aInterval, bool* aAllowEval);
 
   void ReleaseJSObjects();
 
 private:
+  ~nsJSScriptTimeoutHandler();
+
   // filename, line number and JS language version string of the
   // caller of setTimeout()
   nsCString mFileName;
   uint32_t mLineNo;
   nsTArray<JS::Heap<JS::Value> > mArgs;
 
   // The expression to evaluate or function to call. If mFunction is non-null
   // it should be used, else use mExpr.
--- a/dom/base/nsLocation.h
+++ b/dom/base/nsLocation.h
@@ -22,28 +22,29 @@ class nsIDocShellLoadInfo;
 // nsLocation: Script "location" object
 //*****************************************************************************
 
 class nsLocation : public nsIDOMLocation
                  , public nsWrapperCache
 {
 public:
   nsLocation(nsIDocShell *aDocShell);
-  virtual ~nsLocation();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsLocation)
 
   void SetDocShell(nsIDocShell *aDocShell);
   nsIDocShell *GetDocShell();
 
   // nsIDOMLocation
   NS_DECL_NSIDOMLOCATION
 
 protected:
+  virtual ~nsLocation();
+
   // In the case of jar: uris, we sometimes want the place the jar was
   // fetched from as the URI instead of the jar: uri itself.  Pass in
   // true for aGetInnermostURI when that's the case.
   nsresult GetURI(nsIURI** aURL, bool aGetInnermostURI = false);
   nsresult GetWritableURI(nsIURI** aURL);
   nsresult SetURI(nsIURI* aURL, bool aReplace = false);
   nsresult SetHrefWithBase(const nsAString& aHref, nsIURI* aBase,
                            bool aReplace);
--- a/dom/base/nsMimeTypeArray.h
+++ b/dom/base/nsMimeTypeArray.h
@@ -16,17 +16,16 @@
 class nsMimeType;
 class nsPluginElement;
 
 class nsMimeTypeArray MOZ_FINAL : public nsISupports,
                                   public nsWrapperCache
 {
 public:
   nsMimeTypeArray(nsPIDOMWindow* aWindow);
-  virtual ~nsMimeTypeArray();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsMimeTypeArray)
 
   nsPIDOMWindow* GetParentObject() const;
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   void Refresh();
@@ -36,16 +35,18 @@ public:
   nsMimeType* NamedItem(const nsAString& name);
   nsMimeType* IndexedGetter(uint32_t index, bool &found);
   nsMimeType* NamedGetter(const nsAString& name, bool &found);
   bool NameIsEnumerable(const nsAString& name);
   uint32_t Length();
   void GetSupportedNames(unsigned, nsTArray< nsString >& retval);
 
 protected:
+  virtual ~nsMimeTypeArray();
+
   void EnsurePluginMimeTypes();
   void Clear();
 
   nsCOMPtr<nsPIDOMWindow> mWindow;
 
   // mMimeTypes contains MIME types handled by non-hidden plugins, those
   // popular plugins that must be exposed in navigator.plugins enumeration to
   // avoid breaking web content. Likewise, mMimeTypes are exposed in
@@ -62,33 +63,33 @@ class nsMimeType MOZ_FINAL : public nsWr
 {
 public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsMimeType)
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(nsMimeType)
 
   nsMimeType(nsPIDOMWindow* aWindow, nsPluginElement* aPluginElement,
              uint32_t aPluginTagMimeIndex, const nsAString& aMimeType);
   nsMimeType(nsPIDOMWindow* aWindow, const nsAString& aMimeType);
-  virtual ~nsMimeType();
-
   nsPIDOMWindow* GetParentObject() const;
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   const nsString& Type() const
   {
     return mType;
   }
 
   // MimeType WebIDL methods
   void GetDescription(nsString& retval) const;
   nsPluginElement *GetEnabledPlugin() const;
   void GetSuffixes(nsString& retval) const;
   void GetType(nsString& retval) const;
 
 protected:
+  virtual ~nsMimeType();
+
   nsCOMPtr<nsPIDOMWindow> mWindow;
 
   // Strong reference to the active plugin, if any. Note that this
   // creates an explicit reference cycle through the plugin element's
   // mimetype array. We rely on the cycle collector to break this
   // cycle.
   nsRefPtr<nsPluginElement> mPluginElement;
   uint32_t mPluginTagMimeIndex;
--- a/dom/base/nsPluginArray.h
+++ b/dom/base/nsPluginArray.h
@@ -25,18 +25,16 @@ public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsPluginArray,
                                                          nsIObserver)
 
   // nsIObserver
   NS_DECL_NSIOBSERVER
 
   nsPluginArray(nsPIDOMWindow* aWindow);
-  virtual ~nsPluginArray();
-
   nsPIDOMWindow* GetParentObject() const;
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   // nsPluginArray registers itself as an observer with a weak reference.
   // This can't be done in the constructor, because at that point its
   // refcount is 0 (and it gets destroyed upon registration). So, Init()
   // must be called after construction.
   void Init();
@@ -52,16 +50,18 @@ public:
   void Refresh(bool aReloadDocuments);
   nsPluginElement* IndexedGetter(uint32_t aIndex, bool &aFound);
   nsPluginElement* NamedGetter(const nsAString& aName, bool &aFound);
   bool NameIsEnumerable(const nsAString& aName);
   uint32_t Length();
   void GetSupportedNames(unsigned, nsTArray<nsString>& aRetval);
 
 private:
+  virtual ~nsPluginArray();
+
   bool AllowPlugins() const;
   void EnsurePlugins();
 
   nsCOMPtr<nsPIDOMWindow> mWindow;
 
   // Many sites check whether a particular plugin is installed by enumerating
   // all navigator.plugins, checking each plugin's name. These sites should
   // just check navigator.plugins["Popular Plugin Name"] instead. mPlugins
@@ -104,16 +104,18 @@ public:
   nsMimeType* NamedGetter(const nsAString& name, bool &found);
   bool NameIsEnumerable(const nsAString& aName);
   uint32_t Length();
   void GetSupportedNames(unsigned, nsTArray<nsString>& retval);
 
   nsTArray<nsRefPtr<nsMimeType> >& MimeTypes();
 
 protected:
+  ~nsPluginElement() {}
+
   void EnsurePluginMimeTypes();
 
   nsCOMPtr<nsPIDOMWindow> mWindow;
   nsRefPtr<nsPluginTag> mPluginTag;
   nsTArray<nsRefPtr<nsMimeType> > mMimeTypes;
 };
 
 #endif /* nsPluginArray_h___ */
--- a/dom/base/nsQueryContentEventResult.h
+++ b/dom/base/nsQueryContentEventResult.h
@@ -13,24 +13,25 @@
 #include "mozilla/EventForwards.h"
 
 class nsIWidget;
 
 class nsQueryContentEventResult MOZ_FINAL : public nsIQueryContentEventResult
 {
 public:
   nsQueryContentEventResult();
-  ~nsQueryContentEventResult();
   NS_DECL_ISUPPORTS
   NS_DECL_NSIQUERYCONTENTEVENTRESULT
 
   void SetEventResult(nsIWidget* aWidget,
                       const mozilla::WidgetQueryContentEvent &aEvent);
 
 protected:
+  ~nsQueryContentEventResult();
+
   uint32_t mEventID;
 
   uint32_t mOffset;
   nsString mString;
   nsIntRect mRect;
 
   bool mSucceeded;
   bool mReversed;
--- a/dom/base/nsScreen.h
+++ b/dom/base/nsScreen.h
@@ -131,18 +131,19 @@ protected:
   nsresult GetRect(nsRect& aRect);
   nsresult GetAvailRect(nsRect& aRect);
 
   mozilla::dom::ScreenOrientation mOrientation;
 
 private:
   class FullScreenEventListener MOZ_FINAL : public nsIDOMEventListener
   {
+    ~FullScreenEventListener() {}
   public:
-    FullScreenEventListener() {};
+    FullScreenEventListener() {}
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIDOMEVENTLISTENER
   };
 
   nsScreen(nsPIDOMWindow* aWindow);
   virtual ~nsScreen();
 
--- a/dom/base/nsScriptNameSpaceManager.h
+++ b/dom/base/nsScriptNameSpaceManager.h
@@ -90,17 +90,16 @@ class nsScriptNameSpaceManager : public 
                                  public nsIMemoryReporter
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
   NS_DECL_NSIMEMORYREPORTER
 
   nsScriptNameSpaceManager();
-  virtual ~nsScriptNameSpaceManager();
 
   nsresult Init();
 
   // Returns a nsGlobalNameStruct for aName, or null if one is not
   // found. The returned nsGlobalNameStruct is only guaranteed to be
   // valid until the next call to any of the methods in this class.
   // It also returns a pointer to the string buffer of the classname
   // in the nsGlobalNameStruct.
@@ -177,16 +176,18 @@ public:
   void EnumerateGlobalNames(NameEnumerator aEnumerator,
                             void* aClosure);
   void EnumerateNavigatorNames(NameEnumerator aEnumerator,
                                void* aClosure);
 
   size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
 
 private:
+  virtual ~nsScriptNameSpaceManager();
+
   // Adds a new entry to the hash and returns the nsGlobalNameStruct
   // that aKey will be mapped to. If mType in the returned
   // nsGlobalNameStruct is != eTypeNotInitialized, an entry for aKey
   // already existed.
   nsGlobalNameStruct *AddToHash(PLDHashTable *aTable, const nsAString *aKey,
                                 const char16_t **aClassName = nullptr);
   nsGlobalNameStruct *AddToHash(PLDHashTable *aTable, const char *aKey,
                                 const char16_t **aClassName = nullptr)
--- a/dom/base/nsStructuredCloneContainer.h
+++ b/dom/base/nsStructuredCloneContainer.h
@@ -20,22 +20,23 @@
   0x46f0,                                          \
   {0xb8, 0x5f, 0x13, 0xce, 0xd8, 0x89, 0xee, 0xec} \
 }
 
 class nsStructuredCloneContainer MOZ_FINAL : public nsIStructuredCloneContainer
 {
   public:
     nsStructuredCloneContainer();
-    ~nsStructuredCloneContainer();
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSISTRUCTUREDCLONECONTAINER
 
   private:
+    ~nsStructuredCloneContainer();
+
     uint64_t* mData;
 
     // This needs to be size_t rather than a PR-type so it matches the JS API.
     size_t mSize;
     uint32_t mVersion;
 };
 
 #endif
--- a/dom/base/nsWindowMemoryReporter.h
+++ b/dom/base/nsWindowMemoryReporter.h
@@ -145,33 +145,34 @@ class nsWindowMemoryReporter MOZ_FINAL :
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIMEMORYREPORTER
   NS_DECL_NSIOBSERVER
 
   static void Init();
 
-  ~nsWindowMemoryReporter();
-
 #ifdef DEBUG
   /**
    * Unlink all known ghost windows, to enable investigating what caused them
    * to become ghost windows in the first place.
    */
   static void UnlinkGhostWindows();
 #endif
 
 private:
+  ~nsWindowMemoryReporter();
+
   /**
    * nsGhostWindowReporter generates the "ghost-windows" report, which counts
    * the number of ghost windows present.
    */
   class GhostWindowsReporter MOZ_FINAL : public nsIMemoryReporter
   {
+    ~GhostWindowsReporter() {}
   public:
     NS_DECL_ISUPPORTS
 
     static int64_t DistinguishedAmount();
 
     NS_IMETHOD
     CollectReports(nsIHandleReportCallback* aHandleReport, nsISupports* aData,
                    bool aAnonymize)
--- a/dom/base/nsWindowRoot.h
+++ b/dom/base/nsWindowRoot.h
@@ -22,17 +22,16 @@ class EventChainPreVisitor;
 #include "nsPIWindowRoot.h"
 #include "nsCycleCollectionParticipant.h"
 #include "nsAutoPtr.h"
 
 class nsWindowRoot : public nsPIWindowRoot
 {
 public:
   nsWindowRoot(nsPIDOMWindow* aWindow);
-  virtual ~nsWindowRoot();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_NSIDOMEVENTTARGET
 
   virtual mozilla::EventListenerManager*
     GetExistingListenerManager() const MOZ_OVERRIDE;
   virtual mozilla::EventListenerManager*
     GetOrCreateListenerManager() MOZ_OVERRIDE;
@@ -61,16 +60,18 @@ public:
   }
   virtual mozilla::dom::EventTarget* GetParentTarget() MOZ_OVERRIDE { return mParent; }
   virtual nsIDOMWindow* GetOwnerGlobal() MOZ_OVERRIDE;
 
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsWindowRoot,
                                                          nsIDOMEventTarget)
 
 protected:
+  virtual ~nsWindowRoot();
+
   // Members
   nsCOMPtr<nsPIDOMWindow> mWindow;
   // We own the manager, which owns event listeners attached to us.
   nsRefPtr<mozilla::EventListenerManager> mListenerManager; // [Strong]
   nsCOMPtr<nsIDOMNode> mPopupNode; // [OWNER]
 
   nsCOMPtr<mozilla::dom::EventTarget> mParent;
 };
--- a/dom/camera/DOMCameraManager.cpp
+++ b/dom/camera/DOMCameraManager.cpp
@@ -144,29 +144,29 @@ public:
     , mCameraManager(aManager)
     , mCameraId(aCameraId)
     , mInitialConfig(aInitialConfig)
     , mOnSuccess(aOnSuccess)
     , mOnError(aOnError)
   {
   }
 
-  virtual ~CameraPermissionRequest()
-  {
-  }
-
   bool Recv__delete__(const bool& aAllow,
                       const InfallibleTArray<PermissionChoice>& choices);
 
   void IPDLRelease()
   {
     Release();
   }
 
 protected:
+  virtual ~CameraPermissionRequest()
+  {
+  }
+
   nsresult DispatchCallback(uint32_t aPermission);
   void CallAllow();
   void CallCancel();
   nsCOMPtr<nsIPrincipal> mPrincipal;
   nsCOMPtr<nsPIDOMWindow> mWindow;
   nsRefPtr<nsDOMCameraManager> mCameraManager;
   uint32_t mCameraId;
   CameraConfiguration mInitialConfig;
--- a/dom/crypto/Key.h
+++ b/dom/crypto/Key.h
@@ -83,18 +83,16 @@ public:
     DERIVEKEY  = 0x00100000,
     DERIVEBITS = 0x00200000,
     WRAPKEY    = 0x00400000,
     UNWRAPKEY  = 0x00800000
   };
 
   Key(nsIGlobalObject* aWindow);
 
-  ~Key();
-
   nsIGlobalObject* GetParentObject() const
   {
     return mGlobal;
   }
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   // WebIDL methods
@@ -151,16 +149,18 @@ public:
                                   CryptoBuffer& aRetVal,
                                   const nsNSSShutDownPreventionLock& /*proofOfLock*/);
 
   // Structured clone methods use these to clone keys
   bool WriteStructuredClone(JSStructuredCloneWriter* aWriter) const;
   bool ReadStructuredClone(JSStructuredCloneReader* aReader);
 
 private:
+  ~Key();
+
   nsRefPtr<nsIGlobalObject> mGlobal;
   uint32_t mAttributes; // see above
   nsRefPtr<KeyAlgorithm> mAlgorithm;
 
   // Only one key handle should be set, according to the KeyType
   CryptoBuffer mSymKey;
   ScopedSECKEYPrivateKey mPrivateKey;
   ScopedSECKEYPublicKey mPublicKey;
--- a/dom/crypto/KeyAlgorithm.h
+++ b/dom/crypto/KeyAlgorithm.h
@@ -14,25 +14,36 @@
 #include "mozilla/dom/CryptoBuffer.h"
 #include "js/StructuredClone.h"
 #include "js/TypeDecls.h"
 
 namespace mozilla {
 namespace dom {
 
 class Key;
+class KeyAlgorithm;
 
 enum KeyAlgorithmStructuredCloneTags {
   SCTAG_KEYALG,
   SCTAG_AESKEYALG,
   SCTAG_HMACKEYALG,
   SCTAG_RSAKEYALG,
   SCTAG_RSAHASHEDKEYALG
 };
 
+}
+
+template<>
+struct HasDangerousPublicDestructor<dom::KeyAlgorithm>
+{
+  static const bool value = true;
+};
+
+namespace dom {
+
 class KeyAlgorithm : public nsISupports,
                      public nsWrapperCache
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(KeyAlgorithm)
 
 public:
--- a/dom/crypto/KeyPair.h
+++ b/dom/crypto/KeyPair.h
@@ -27,18 +27,16 @@ public:
   KeyPair(nsIGlobalObject* aGlobal)
     : mGlobal(aGlobal)
     , mPublicKey(new Key(aGlobal))
     , mPrivateKey(new Key(aGlobal))
   {
     SetIsDOMBinding();
   }
 
-  ~KeyPair() {}
-
   nsIGlobalObject* GetParentObject() const
   {
     return mGlobal;
   }
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   Key* PublicKey() const
@@ -47,16 +45,18 @@ public:
   }
 
   Key* PrivateKey() const
   {
     return mPrivateKey;
   }
 
 private:
+  ~KeyPair() {}
+
   nsRefPtr<nsIGlobalObject> mGlobal;
   nsRefPtr<Key> mPublicKey;
   nsRefPtr<Key> mPrivateKey;
 };
 
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/datastore/DataStoreCursor.h
+++ b/dom/datastore/DataStoreCursor.h
@@ -44,15 +44,16 @@ public:
   void Close(ErrorResult& aRv);
 
   // This internal function (ChromeOnly) is aimed to make the DataStoreCursor
   // keep a reference to the DataStoreCursorImpl which really implements the
   // API's logic in JS.
   void SetDataStoreCursorImpl(DataStoreCursorImpl& aCursor);
 
 private:
+  ~DataStoreCursor() {}
   nsRefPtr<DataStoreCursorImpl> mCursor;
 };
 
 } //namespace dom
 } //namespace mozilla
 
 #endif
\ No newline at end of file
--- a/dom/datastore/DataStoreDB.h
+++ b/dom/datastore/DataStoreDB.h
@@ -29,29 +29,30 @@ class IDBTransaction;
 class DataStoreDBCallback;
 
 class DataStoreDB MOZ_FINAL : public nsIDOMEventListener
 {
 public:
   NS_DECL_ISUPPORTS
 
   DataStoreDB(const nsAString& aManifestURL, const nsAString& aName);
-  ~DataStoreDB();
 
   nsresult Open(IDBTransactionMode aMode, const Sequence<nsString>& aDb,
                 DataStoreDBCallback* aCallback);
 
   nsresult Delete();
 
   indexedDB::IDBTransaction* Transaction() const;
 
   // nsIDOMEventListener
   NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent);
 
 private:
+  ~DataStoreDB();
+
   nsresult CreateFactoryIfNeeded();
 
   nsresult UpgradeSchema();
 
   nsresult DatabaseOpened();
 
   nsresult AddEventListeners();
 
--- a/dom/datastore/DataStoreRevision.h
+++ b/dom/datastore/DataStoreRevision.h
@@ -36,16 +36,17 @@ public:
                        uint32_t aObjectId,
                        RevisionType aRevisionType,
                        DataStoreRevisionCallback* aCallback);
 
   // nsIDOMEventListener
   NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent);
 
 private:
+  ~DataStoreRevision() {}
   nsRefPtr<DataStoreRevisionCallback> mCallback;
   nsRefPtr<indexedDB::IDBRequest> mRequest;
   nsString mRevisionID;
 };
 
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/datastore/DataStoreService.cpp
+++ b/dom/datastore/DataStoreService.cpp
@@ -617,16 +617,18 @@ public:
 
     // If the revision doesn't exist, let's create it.
     nsRefPtr<DataStoreRevision> mRevision = new DataStoreRevision();
     return mRevision->AddRevision(cx, store, 0, DataStoreRevision::RevisionVoid,
                                   callback);
   }
 
 private:
+  ~FirstRevisionIdCallback() {}
+
   nsRefPtr<IDBRequest> mRequest;
 
   nsRefPtr<IDBTransaction> mTxn;
   nsRefPtr<DataStoreRevision> mRevision;
 
   uint32_t mAppId;
   nsString mName;
   nsString mManifestURL;
--- a/dom/devicestorage/DeviceStorage.h
+++ b/dom/devicestorage/DeviceStorage.h
@@ -34,16 +34,23 @@ struct DeviceStorageEnumerationParameter
 class DOMCursor;
 class DOMRequest;
 class Promise;
 class DeviceStorageFileSystem;
 } // namespace dom
 namespace ipc {
 class FileDescriptor;
 }
+
+template<>
+struct HasDangerousPublicDestructor<DeviceStorageFile>
+{
+  static const bool value = true;
+};
+
 } // namespace mozilla
 
 class DeviceStorageFile MOZ_FINAL
   : public nsISupports {
 public:
   nsCOMPtr<nsIFile> mFile;
   nsString mStorageType;
   nsString mStorageName;
@@ -140,16 +147,18 @@ private:
 
   We create this object (via GetSingleton) in two places:
     * ContentParent::Init (for IPC)
     * nsDOMDeviceStorage::Init (for non-ipc)
 */
 class FileUpdateDispatcher MOZ_FINAL
   : public nsIObserver
 {
+  ~FileUpdateDispatcher() {}
+
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
   static FileUpdateDispatcher* GetSingleton();
  private:
   static mozilla::StaticRefPtr<FileUpdateDispatcher> sSingleton;
 };
--- a/dom/devicestorage/nsDeviceStorage.cpp
+++ b/dom/devicestorage/nsDeviceStorage.cpp
@@ -603,22 +603,23 @@ DeviceStorageFile::Init()
 }
 
 // The OverrideRootDir is needed to facilitate testing of the
 // device.storage.overrideRootDir preference. The preference is normally
 // only read once during initialization, but since the test environment has
 // no convenient way to restart, we use a pref watcher instead.
 class OverrideRootDir MOZ_FINAL : public nsIObserver
 {
+  ~OverrideRootDir();
+
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
   static OverrideRootDir* GetSingleton();
-  ~OverrideRootDir();
   void Init();
 private:
   static mozilla::StaticRefPtr<OverrideRootDir> sSingleton;
 };
 
 NS_IMPL_ISUPPORTS(OverrideRootDir, nsIObserver)
 
 mozilla::StaticRefPtr<OverrideRootDir>
@@ -1747,18 +1748,16 @@ public:
   NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(DeviceStorageCursorRequest,
                                            nsIContentPermissionRequest)
 
   NS_FORWARD_NSICONTENTPERMISSIONREQUEST(mCursor->);
 
   DeviceStorageCursorRequest(nsDOMDeviceStorageCursor* aCursor)
     : mCursor(aCursor) { }
 
-  ~DeviceStorageCursorRequest() {}
-
   bool Recv__delete__(const bool& allow,
                       const InfallibleTArray<PermissionChoice>& choices)
   {
     MOZ_ASSERT(choices.IsEmpty(), "DeviceStorageCursor doesn't support permission choice");
     if (allow) {
       Allow(JS::UndefinedHandleValue);
     }
     else {
@@ -1768,16 +1767,18 @@ public:
   }
 
   void IPDLRelease()
   {
     Release();
   }
 
 private:
+  ~DeviceStorageCursorRequest() {}
+
   nsRefPtr<nsDOMDeviceStorageCursor> mCursor;
 };
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DeviceStorageCursorRequest)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIContentPermissionRequest)
   NS_INTERFACE_MAP_ENTRY(nsIContentPermissionRequest)
 NS_INTERFACE_MAP_END
 
@@ -3141,16 +3142,18 @@ public:
   }
 
   void IPDLRelease()
   {
     Release();
   }
 
 private:
+  ~DeviceStorageRequest() {}
+
   int32_t mRequestType;
   nsCOMPtr<nsPIDOMWindow> mWindow;
   nsCOMPtr<nsIPrincipal> mPrincipal;
   nsRefPtr<DeviceStorageFile> mFile;
 
   nsRefPtr<DOMRequest> mRequest;
   nsCOMPtr<nsIDOMBlob> mBlob;
   nsRefPtr<nsDOMDeviceStorage> mDeviceStorage;
--- a/dom/events/DOMEventTargetHelper.h
+++ b/dom/events/DOMEventTargetHelper.h
@@ -50,17 +50,16 @@ public:
     , mOwnerWindow(nullptr)
     , mHasOrHasHadOwnerWindow(false)
   {
     BindToOwner(aOther);
     // All objects coming through here are WebIDL objects
     SetIsDOMBinding();
   }
 
-  virtual ~DOMEventTargetHelper();
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(DOMEventTargetHelper)
 
   NS_DECL_NSIDOMEVENTTARGET
 
   virtual EventListenerManager* GetExistingListenerManager() const MOZ_OVERRIDE;
   virtual EventListenerManager* GetOrCreateListenerManager() MOZ_OVERRIDE;
 
@@ -138,16 +137,18 @@ public:
   virtual void EventListenerRemoved(nsIAtom* aType) MOZ_OVERRIDE;
   virtual void EventListenerWasAdded(const nsAString& aType,
                                      ErrorResult& aRv,
                                      JSCompartment* aCompartment = nullptr) {}
   virtual void EventListenerWasRemoved(const nsAString& aType,
                                        ErrorResult& aRv,
                                        JSCompartment* aCompartment = nullptr) {}
 protected:
+  virtual ~DOMEventTargetHelper();
+
   nsresult WantsUntrusted(bool* aRetVal);
 
   nsRefPtr<EventListenerManager> mListenerManager;
   // Dispatch a trusted, non-cancellable and non-bubbling event to |this|.
   nsresult DispatchTrustedEvent(const nsAString& aEventName);
   // Make |event| trusted and dispatch |aEvent| to |this|.
   nsresult DispatchTrustedEvent(nsIDOMEvent* aEvent);
 
--- a/dom/events/Event.h
+++ b/dom/events/Event.h
@@ -40,16 +40,18 @@ class EventBase : public nsIDOMEvent
 class Event : public EventBase,
               public nsWrapperCache
 {
 public:
   Event(EventTarget* aOwner,
         nsPresContext* aPresContext,
         WidgetEvent* aEvent);
   Event(nsPIDOMWindow* aWindow);
+
+protected:
   virtual ~Event();
 
 private:
   void ConstructorInit(EventTarget* aOwner,
                        nsPresContext* aPresContext,
                        WidgetEvent* aEvent);
 
 public:
--- a/dom/events/EventListenerManager.h
+++ b/dom/events/EventListenerManager.h
@@ -146,16 +146,18 @@ inline EventListenerFlags AllEventsAtSys
 }
 
 /*
  * Event listener manager
  */
 
 class EventListenerManager MOZ_FINAL
 {
+  ~EventListenerManager();
+
 public:
   struct Listener
   {
     EventListenerHolder mListener;
     nsCOMPtr<nsIAtom> mTypeAtom; // for the main thread
     nsString mTypeString; // for non-main-threads
     uint16_t mEventType;
 
@@ -205,17 +207,16 @@ public:
       //       phase because capture phase event listeners should not be fired.
       //       But it breaks at least <xul:dialog>'s buttons. Bug 235441.
       return ((mFlags.mCapture && aEvent->mFlags.mInCapturePhase) ||
               (!mFlags.mCapture && aEvent->mFlags.mInBubblingPhase));
     }
   };
 
   EventListenerManager(dom::EventTarget* aTarget);
-  virtual ~EventListenerManager();
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(EventListenerManager)
 
   NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(EventListenerManager)
 
   void AddEventListener(const nsAString& aType,
                         nsIDOMEventListener* aListener,
                         bool aUseCapture,
--- a/dom/events/EventListenerService.h
+++ b/dom/events/EventListenerService.h
@@ -30,37 +30,38 @@ public:
     : mType(aType)
     , mListener(aListener)
     , mCapturing(aCapturing)
     , mAllowsUntrusted(aAllowsUntrusted)
     , mInSystemEventGroup(aInSystemEventGroup)
   {
   }
 
-  virtual ~EventListenerInfo() {}
-
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(EventListenerInfo)
   NS_DECL_NSIEVENTLISTENERINFO
 
 protected:
+  virtual ~EventListenerInfo() {}
+
   bool GetJSVal(JSContext* aCx,
                 Maybe<JSAutoCompartment>& aAc,
                 JS::MutableHandle<JS::Value> aJSVal);
 
   nsString mType;
   // nsReftPtr because that is what nsListenerStruct uses too.
   nsRefPtr<nsIDOMEventListener> mListener;
   bool mCapturing;
   bool mAllowsUntrusted;
   bool mInSystemEventGroup;
 };
 
 class EventListenerService MOZ_FINAL : public nsIEventListenerService
 {
+  ~EventListenerService() {}
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIEVENTLISTENERSERVICE
 };
 
 } // namespace mozilla
 
 #endif // mozilla_EventListenerService_h_
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -194,16 +194,17 @@ GetDocumentFromWindow(nsIDOMWindow *aWin
 
 class UITimerCallback MOZ_FINAL : public nsITimerCallback
 {
 public:
   UITimerCallback() : mPreviousCount(0) {}
   NS_DECL_ISUPPORTS
   NS_DECL_NSITIMERCALLBACK
 private:
+  ~UITimerCallback() {}
   uint32_t mPreviousCount;
 };
 
 NS_IMPL_ISUPPORTS(UITimerCallback, nsITimerCallback)
 
 // If aTimer is nullptr, this method always sends "user-interaction-inactive"
 // notification.
 NS_IMETHODIMP
--- a/dom/events/EventStateManager.h
+++ b/dom/events/EventStateManager.h
@@ -40,19 +40,20 @@ class WheelTransaction;
 
 namespace dom {
 class DataTransfer;
 class TabParent;
 } // namespace dom
 
 class OverOutElementsWrapper MOZ_FINAL : public nsISupports
 {
+  ~OverOutElementsWrapper();
+
 public:
   OverOutElementsWrapper();
-  ~OverOutElementsWrapper();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(OverOutElementsWrapper)
 
   nsWeakFrame mLastOverFrame;
 
   nsCOMPtr<nsIContent> mLastOverElement;
 
@@ -67,19 +68,20 @@ public:
 
 class EventStateManager : public nsSupportsWeakReference,
                           public nsIObserver
 {
   friend class mozilla::EnterLeaveDispatcher;
   friend class mozilla::ScrollbarsForWheel;
   friend class mozilla::WheelTransaction;
 
+  virtual ~EventStateManager();
+
 public:
   EventStateManager();
-  virtual ~EventStateManager();
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
   nsresult Init();
   nsresult Shutdown();
 
   /* The PreHandleEvent method is called before event dispatch to either
--- a/dom/events/IMEContentObserver.h
+++ b/dom/events/IMEContentObserver.h
@@ -68,16 +68,18 @@ public:
   {
     return mUpdatePreference.WantDuringDeactive();
   }
   nsIWidget* GetWidget() const { return mWidget; }
   nsresult GetSelectionAndRoot(nsISelection** aSelection,
                                nsIContent** aRoot) const;
 
 private:
+  ~IMEContentObserver() {}
+
   void NotifyContentAdded(nsINode* aContainer, int32_t aStart, int32_t aEnd);
   void ObserveEditableNode();
 
   nsCOMPtr<nsIWidget> mWidget;
   nsCOMPtr<nsISelection> mSelection;
   nsCOMPtr<nsIContent> mRootContent;
   nsCOMPtr<nsINode> mEditableNode;
   nsCOMPtr<nsIDocShell> mDocShell;
--- a/dom/events/JSEventHandler.h
+++ b/dom/events/JSEventHandler.h
@@ -176,18 +176,16 @@ private:
 class JSEventHandler : public nsIDOMEventListener
 {
 public:
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_JSEVENTHANDLER_IID)
 
   JSEventHandler(nsISupports* aTarget, nsIAtom* aType,
                  const TypedEventHandler& aTypedHandler);
 
-  virtual ~JSEventHandler();
-
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   // nsIDOMEventListener interface
   NS_DECL_NSIDOMEVENTLISTENER
 
   nsISupports* GetEventTarget() const
   {
     return mTarget;
@@ -250,16 +248,18 @@ public:
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 
   NS_DECL_CYCLE_COLLECTION_SKIPPABLE_CLASS(JSEventHandler)
 
   bool IsBlackForCC();
 
 protected:
+  virtual ~JSEventHandler();
+
   nsISupports* mTarget;
   nsCOMPtr<nsIAtom> mEventName;
   TypedEventHandler mTypedHandler;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(JSEventHandler, NS_JSEVENTHANDLER_IID)
 
 } // namespace mozilla
--- a/dom/events/Touch.h
+++ b/dom/events/Touch.h
@@ -40,18 +40,16 @@ public:
         float aRotationAngle,
         float aForce);
   Touch(int32_t aIdentifier,
         nsIntPoint aPoint,
         nsIntPoint aRadius,
         float aRotationAngle,
         float aForce);
 
-  ~Touch();
-
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Touch)
 
   void InitializePoints(nsPresContext* aPresContext, WidgetEvent* aEvent);
 
   void SetTarget(EventTarget* aTarget);
 
   bool Equals(Touch* aTouch);
@@ -81,15 +79,17 @@ public:
   int32_t mIdentifier;
   CSSIntPoint mPagePoint;
   CSSIntPoint mClientPoint;
   nsIntPoint mScreenPoint;
   nsIntPoint mRadius;
   float mRotationAngle;
   float mForce;
 protected:
+  ~Touch();
+
   bool mPointsInitialized;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_Touch_h_
--- a/dom/events/TouchEvent.h
+++ b/dom/events/TouchEvent.h
@@ -70,16 +70,18 @@ public:
     if (!aFound) {
       return nullptr;
     }
     return mPoints[aIndex];
   }
   Touch* IdentifiedTouch(int32_t aIdentifier) const;
 
 protected:
+  ~TouchList() {}
+
   nsCOMPtr<nsISupports> mParent;
   nsTArray<nsRefPtr<Touch> > mPoints;
 };
 
 class TouchEvent : public UIEvent
 {
 public:
   TouchEvent(EventTarget* aOwner,
--- a/dom/filehandle/FileService.cpp
+++ b/dom/filehandle/FileService.cpp
@@ -335,16 +335,20 @@ FileService::MaybeFireCallback(StoragesC
 }
 
 FileService::FileHandleQueue::FileHandleQueue(FileHandle* aFileHandle)
 : mFileHandle(aFileHandle)
 {
   MOZ_ASSERT(aFileHandle, "Null pointer!");
 }
 
+FileService::FileHandleQueue::~FileHandleQueue()
+{
+}
+
 NS_IMPL_ADDREF(FileService::FileHandleQueue)
 NS_IMPL_RELEASE(FileService::FileHandleQueue)
 
 nsresult
 FileService::FileHandleQueue::Enqueue(FileHelper* aFileHelper)
 {
   mQueue.AppendElement(aFileHelper);
 
--- a/dom/filehandle/FileService.h
+++ b/dom/filehandle/FileService.h
@@ -89,16 +89,18 @@ private:
 
     virtual void
     OnFileHelperComplete(FileHelper* aFileHelper) MOZ_OVERRIDE;
 
   private:
     inline
     FileHandleQueue(FileHandle* aFileHandle);
 
+    ~FileHandleQueue();
+
     nsresult
     ProcessQueue();
 
     ThreadSafeAutoRefCnt mRefCnt;
     NS_DECL_OWNINGTHREAD
     nsRefPtr<FileHandle> mFileHandle;
     nsTArray<nsRefPtr<FileHelper> > mQueue;
     nsRefPtr<FileHelper> mCurrentHelper;
--- a/dom/filehandle/FileStreamWrappers.cpp
+++ b/dom/filehandle/FileStreamWrappers.cpp
@@ -32,46 +32,52 @@ public:
                    uint64_t aProgressMax)
   : mFileHelper(aFileHelper),
     mProgress(aProgress),
     mProgressMax(aProgressMax)
   {
   }
 
 private:
+  ~ProgressRunnable() {}
+
   nsRefPtr<FileHelper> mFileHelper;
   uint64_t mProgress;
   uint64_t mProgressMax;
 };
 
 class CloseRunnable MOZ_FINAL : public nsIRunnable
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIRUNNABLE
 
   CloseRunnable(FileHelper* aFileHelper)
   : mFileHelper(aFileHelper)
   { }
 
 private:
+  ~CloseRunnable() {}
+
   nsRefPtr<FileHelper> mFileHelper;
 };
 
 class DestroyRunnable MOZ_FINAL : public nsIRunnable
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIRUNNABLE
 
   DestroyRunnable(FileHelper* aFileHelper)
   : mFileHelper(aFileHelper)
   { }
 
 private:
+  ~DestroyRunnable() {}
+
   nsRefPtr<FileHelper> mFileHelper;
 };
 
 } // anonymous namespace
 
 FileStreamWrapper::FileStreamWrapper(nsISupports* aFileStream,
                                      FileHelper* aFileHelper,
                                      uint64_t aOffset,
--- a/dom/filehandle/FileStreamWrappers.h
+++ b/dom/filehandle/FileStreamWrappers.h
@@ -23,25 +23,25 @@ public:
   NS_DECL_THREADSAFE_ISUPPORTS
 
   FileStreamWrapper(nsISupports* aFileStream,
                     FileHelper* aFileHelper,
                     uint64_t aOffset,
                     uint64_t aLimit,
                     uint32_t aFlags);
 
-  virtual ~FileStreamWrapper();
-
   enum {
     NOTIFY_PROGRESS = 1 << 0,
     NOTIFY_CLOSE = 1 << 1,
     NOTIFY_DESTROY = 1 << 2
   };
 
 protected:
+  virtual ~FileStreamWrapper();
+
   nsCOMPtr<nsISupports> mFileStream;
   nsRefPtr<FileHelper> mFileHelper;
   uint64_t mOffset;
   uint64_t mLimit;
   uint32_t mFlags;
   bool mFirstTime;
 };
 
--- a/dom/filesystem/Directory.h
+++ b/dom/filesystem/Directory.h
@@ -43,17 +43,16 @@ public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Directory)
 
 public:
   static already_AddRefed<Promise>
   GetRoot(FileSystemBase* aFileSystem);
 
   Directory(FileSystemBase* aFileSystem, const nsAString& aPath);
-  ~Directory();
 
   // ========= Begin WebIDL bindings. ===========
 
   nsPIDOMWindow*
   GetParentObject() const;
 
   virtual JSObject*
   WrapObject(JSContext* aCx) MOZ_OVERRIDE;
@@ -76,16 +75,18 @@ public:
   already_AddRefed<Promise>
   RemoveDeep(const StringOrFileOrDirectory& aPath);
 
   // =========== End WebIDL bindings.============
 
   FileSystemBase*
   GetFileSystem() const;
 private:
+  ~Directory();
+
   static bool
   IsValidRelativePath(const nsString& aPath);
 
   /*
    * Convert relative DOM path to the absolute real path.
    * @return true if succeed. false if the DOM path is invalid.
    */
   bool
--- a/dom/indexedDB/CheckPermissionsHelper.h
+++ b/dom/indexedDB/CheckPermissionsHelper.h
@@ -40,16 +40,18 @@ public:
     mPromptResult(0)
   {
     NS_ASSERTION(aHelper, "Null pointer!");
     NS_ASSERTION(aHelper->mPersistenceType == quota::PERSISTENCE_TYPE_PERSISTENT,
                  "Checking permission for non persistent databases?!");
   }
 
 private:
+  ~CheckPermissionsHelper() {}
+
   nsRefPtr<OpenDatabaseHelper> mHelper;
   nsCOMPtr<nsIDOMWindow> mWindow;
   bool mPromptAllowed;
   bool mHasPrompted;
   uint32_t mPromptResult;
 };
 
 END_INDEXEDDB_NAMESPACE
--- a/dom/indexedDB/Client.h
+++ b/dom/indexedDB/Client.h
@@ -72,16 +72,18 @@ public:
 
   virtual bool
   HasTransactionsForStorage(nsIOfflineStorage* aStorage) MOZ_OVERRIDE;
 
   virtual void
   ShutdownTransactionService() MOZ_OVERRIDE;
 
 private:
+  ~Client() {}
+
   nsresult
   GetDirectory(PersistenceType aPersistenceType, const nsACString& aOrigin,
                nsIFile** aDirectory);
 
   nsresult
   GetUsageForDirectoryInternal(nsIFile* aDirectory,
                                UsageInfo* aUsageInfo,
                                bool aDatabaseFiles);
--- a/dom/indexedDB/FileInfo.cpp
+++ b/dom/indexedDB/FileInfo.cpp
@@ -9,16 +9,18 @@
 #include "mozilla/dom/quota/QuotaManager.h"
 
 USING_INDEXEDDB_NAMESPACE
 
 namespace {
 
 class CleanupFileRunnable MOZ_FINAL : public nsIRunnable
 {
+  ~CleanupFileRunnable() {}
+
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIRUNNABLE
 
   CleanupFileRunnable(FileManager* aFileManager, int64_t aFileId);
 
 private:
   nsRefPtr<FileManager> mFileManager;
--- a/dom/indexedDB/IDBTransaction.h
+++ b/dom/indexedDB/IDBTransaction.h
@@ -324,32 +324,33 @@ public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIRUNNABLE
 
   CommitHelper(IDBTransaction* aTransaction,
                IDBTransactionListener* aListener,
                const nsTArray<nsRefPtr<IDBObjectStore> >& mUpdatedObjectStores);
   CommitHelper(IDBTransaction* aTransaction,
                nsresult aAbortCode);
-  ~CommitHelper();
 
   template<class T>
   bool AddDoomedObject(nsCOMPtr<T>& aCOMPtr)
   {
     if (aCOMPtr) {
       if (!mDoomedObjects.AppendElement(do_QueryInterface(aCOMPtr))) {
         NS_ERROR("Out of memory!");
         return false;
       }
       aCOMPtr = nullptr;
     }
     return true;
   }
 
 private:
+  ~CommitHelper();
+
   // Writes new autoincrement counts to database
   nsresult WriteAutoIncrementCounts();
 
   // Updates counts after a successful commit
   void CommitAutoIncrementCounts();
 
   // Reverts counts when a transaction is aborted
   void RevertAutoIncrementCounts();
@@ -361,27 +362,27 @@ private:
   nsAutoTArray<nsCOMPtr<nsISupports>, 10> mDoomedObjects;
   nsAutoTArray<nsRefPtr<IDBObjectStore>, 10> mAutoIncrementObjectStores;
 
   nsresult mAbortCode;
 };
 
 class UpdateRefcountFunction MOZ_FINAL : public mozIStorageFunction
 {
+  ~UpdateRefcountFunction()
+  { }
+
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_MOZISTORAGEFUNCTION
 
   UpdateRefcountFunction(FileManager* aFileManager)
   : mFileManager(aFileManager), mInSavepoint(false)
   { }
 
-  ~UpdateRefcountFunction()
-  { }
-
   void StartSavepoint()
   {
     MOZ_ASSERT(!mInSavepoint);
     MOZ_ASSERT(!mSavepointEntriesIndex.Count());
 
     mInSavepoint = true;
   }
 
--- a/dom/indexedDB/IndexedDatabaseManager.cpp
+++ b/dom/indexedDB/IndexedDatabaseManager.cpp
@@ -116,16 +116,18 @@ class AsyncDeleteFileRunnable MOZ_FINAL 
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIRUNNABLE
 
   AsyncDeleteFileRunnable(FileManager* aFileManager, int64_t aFileId);
 
 private:
+  ~AsyncDeleteFileRunnable() {}
+
   nsRefPtr<FileManager> mFileManager;
   int64_t mFileId;
 };
 
 class GetFileReferencesHelper MOZ_FINAL : public nsIRunnable
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
@@ -150,16 +152,18 @@ public:
 
   nsresult
   DispatchAndReturnFileReferences(int32_t* aMemRefCnt,
                                   int32_t* aDBRefCnt,
                                   int32_t* aSliceRefCnt,
                                   bool* aResult);
 
 private:
+  ~GetFileReferencesHelper() {}
+
   PersistenceType mPersistenceType;
   nsCString mOrigin;
   nsString mDatabaseName;
   int64_t mFileId;
 
   mozilla::Mutex& mMutex;
   mozilla::CondVar mCondVar;
   int32_t mMemRefCnt;
--- a/dom/indexedDB/OpenDatabaseHelper.cpp
+++ b/dom/indexedDB/OpenDatabaseHelper.cpp
@@ -876,16 +876,18 @@ UpgradeSchemaFrom7To8(mozIStorageConnect
   rv = aConnection->SetSchemaVersion(8);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
 }
 
 class CompressDataBlobsFunction MOZ_FINAL : public mozIStorageFunction
 {
+  ~CompressDataBlobsFunction() {}
+
 public:
   NS_DECL_ISUPPORTS
 
   NS_IMETHOD
   OnFunctionCall(mozIStorageValueArray* aArguments,
                  nsIVariant** aResult)
   {
     PROFILER_LABEL("CompressDataBlobsFunction", "OnFunctionCall",
@@ -1137,16 +1139,18 @@ UpgradeSchemaFrom10_0To11_0(mozIStorageC
   rv = aConnection->SetSchemaVersion(MakeSchemaVersion(11, 0));
   NS_ENSURE_SUCCESS(rv, rv);
 
   return NS_OK;
 }
 
 class EncodeKeysFunction MOZ_FINAL : public mozIStorageFunction
 {
+  ~EncodeKeysFunction() {}
+
 public:
   NS_DECL_ISUPPORTS
 
   NS_IMETHOD
   OnFunctionCall(mozIStorageValueArray* aArguments,
                  nsIVariant** aResult)
   {
     PROFILER_LABEL("EncodeKeysFunction", "OnFunctionCall",
--- a/dom/indexedDB/OpenDatabaseHelper.h
+++ b/dom/indexedDB/OpenDatabaseHelper.h
@@ -29,16 +29,18 @@ class CheckPermissionsHelper;
 
 class OpenDatabaseHelper : public HelperBase
 {
   friend class CheckPermissionsHelper;
 
   typedef mozilla::dom::quota::PersistenceType PersistenceType;
   typedef mozilla::dom::quota::StoragePrivilege StoragePrivilege;
 
+  ~OpenDatabaseHelper() {}
+
 public:
   OpenDatabaseHelper(IDBOpenDBRequest* aRequest,
                      const nsAString& aName,
                      const nsACString& aGroup,
                      const nsACString& aASCIIOrigin,
                      uint64_t aRequestedVersion,
                      PersistenceType aPersistenceType,
                      bool aForDeletion,
--- a/dom/indexedDB/TransactionThreadPool.cpp
+++ b/dom/indexedDB/TransactionThreadPool.cpp
@@ -53,16 +53,18 @@ class FinishTransactionRunnable MOZ_FINA
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIRUNNABLE
 
   inline FinishTransactionRunnable(IDBTransaction* aTransaction,
                                    nsCOMPtr<nsIRunnable>& aFinishRunnable);
 
 private:
+  ~FinishTransactionRunnable() {}
+
   IDBTransaction* mTransaction;
   nsCOMPtr<nsIRunnable> mFinishRunnable;
 };
 
 END_INDEXEDDB_NAMESPACE
 
 TransactionThreadPool::TransactionThreadPool()
 {
--- a/dom/indexedDB/TransactionThreadPool.h
+++ b/dom/indexedDB/TransactionThreadPool.h
@@ -66,16 +66,18 @@ protected:
 
     void Unblock();
 
     void Dispatch(nsIRunnable* aRunnable);
 
     void Finish(nsIRunnable* aFinishRunnable);
 
   private:
+    ~TransactionQueue() {}
+
     mozilla::Monitor mMonitor;
     IDBTransaction* mTransaction;
     nsAutoTArray<nsCOMPtr<nsIRunnable>, 10> mQueue;
     nsCOMPtr<nsIRunnable> mFinishRunnable;
     bool mShouldFinish;
   };
 
   friend class TransactionQueue;
--- a/dom/ipc/ColorPickerParent.h
+++ b/dom/ipc/ColorPickerParent.h
@@ -17,18 +17,16 @@ class ColorPickerParent : public PColorP
 {
  public:
   ColorPickerParent(const nsString& aTitle,
                     const nsString& aInitialColor)
   : mTitle(aTitle)
   , mInitialColor(aInitialColor)
   {}
 
-  virtual ~ColorPickerParent() {}
-
   virtual bool RecvOpen() MOZ_OVERRIDE;
   virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
 
   class ColorPickerShownCallback MOZ_FINAL
     : public nsIColorPickerShownCallback
   {
   public:
     ColorPickerShownCallback(ColorPickerParent* aColorPickerParnet)
@@ -36,20 +34,23 @@ class ColorPickerParent : public PColorP
     {}
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSICOLORPICKERSHOWNCALLBACK
 
     void Destroy();
 
   private:
+    ~ColorPickerShownCallback() {}
     ColorPickerParent* mColorPickerParent;
   };
 
  private:
+  virtual ~ColorPickerParent() {}
+
   bool CreateColorPicker();
 
   nsRefPtr<ColorPickerShownCallback> mCallback;
   nsCOMPtr<nsIColorPicker> mPicker;
 
   nsString mTitle;
   nsString mInitialColor;
 };
--- a/dom/ipc/ContentBridgeChild.h
+++ b/dom/ipc/ContentBridgeChild.h
@@ -16,18 +16,16 @@ namespace dom {
 class ContentBridgeChild MOZ_FINAL : public PContentBridgeChild
                                    , public nsIContentChild
 {
 public:
   ContentBridgeChild(Transport* aTransport);
 
   NS_DECL_ISUPPORTS
 
-  virtual ~ContentBridgeChild();
-
   static ContentBridgeChild*
   Create(Transport* aTransport, ProcessId aOtherProcess);
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
   void DeferredDestroy();
 
   virtual bool RecvAsyncMessage(const nsString& aMsg,
                                 const ClonedMessageData& aData,
@@ -43,16 +41,18 @@ public:
   virtual bool SendPBrowserConstructor(PBrowserChild* aActor,
                                        const IPCTabContext& aContext,
                                        const uint32_t& aChromeFlags,
                                        const uint64_t& aID,
                                        const bool& aIsForApp,
                                        const bool& aIsForBrowser) MOZ_OVERRIDE;
 
 protected:
+  virtual ~ContentBridgeChild();
+
   virtual PBrowserChild* AllocPBrowserChild(const IPCTabContext& aContext,
                                             const uint32_t& aChromeFlags,
                                             const uint64_t& aID,
                                             const bool& aIsForApp,
                                             const bool& aIsForBrowser) MOZ_OVERRIDE;
   virtual bool DeallocPBrowserChild(PBrowserChild*) MOZ_OVERRIDE;
   virtual bool RecvPBrowserConstructor(PBrowserChild* aCctor,
                                        const IPCTabContext& aContext,
--- a/dom/ipc/ContentBridgeParent.h
+++ b/dom/ipc/ContentBridgeParent.h
@@ -16,18 +16,16 @@ namespace dom {
 class ContentBridgeParent : public PContentBridgeParent
                           , public nsIContentParent
 {
 public:
   ContentBridgeParent(Transport* aTransport);
 
   NS_DECL_ISUPPORTS
 
-  virtual ~ContentBridgeParent();
-
   virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
   void DeferredDestroy();
 
   static ContentBridgeParent*
   Create(Transport* aTransport, ProcessId aOtherProcess);
 
   virtual PBlobParent*
   SendPBlobConstructor(PBlobParent* actor,
@@ -52,16 +50,18 @@ public:
     return mIsForApp;
   }
   virtual bool IsForBrowser() MOZ_OVERRIDE
   {
     return mIsForBrowser;
   }
 
 protected:
+  virtual ~ContentBridgeParent();
+
   void SetChildID(uint64_t aId)
   {
     mChildID = aId;
   }
   void SetIsForApp(bool aIsForApp)
   {
     mIsForApp = aIsForApp;
   }
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -187,19 +187,20 @@ namespace dom {
 class MemoryReportRequestChild : public PMemoryReportRequestChild,
                                  public nsIRunnable
 {
 public:
     NS_DECL_ISUPPORTS
 
     MemoryReportRequestChild(uint32_t aGeneration, bool aAnonymize,
                              const nsAString& aDMDDumpIdent);
-    virtual ~MemoryReportRequestChild();
     NS_IMETHOD Run();
 private:
+    virtual ~MemoryReportRequestChild();
+
     uint32_t mGeneration;
     bool     mAnonymize;
     nsString mDMDDumpIdent;
 };
 
 NS_IMPL_ISUPPORTS(MemoryReportRequestChild, nsIRunnable)
 
 MemoryReportRequestChild::MemoryReportRequestChild(
@@ -357,16 +358,18 @@ class ConsoleListener MOZ_FINAL : public
 public:
     ConsoleListener(ContentChild* aChild)
     : mChild(aChild) {}
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSICONSOLELISTENER
 
 private:
+    ~ConsoleListener() {}
+
     ContentChild* mChild;
     friend class ContentChild;
 };
 
 NS_IMPL_ISUPPORTS(ConsoleListener, nsIConsoleListener)
 
 NS_IMETHODIMP
 ConsoleListener::Observe(nsIConsoleMessage* aMessage)
@@ -413,16 +416,18 @@ ConsoleListener::Observe(nsIConsoleMessa
     nsresult rv = aMessage->GetMessageMoz(getter_Copies(msg));
     NS_ENSURE_SUCCESS(rv, rv);
     mChild->SendConsoleMessage(msg);
     return NS_OK;
 }
 
 class SystemMessageHandledObserver MOZ_FINAL : public nsIObserver
 {
+    ~SystemMessageHandledObserver() {}
+
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIOBSERVER
 
     void Init();
 };
 
 void SystemMessageHandledObserver::Init()
@@ -692,16 +697,17 @@ ContentChild::AllocPMemoryReportRequestC
         new MemoryReportRequestChild(aGeneration, aAnonymize, aDMDDumpIdent);
     actor->AddRef();
     return actor;
 }
 
 // This is just a wrapper for InfallibleTArray<MemoryReport> that implements
 // nsISupports, so it can be passed to nsIMemoryReporter::CollectReports.
 class MemoryReportsWrapper MOZ_FINAL : public nsISupports {
+    ~MemoryReportsWrapper() {}
 public:
     NS_DECL_ISUPPORTS
     MemoryReportsWrapper(InfallibleTArray<MemoryReport> *r) : mReports(r) { }
     InfallibleTArray<MemoryReport> *mReports;
 };
 NS_IMPL_ISUPPORTS0(MemoryReportsWrapper)
 
 class MemoryReportCallback MOZ_FINAL : public nsIMemoryReporterCallback
@@ -723,16 +729,18 @@ public:
             static_cast<MemoryReportsWrapper *>(aiWrappedReports);
 
         MemoryReport memreport(mProcess, nsCString(aPath), aKind, aUnits,
                                aAmount, nsCString(aDescription));
         wrappedReports->mReports->AppendElement(memreport);
         return NS_OK;
     }
 private:
+    ~MemoryReportCallback() {}
+
     const nsCString mProcess;
 };
 NS_IMPL_ISUPPORTS(
   MemoryReportCallback
 , nsIMemoryReporterCallback
 )
 
 bool
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -440,16 +440,17 @@ private:
 
     nsCOMPtr<nsICycleCollectorLogSink> mSink;
     nsCOMPtr<nsIDumpGCAndCCLogsCallback> mCallback;
 };
 
 // A memory reporter for ContentParent objects themselves.
 class ContentParentsMemoryReporter MOZ_FINAL : public nsIMemoryReporter
 {
+    ~ContentParentsMemoryReporter() {}
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIMEMORYREPORTER
 };
 
 NS_IMPL_ISUPPORTS(ContentParentsMemoryReporter, nsIMemoryReporter)
 
 NS_IMETHODIMP
@@ -1130,16 +1131,18 @@ public:
     NS_IMETHOD Notify(nsITimer* aTimer)
     {
         // Careful: ShutDown() may delete |this|.
         ShutDown();
         return NS_OK;
     }
 
 private:
+    ~SystemMessageHandledListener() {}
+
     static StaticAutoPtr<LinkedList<SystemMessageHandledListener> > sListeners;
 
     void ShutDown()
     {
         nsRefPtr<SystemMessageHandledListener> kungFuDeathGrip = this;
 
         ErrorResult rv;
         mWakeLock->Unlock(rv);
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -681,15 +681,15 @@ private:
 class ParentIdleListener : public nsIObserver {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
   ParentIdleListener(mozilla::dom::ContentParent* aParent, uint64_t aObserver)
     : mParent(aParent), mObserver(aObserver)
   {}
+private:
   virtual ~ParentIdleListener() {}
-private:
   nsRefPtr<mozilla::dom::ContentParent> mParent;
   uint64_t mObserver;
 };
 
 #endif
--- a/dom/ipc/FilePickerParent.h
+++ b/dom/ipc/FilePickerParent.h
@@ -41,24 +41,24 @@ class FilePickerParent : public PFilePic
   virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
 
   class FilePickerShownCallback : public nsIFilePickerShownCallback
   {
   public:
     FilePickerShownCallback(FilePickerParent* aFilePickerParent)
       : mFilePickerParent(aFilePickerParent)
     { }
-    virtual ~FilePickerShownCallback() {}
 
     NS_DECL_ISUPPORTS
     NS_DECL_NSIFILEPICKERSHOWNCALLBACK
 
     void Destroy();
 
   private:
+    virtual ~FilePickerShownCallback() {}
     FilePickerParent* mFilePickerParent;
   };
 
  private:
   bool CreateFilePicker();
 
   class FileSizeAndDateRunnable : public nsRunnable
   {
--- a/dom/ipc/PreallocatedProcessManager.cpp
+++ b/dom/ipc/PreallocatedProcessManager.cpp
@@ -75,16 +75,17 @@ private:
   // Nuwa process is ready for creating new process.
   bool mIsNuwaReady;
 #endif
 
 private:
   static mozilla::StaticRefPtr<PreallocatedProcessManagerImpl> sSingleton;
 
   PreallocatedProcessManagerImpl();
+  ~PreallocatedProcessManagerImpl() {}
   DISALLOW_EVIL_CONSTRUCTORS(PreallocatedProcessManagerImpl);
 
   void Init();
 
   void RereadPrefs();
   void Enable();
   void Disable();
 
--- a/dom/ipc/ProcessPriorityManager.cpp
+++ b/dom/ipc/ProcessPriorityManager.cpp
@@ -225,19 +225,19 @@ private:
  * main-process only.
  */
 class ParticularProcessPriorityManager MOZ_FINAL
   : public WakeLockObserver
   , public nsIObserver
   , public nsITimerCallback
   , public nsSupportsWeakReference
 {
+  ~ParticularProcessPriorityManager();
 public:
   ParticularProcessPriorityManager(ContentParent* aContentParent);
-  ~ParticularProcessPriorityManager();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
   NS_DECL_NSITIMERCALLBACK
 
   virtual void Notify(const WakeLockInformation& aInfo) MOZ_OVERRIDE;
   void Init();
 
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -143,16 +143,17 @@ public:
 
 class ContentListener MOZ_FINAL : public nsIDOMEventListener
 {
 public:
   ContentListener(TabChild* aTabChild) : mTabChild(aTabChild) {}
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMEVENTLISTENER
 protected:
+  ~ContentListener() {}
   TabChild* mTabChild;
 };
 
 // This is base clase which helps to share Viewport and touch related functionality
 // between b2g/android FF/embedlite clients implementation.
 // It make sense to place in this class all helper functions, and functionality which could be shared between
 // Cross-process/Cross-thread implmentations.
 class TabChildBase : public nsISupports,
@@ -179,16 +180,17 @@ public:
                                          const bool& aIsRoot,
                                          const mozilla::layers::ZoomConstraints& aConstraints) = 0;
 
     nsEventStatus DispatchSynthesizedMouseEvent(uint32_t aMsg, uint64_t aTime,
                                                 const LayoutDevicePoint& aRefPoint,
                                                 nsIWidget* aWidget);
 
 protected:
+    ~TabChildBase() {}
     CSSSize GetPageSize(nsCOMPtr<nsIDocument> aDocument, const CSSSize& aViewport);
 
     // Get the DOMWindowUtils for the top-level window in this tab.
     already_AddRefed<nsIDOMWindowUtils> GetDOMWindowUtils();
     // Get the Document for the top-level window in this tab.
     already_AddRefed<nsIDocument> GetDocument();
 
     // Wrapper for nsIDOMWindowUtils.setCSSViewport(). This updates some state
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -2227,16 +2227,18 @@ public:
   NS_IMETHOD SetPrivateBrowsing(bool) NO_IMPL
   NS_IMETHOD GetIsInBrowserElement(bool*) NO_IMPL
   NS_IMETHOD GetAppId(uint32_t*) NO_IMPL
   NS_IMETHOD GetUseRemoteTabs(bool*) NO_IMPL
   NS_IMETHOD SetRemoteTabs(bool) NO_IMPL
 #undef NO_IMPL
 
 protected:
+  ~FakeChannel() {}
+
   nsCOMPtr<nsIURI> mUri;
   uint64_t mCallbackId;
   nsCOMPtr<Element> mElement;
 };
 
 NS_IMPL_ISUPPORTS(FakeChannel, nsIChannel, nsIAuthPromptCallback,
                   nsIRequest, nsIInterfaceRequestor, nsILoadContext);
 
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -52,22 +52,23 @@ class TabParent : public PBrowserParent
                 , public nsIAuthPromptProvider
                 , public nsISecureBrowserUI
                 , public nsSupportsWeakReference
                 , public TabContext
 {
     typedef mozilla::dom::ClonedMessageData ClonedMessageData;
     typedef mozilla::layout::ScrollingBehavior ScrollingBehavior;
 
+    virtual ~TabParent();
+
 public:
     // nsITabParent
     NS_DECL_NSITABPARENT
 
     TabParent(nsIContentParent* aManager, const TabContext& aContext, uint32_t aChromeFlags);
-    virtual ~TabParent();
     Element* GetOwnerElement() const { return mFrameElement; }
     void SetOwnerElement(Element* aElement);
 
     /**
      * Get the mozapptype attribute from this TabParent's owner DOM element.
      */
     void GetAppType(nsAString& aOut);
 
--- a/dom/media/GetUserMediaRequest.h
+++ b/dom/media/GetUserMediaRequest.h
@@ -19,32 +19,33 @@ struct MediaStreamConstraints;
 
 class GetUserMediaRequest : public nsISupports, public nsWrapperCache
 {
 public:
   GetUserMediaRequest(nsPIDOMWindow* aInnerWindow,
                       const nsAString& aCallID,
                       const MediaStreamConstraints& aConstraints,
                       bool aIsSecure);
-  virtual ~GetUserMediaRequest() {};
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(GetUserMediaRequest)
 
   virtual JSObject* WrapObject(JSContext* cx)
     MOZ_OVERRIDE;
   nsISupports* GetParentObject();
 
   uint64_t WindowID();
   uint64_t InnerWindowID();
   bool IsSecure();
   void GetCallID(nsString& retval);
   void GetConstraints(MediaStreamConstraints &result);
 
 private:
+  virtual ~GetUserMediaRequest() {}
+
   uint64_t mInnerWindowID, mOuterWindowID;
   const nsString mCallID;
   nsAutoPtr<MediaStreamConstraints> mConstraints;
   bool mIsSecure;
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/media/MediaManager.h
+++ b/dom/media/MediaManager.h
@@ -439,18 +439,18 @@ class MediaDevice : public nsIMediaDevic
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIMEDIADEVICE
 
   static MediaDevice* Create(MediaEngineVideoSource* source);
   static MediaDevice* Create(MediaEngineAudioSource* source);
 
+protected:
   virtual ~MediaDevice() {}
-protected:
   MediaDevice(MediaEngineSource* aSource);
   nsString mName;
   nsString mID;
   bool mHasFacingMode;
   dom::VideoFacingModeEnum mFacingMode;
   nsRefPtr<MediaEngineSource> mSource;
 };
 
--- a/dom/mobilemessage/src/MmsMessage.h
+++ b/dom/mobilemessage/src/MmsMessage.h
@@ -77,16 +77,18 @@ public:
                          JSContext* aCx,
                          nsIDOMMozMmsMessage** aMessage);
 
   bool GetData(ContentParent* aParent,
                mobilemessage::MmsMessageData& aData);
 
 private:
 
+  ~MmsMessage() {}
+
   int32_t mId;
   uint64_t mThreadId;
   nsString mIccId;
   mobilemessage::DeliveryState mDelivery;
   nsTArray<MmsDeliveryInfo> mDeliveryInfo;
   nsString mSender;
   nsTArray<nsString> mReceivers;
   uint64_t mTimestamp;
--- a/dom/mobilemessage/src/MobileMessageService.h
+++ b/dom/mobilemessage/src/MobileMessageService.h
@@ -17,16 +17,18 @@ class MobileMessageService MOZ_FINAL : p
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIMOBILEMESSAGESERVICE
 
   static already_AddRefed<MobileMessageService> GetInstance();
 
 private:
+  ~MobileMessageService() {}
+
   static StaticRefPtr<MobileMessageService> sSingleton;
 
 };
 
 } // namespace mobilemessage
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/mobilemessage/src/MobileMessageThread.h
+++ b/dom/mobilemessage/src/MobileMessageThread.h
@@ -41,16 +41,18 @@ public:
                          uint64_t aUnreadCount,
                          const nsAString& aLastMessageType,
                          JSContext* aCx,
                          nsIDOMMozMobileMessageThread** aThread);
 
   const ThreadData& GetData() const { return mData; }
 
 private:
+  ~MobileMessageThread() {}
+
   // Don't try to use the default constructor.
   MobileMessageThread() MOZ_DELETE;
 
   ThreadData mData;
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/mobilemessage/src/SmsFilter.h
+++ b/dom/mobilemessage/src/SmsFilter.h
@@ -22,16 +22,18 @@ public:
   SmsFilter();
   SmsFilter(const mobilemessage::SmsFilterData& aData);
 
   const mobilemessage::SmsFilterData& GetData() const;
 
   static nsresult NewSmsFilter(nsISupports** aSmsFilter);
 
 private:
+  ~SmsFilter() {}
+
   mobilemessage::SmsFilterData mData;
 };
 
 inline const mobilemessage::SmsFilterData&
 SmsFilter::GetData() const {
   return mData;
 }
 
--- a/dom/mobilemessage/src/SmsMessage.h
+++ b/dom/mobilemessage/src/SmsMessage.h
@@ -50,16 +50,18 @@ public:
                          uint64_t aSentTimestamp,
                          uint64_t aDeliveryTimestamp,
                          bool aRead,
                          JSContext* aCx,
                          nsIDOMMozSmsMessage** aMessage);
   const mobilemessage::SmsMessageData& GetData() const;
 
 private:
+  ~SmsMessage() {}
+
   // Don't try to use the default constructor.
   SmsMessage();
 
   mobilemessage::SmsMessageData mData;
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/mobilemessage/src/SmsSegmentInfo.h
+++ b/dom/mobilemessage/src/SmsSegmentInfo.h
@@ -23,15 +23,17 @@ public:
                  int32_t aCharsPerSegment,
                  int32_t aCharsAvailableInLastSegment);
 
   SmsSegmentInfo(const mobilemessage::SmsSegmentInfoData& aData);
 
   const mobilemessage::SmsSegmentInfoData& GetData() const;
 
 private:
+  ~SmsSegmentInfo() {}
+
   mobilemessage::SmsSegmentInfoData mData;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_mobilemessage_SmsSegmentInfo_h
--- a/dom/mobilemessage/src/ipc/SmsIPCService.h
+++ b/dom/mobilemessage/src/ipc/SmsIPCService.h
@@ -28,16 +28,18 @@ public:
   NS_DECL_NSISMSSERVICE
   NS_DECL_NSIMMSSERVICE
   NS_DECL_NSIMOBILEMESSAGEDATABASESERVICE
   NS_DECL_NSIOBSERVER
 
   SmsIPCService();
 
 private:
+  ~SmsIPCService() {}
+
   uint32_t mMmsDefaultServiceId;
   uint32_t mSmsDefaultServiceId;
 };
 
 } // namespace mobilemessage
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/network/src/TCPServerSocketParent.h
+++ b/dom/network/src/TCPServerSocketParent.h
@@ -30,16 +30,18 @@ public:
 
   virtual bool RecvClose() MOZ_OVERRIDE;
   virtual bool RecvRequestDelete() MOZ_OVERRIDE;
 
   void AddIPDLReference();
   void ReleaseIPDLReference();
 
 private:
+  ~TCPServerSocketParent() {}
+
   virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
 
   PNeckoParent* mNeckoParent;
   nsCOMPtr<nsITCPSocketIntermediary> mIntermediary;
   nsCOMPtr<nsIDOMTCPServerSocket> mServerSocket;
   bool mIPCOpen;
 };
 
--- a/dom/network/src/UDPSocketParent.h
+++ b/dom/network/src/UDPSocketParent.h
@@ -21,29 +21,29 @@ class UDPSocketParent : public mozilla::
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIUDPSOCKETLISTENER
 
   UDPSocketParent(nsIUDPSocketFilter* filter) :
     mIPCOpen(true),
     mFilter(filter) {}
 
-  virtual ~UDPSocketParent();
-
   bool Init(const nsCString& aHost, const uint16_t aPort);
 
   virtual bool RecvClose() MOZ_OVERRIDE;
   virtual bool RecvData(const InfallibleTArray<uint8_t>& aData,
                         const nsCString& aRemoteAddress,
                         const uint16_t& aPort) MOZ_OVERRIDE;
   virtual bool RecvDataWithAddress( const InfallibleTArray<uint8_t>& data,
                                     const mozilla::net::NetAddr& addr);
   virtual bool RecvRequestDelete() MOZ_OVERRIDE;
 
 private:
+  virtual ~UDPSocketParent();
+
   virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
 
   bool mIPCOpen;
   nsCOMPtr<nsIUDPSocket> mSocket;
   nsCOMPtr<nsIUDPSocketFilter> mFilter;
 };
 
 } // namespace dom
--- a/dom/plugins/base/nsNPAPIPlugin.h
+++ b/dom/plugins/base/nsNPAPIPlugin.h
@@ -27,17 +27,16 @@ typedef NS_NPAPIPLUGIN_CALLBACK(NPError,
 
 class nsNPAPIPlugin : public nsISupports
 {
 private:
   typedef mozilla::PluginLibrary PluginLibrary;
 
 public:
   nsNPAPIPlugin();
-  virtual ~nsNPAPIPlugin();
 
   NS_DECL_ISUPPORTS
 
   // Constructs and initializes an nsNPAPIPlugin object. A nullptr file path
   // will prevent this from calling NP_Initialize.
   static nsresult CreatePlugin(nsPluginTag *aPluginTag, nsNPAPIPlugin** aResult);
 
   PluginLibrary* GetLibrary();
@@ -57,16 +56,18 @@ public:
   
   static bool RunPluginOOP(const nsPluginTag *aPluginTag);
 
   nsresult Shutdown();
 
   static nsresult RetainStream(NPStream *pstream, nsISupports **aRetainedPeer);
 
 protected:
+  virtual ~nsNPAPIPlugin();
+
   NPPluginFuncs mPluginFuncs;
   PluginLibrary* mLibrary;
 };
 
 namespace mozilla {
 namespace plugins {
 namespace parent {
 
--- a/dom/plugins/base/nsNPAPIPluginInstance.h
+++ b/dom/plugins/base/nsNPAPIPluginInstance.h
@@ -221,17 +221,16 @@ public:
 
   static nsNPAPIPluginInstance* GetFromNPP(NPP npp);
 #endif
 
   nsresult NewStreamListener(const char* aURL, void* notifyData,
                              nsNPAPIPluginStreamListener** listener);
 
   nsNPAPIPluginInstance();
-  virtual ~nsNPAPIPluginInstance();
 
   // To be called when an instance becomes orphaned, when
   // it's plugin is no longer guaranteed to be around.
   void Destroy();
 
   // Indicates whether the plugin is running normally.
   bool IsRunning() {
     return RUNNING == mRunning;
@@ -298,16 +297,18 @@ public:
     if (aReentryState == NS_PLUGIN_CALL_UNSAFE_TO_REENTER_GECKO) {
       NS_ASSERTION(gInUnsafePluginCalls > 0, "Must be in plugin call");
       --gInUnsafePluginCalls;
     }
   }
 
 protected:
 
+  virtual ~nsNPAPIPluginInstance();
+
   nsresult GetTagType(nsPluginTagType *result);
   nsresult GetAttributes(uint16_t& n, const char*const*& names,
                          const char*const*& values);
   nsresult GetParameters(uint16_t& n, const char*const*& names,
                          const char*const*& values);
   nsresult GetMode(int32_t *result);
 
   // check if this is a Java applet and affected by bug 750480
--- a/dom/plugins/base/nsNPAPIPluginStreamListener.h
+++ b/dom/plugins/base/nsNPAPIPluginStreamListener.h
@@ -43,21 +43,21 @@ protected:
 
 // Used to handle NPN_NewStream() - writes the stream as received by the plugin
 // to a file and at completion (NPN_DestroyStream), tells the browser to load it into
 // a plugin-specified target
 class nsPluginStreamToFile : public nsIOutputStream
 {
 public:
   nsPluginStreamToFile(const char* target, nsIPluginInstanceOwner* owner);
-  virtual ~nsPluginStreamToFile();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOUTPUTSTREAM
 protected:
+  virtual ~nsPluginStreamToFile();
   char* mTarget;
   nsCString mFileURL;
   nsCOMPtr<nsIFile> mTempFile;
   nsCOMPtr<nsIOutputStream> mOutputStream;
   nsIPluginInstanceOwner* mOwner;
 };
 
 class nsNPAPIPluginStreamListener : public nsITimerCallback,
@@ -68,17 +68,16 @@ private:
 
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSITIMERCALLBACK
   NS_DECL_NSIHTTPHEADERLISTENER
 
   nsNPAPIPluginStreamListener(nsNPAPIPluginInstance* inst, void* notifyData,
                               const char* aURL);
-  virtual ~nsNPAPIPluginStreamListener();
 
   nsresult OnStartBinding(nsPluginStreamListenerPeer* streamPeer);
   nsresult OnDataAvailable(nsPluginStreamListenerPeer* streamPeer,
                            nsIInputStream* input,
                            uint32_t length);
   nsresult OnFileAvailable(nsPluginStreamListenerPeer* streamPeer, 
                            const char* fileName);
   nsresult OnStopBinding(nsPluginStreamListenerPeer* streamPeer, 
@@ -100,16 +99,17 @@ public:
   void SetStreamListenerPeer(nsPluginStreamListenerPeer* aPeer) { mStreamListenerPeer = aPeer; }
 
   // Returns true if the redirect will be handled by NPAPI, false otherwise.
   bool HandleRedirectNotification(nsIChannel *oldChannel, nsIChannel *newChannel,
                                   nsIAsyncVerifyRedirectCallback* callback);
   void URLRedirectResponse(NPBool allow);
 
 protected:
+  virtual ~nsNPAPIPluginStreamListener();
   char* mStreamBuffer;
   char* mNotifyURL;
   nsRefPtr<nsNPAPIPluginInstance> mInst;
   nsNPAPIStreamWrapper *mNPStreamWrapper;
   uint32_t mStreamBufferSize;
   int32_t mStreamBufferByteCount;
   int32_t mStreamType;
   bool mStreamStarted;
--- a/dom/plugins/base/nsPluginHost.h
+++ b/dom/plugins/base/nsPluginHost.h
@@ -39,38 +39,38 @@ class nsPluginInstanceOwner;
 class nsNPAPIPluginInstance;
 class nsNPAPIPluginStreamListener;
 class nsIPluginInstanceOwner;
 class nsIInputStream;
 class nsIStreamListener;
 
 class nsInvalidPluginTag : public nsISupports
 {
+  virtual ~nsInvalidPluginTag();
 public:
   nsInvalidPluginTag(const char* aFullPath, int64_t aLastModifiedTime = 0);
-  virtual ~nsInvalidPluginTag();
   
   NS_DECL_ISUPPORTS
   
   nsCString   mFullPath;
   int64_t     mLastModifiedTime;
   bool        mSeen;
   
   nsRefPtr<nsInvalidPluginTag> mPrev;
   nsRefPtr<nsInvalidPluginTag> mNext;
 };
 
 class nsPluginHost : public nsIPluginHost,
                      public nsIObserver,
                      public nsITimerCallback,
                      public nsSupportsWeakReference
 {
+  virtual ~nsPluginHost();
 public:
   nsPluginHost();
-  virtual ~nsPluginHost();
 
   static already_AddRefed<nsPluginHost> GetInst();
 
   NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIPLUGINHOST
   NS_DECL_NSIOBSERVER
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -88,19 +88,20 @@ using namespace mozilla::dom;
 using namespace mozilla;
 using namespace mozilla::layers;
 
 // special class for handeling DOM context menu events because for
 // some reason it starves other mouse events if implemented on the
 // same class
 class nsPluginDOMContextMenuListener : public nsIDOMEventListener
 {
+  virtual ~nsPluginDOMContextMenuListener();
+
 public:
   nsPluginDOMContextMenuListener(nsIContent* aContent);
-  virtual ~nsPluginDOMContextMenuListener();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMEVENTLISTENER
 
   void Destroy(nsIContent* aContent);
 
   nsEventStatus ProcessEvent(const WidgetGUIEvent& anEvent)
   {
--- a/dom/plugins/base/nsPluginInstanceOwner.h
+++ b/dom/plugins/base/nsPluginInstanceOwner.h
@@ -40,17 +40,16 @@ class gfxXlibSurface;
 
 class nsPluginInstanceOwner : public nsIPluginInstanceOwner,
                               public nsIDOMEventListener,
                               public nsIPrivacyTransitionObserver,
                               public nsSupportsWeakReference
 {
 public:
   nsPluginInstanceOwner();
-  virtual ~nsPluginInstanceOwner();
   
   NS_DECL_ISUPPORTS
   NS_DECL_NSIPLUGININSTANCEOWNER
   NS_DECL_NSIPRIVACYTRANSITIONOBSERVER
   
   NS_IMETHOD GetURL(const char *aURL, const char *aTarget,
                     nsIInputStream *aPostStream, 
                     void *aHeadersData, uint32_t aHeadersDataLen) MOZ_OVERRIDE;
@@ -287,17 +286,18 @@ public:
   void RequestFullScreen();
   void ExitFullScreen();
 
   // Called from AndroidJNI when we removed the fullscreen view.
   static void ExitFullScreen(jobject view);
 #endif
   
 private:
-  
+  virtual ~nsPluginInstanceOwner();
+
   // return FALSE if LayerSurface dirty (newly created and don't have valid plugin content yet)
   bool IsUpToDate()
   {
     nsIntSize size;
     return NS_SUCCEEDED(mInstance->GetImageSize(&size)) &&
     size == nsIntSize(mPluginWindow->width, mPluginWindow->height);
   }
   
--- a/dom/plugins/base/nsPluginPlayPreviewInfo.h
+++ b/dom/plugins/base/nsPluginPlayPreviewInfo.h
@@ -6,25 +6,26 @@
 #ifndef nsPluginPlayPreviewInfo_h_
 #define nsPluginPlayPreviewInfo_h_
 
 #include "nsString.h"
 #include "nsIPluginHost.h"
 
 class nsPluginPlayPreviewInfo : public nsIPluginPlayPreviewInfo
 {
+  virtual ~nsPluginPlayPreviewInfo();
+
 public:
    NS_DECL_ISUPPORTS
    NS_DECL_NSIPLUGINPLAYPREVIEWINFO
 
   nsPluginPlayPreviewInfo(const char* aMimeType,
                           bool aIgnoreCTP,
                           const char* aRedirectURL);
   nsPluginPlayPreviewInfo(const nsPluginPlayPreviewInfo* aSource);
-  virtual ~nsPluginPlayPreviewInfo();
 
   nsCString mMimeType;
   bool      mIgnoreCTP;
   nsCString mRedirectURL;
 };
 
 
 #endif // nsPluginPlayPreviewInfo_h_
--- a/dom/plugins/base/nsPluginStreamListenerPeer.cpp
+++ b/dom/plugins/base/nsPluginStreamListenerPeer.cpp
@@ -34,24 +34,25 @@
 // nsPluginByteRangeStreamListener
 
 class nsPluginByteRangeStreamListener
   : public nsIStreamListener
   , public nsIInterfaceRequestor
 {
 public:
   nsPluginByteRangeStreamListener(nsIWeakReference* aWeakPtr);
-  virtual ~nsPluginByteRangeStreamListener();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSIINTERFACEREQUESTOR
 
 private:
+  virtual ~nsPluginByteRangeStreamListener();
+
   nsCOMPtr<nsIStreamListener> mStreamConverter;
   nsWeakPtr mWeakPtrPluginStreamListenerPeer;
   bool mRemoveMagicNumber;
 };
 
 NS_IMPL_ISUPPORTS(nsPluginByteRangeStreamListener,
                   nsIRequestObserver,
                   nsIStreamListener,
@@ -1196,31 +1197,32 @@ public:
     : mWeakListener(do_GetWeakReference(static_cast<nsIStreamListener*>(listener)))
     , mParent(parent)
     , mOldChannel(oldChannel)
     , mNewChannel(newChannel)
   {
   }
 
   ChannelRedirectProxyCallback() {}
-  virtual ~ChannelRedirectProxyCallback() {}
 
   NS_DECL_ISUPPORTS
 
   NS_IMETHODIMP OnRedirectVerifyCallback(nsresult result)
   {
     if (NS_SUCCEEDED(result)) {
       nsCOMPtr<nsIStreamListener> listener = do_QueryReferent(mWeakListener);
       if (listener)
         static_cast<nsPluginStreamListenerPeer*>(listener.get())->ReplaceRequest(mOldChannel, mNewChannel);
     }
     return mParent->OnRedirectVerifyCallback(result);
   }
 
 private:
+  virtual ~ChannelRedirectProxyCallback() {}
+
   nsWeakPtr mWeakListener;
   nsCOMPtr<nsIAsyncVerifyRedirectCallback> mParent;
   nsCOMPtr<nsIChannel> mOldChannel;
   nsCOMPtr<nsIChannel> mNewChannel;
 };
 
 NS_IMPL_ISUPPORTS(ChannelRedirectProxyCallback, nsIAsyncVerifyRedirectCallback)
 
--- a/dom/plugins/base/nsPluginStreamListenerPeer.h
+++ b/dom/plugins/base/nsPluginStreamListenerPeer.h
@@ -45,19 +45,20 @@ private:
 
 class nsPluginStreamListenerPeer : public nsIStreamListener,
 public nsIProgressEventSink,
 public nsIHttpHeaderVisitor,
 public nsSupportsWeakReference,
 public nsIInterfaceRequestor,
 public nsIChannelEventSink
 {
+  virtual ~nsPluginStreamListenerPeer();
+
 public:
   nsPluginStreamListenerPeer();
-  virtual ~nsPluginStreamListenerPeer();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIPROGRESSEVENTSINK
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSIHTTPHEADERVISITOR
   NS_DECL_NSIINTERFACEREQUESTOR
   NS_DECL_NSICHANNELEVENTSINK
--- a/dom/plugins/base/nsPluginTags.h
+++ b/dom/plugins/base/nsPluginTags.h
@@ -46,17 +46,16 @@ public:
               const char* aVersion,
               const char* const* aMimeTypes,
               const char* const* aMimeDescriptions,
               const char* const* aExtensions,
               int32_t aVariants,
               int64_t aLastModifiedTime,
               bool fromExtension,
               bool aArgsAreUTF8 = false);
-  virtual ~nsPluginTag();
 
   void TryUnloadPlugin(bool inShutdown);
 
   // plugin is enabled and not blocklisted
   bool IsActive();
 
   bool IsEnabled();
   void SetEnabled(bool enabled);
@@ -89,16 +88,18 @@ public:
   nsCString     mVersion;  // UTF-8
   int64_t       mLastModifiedTime;
   nsCOMPtr<nsITimer> mUnloadTimer;
 
   uint32_t      GetBlocklistState();
   void          InvalidateBlocklistState();
 
 private:
+  virtual ~nsPluginTag();
+
   nsCString     mNiceFileName; // UTF-8
   uint16_t      mCachedBlocklistState;
   bool          mCachedBlocklistStateValid;
   bool          mIsFromExtension;
 
   void InitMime(const char* const* aMimeTypes,
                 const char* const* aMimeDescriptions,
                 const char* const* aExtensions,
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -1754,16 +1754,17 @@ public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIOBSERVER
 
     explicit PluginProfilerObserver(PluginModuleParent* pmp)
       : mPmp(pmp)
     {}
 
 private:
+    ~PluginProfilerObserver() {}
     PluginModuleParent* mPmp;
 };
 
 NS_IMPL_ISUPPORTS(PluginProfilerObserver, nsIObserver, nsISupportsWeakReference)
 
 NS_IMETHODIMP
 PluginProfilerObserver::Observe(nsISupports *aSubject,
                                 const char *aTopic,
--- a/dom/power/PowerManager.h
+++ b/dom/power/PowerManager.h
@@ -56,16 +56,18 @@ public:
   bool KeyLightEnabled();
   void SetKeyLightEnabled(bool aEnabled);
   double ScreenBrightness();
   void SetScreenBrightness(double aBrightness, ErrorResult& aRv);
   bool CpuSleepAllowed();
   void SetCpuSleepAllowed(bool aAllowed);
 
 private:
+  ~PowerManager() {}
+
   nsCOMPtr<nsIDOMWindow> mWindow;
   nsTArray<nsCOMPtr<nsIDOMMozWakeLockListener> > mListeners;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_power_PowerManager_h
--- a/dom/power/WakeLock.h
+++ b/dom/power/WakeLock.h
@@ -35,17 +35,16 @@ public:
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(WakeLock, nsIDOMEventListener)
 
   // Note: WakeLock lives for the lifetime of the document in order to avoid
   // exposing GC behavior to pages. This means that
   // |var foo = navigator.requestWakeLock('cpu'); foo = null;|
   // doesn't unlock the 'cpu' resource.
 
   WakeLock();
-  virtual ~WakeLock();
 
   // Initialize this wake lock on behalf of the given window.  Null windows are
   // allowed; a lock without an associated window is always considered
   // invisible.
   nsresult Init(const nsAString &aTopic, nsIDOMWindow* aWindow);
 
   // Initialize this wake lock on behalf of the given process.  If the process
   // dies, the lock is released.  A wake lock initialized via this method is
@@ -59,16 +58,18 @@ public:
   virtual JSObject*
   WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   void GetTopic(nsAString& aTopic);
 
   void Unlock(ErrorResult& aRv);
 
 private:
+  virtual ~WakeLock();
+
   void     DoUnlock();
   void     DoLock();
   void     AttachEventListener();
   void     DetachEventListener();
 
   bool      mLocked;
   bool      mHidden;
 
--- a/dom/promise/Promise.cpp
+++ b/dom/promise/Promise.cpp
@@ -750,21 +750,23 @@ public:
     // same-compartment is when we're called via Xrays, and in that situation we
     // in fact want to create the array in the callee compartment
 
     JSAutoCompartment ac(cx, aGlobal.Get());
     mValues = JS_NewArrayObject(cx, aCountdown);
     mozilla::HoldJSObjects(this);
   }
 
+private:
   ~CountdownHolder()
   {
     mozilla::DropJSObjects(this);
   }
 
+public:
   void SetValue(uint32_t index, const JS::Handle<JS::Value> aValue)
   {
     MOZ_ASSERT(mCountdown > 0);
 
     ThreadsafeAutoSafeJSContext cx;
     JSAutoCompartment ac(cx, mValues);
     {
 
@@ -828,34 +830,34 @@ public:
   NS_DECL_CYCLE_COLLECTION_CLASS(AllResolveHandler)
 
   AllResolveHandler(CountdownHolder* aHolder, uint32_t aIndex)
     : mCountdownHolder(aHolder), mIndex(aIndex)
   {
     MOZ_ASSERT(aHolder);
   }
 
-  ~AllResolveHandler()
-  {
-  }
-
   void
   ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue)
   {
     mCountdownHolder->SetValue(mIndex, aValue);
   }
 
   void
   RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue)
   {
     // Should never be attached to Promise as a reject handler.
     MOZ_ASSERT(false, "AllResolveHandler should never be attached to a Promise's reject handler!");
   }
 
 private:
+  ~AllResolveHandler()
+  {
+  }
+
   nsRefPtr<CountdownHolder> mCountdownHolder;
   uint32_t mIndex;
 };
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(AllResolveHandler)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(AllResolveHandler)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AllResolveHandler)
--- a/dom/promise/PromiseCallback.h
+++ b/dom/promise/PromiseCallback.h
@@ -12,22 +12,24 @@
 
 namespace mozilla {
 namespace dom {
 
 // This is the base class for any PromiseCallback.
 // It's a logical step in the promise chain of callbacks.
 class PromiseCallback : public nsISupports
 {
+protected:
+  virtual ~PromiseCallback();
+
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(PromiseCallback)
 
   PromiseCallback();
-  virtual ~PromiseCallback();
 
   virtual void Call(JSContext* aCx,
                     JS::Handle<JS::Value> aValue) = 0;
 
   enum Task {
     Resolve,
     Reject
   };
--- a/dom/promise/PromiseNativeHandler.h
+++ b/dom/promise/PromiseNativeHandler.h
@@ -14,23 +14,24 @@ namespace dom {
 
 /*
  * PromiseNativeHandler allows C++ to react to a Promise being rejected/resolved.
  * A PromiseNativeHandler can be appended to a Promise using
  * Promise::AppendNativeHandler().
  */
 class PromiseNativeHandler : public nsISupports
 {
+protected:
+  virtual ~PromiseNativeHandler()
+  { }
+
 public:
   // NS_IMPL_ISUPPORTS0 in Promise.cpp.
   NS_DECL_ISUPPORTS
 
-  virtual ~PromiseNativeHandler()
-  { }
-
   virtual void
   ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) = 0;
 
   virtual void
   RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) = 0;
 };
 
 } // namespace dom
--- a/dom/quota/CheckQuotaHelper.cpp
+++ b/dom/quota/CheckQuotaHelper.cpp
@@ -53,16 +53,20 @@ CheckQuotaHelper::CheckQuotaHelper(nsPID
   mPromptResult(0),
   mWaiting(true),
   mHasPrompted(false)
 {
   NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
   mMutex.AssertCurrentThreadOwns();
 }
 
+CheckQuotaHelper::~CheckQuotaHelper()
+{
+}
+
 bool
 CheckQuotaHelper::PromptAndReturnQuotaIsDisabled()
 {
   NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
   mMutex.AssertCurrentThreadOwns();
 
   while (mWaiting) {
     mCondVar.Wait();
--- a/dom/quota/CheckQuotaHelper.h
+++ b/dom/quota/CheckQuotaHelper.h
@@ -39,16 +39,18 @@ public:
 
   void
   Cancel();
 
   static uint32_t
   GetQuotaPermission(nsIPrincipal* aPrincipal);
 
 private:
+  ~CheckQuotaHelper();
+
   nsPIDOMWindow* mWindow;
 
   mozilla::Mutex& mMutex;
   mozilla::CondVar mCondVar;
   uint32_t mPromptResult;
   bool mWaiting;
   bool mHasPrompted;
 };
--- a/dom/smil/nsSMILAnimationController.h
+++ b/dom/smil/nsSMILAnimationController.h
@@ -40,17 +40,16 @@ class SVGAnimationElement;
 // a compound document. These time containers can be paused individually or
 // here, at the document level.
 //
 class nsSMILAnimationController : public nsSMILTimeContainer,
                                   public nsARefreshObserver
 {
 public:
   nsSMILAnimationController(nsIDocument* aDoc);
-  ~nsSMILAnimationController();
 
   // Clears mDocument pointer. (Called by our nsIDocument when it's going away)
   void Disconnect();
 
   // nsSMILContainer
   virtual void Pause(uint32_t aType) MOZ_OVERRIDE;
   virtual void Resume(uint32_t aType) MOZ_OVERRIDE;
   virtual nsSMILTime GetParentTime() const MOZ_OVERRIDE;
@@ -102,16 +101,18 @@ public:
   void NotifyRefreshDriverCreated(nsRefreshDriver* aRefreshDriver);
   void NotifyRefreshDriverDestroying(nsRefreshDriver* aRefreshDriver);
 
   // Helper to check if we have any animation elements at all
   bool HasRegisteredAnimations()
   { return mAnimationElementTable.Count() != 0; }
 
 protected:
+  ~nsSMILAnimationController();
+
   // Typedefs
   typedef nsPtrHashKey<nsSMILTimeContainer> TimeContainerPtrKey;
   typedef nsTHashtable<TimeContainerPtrKey> TimeContainerHashtable;
   typedef nsPtrHashKey<mozilla::dom::SVGAnimationElement> AnimationElementPtrKey;
   typedef nsTHashtable<AnimationElementPtrKey> AnimationElementHashtable;
 
   struct SampleTimeContainerParams
   {
--- a/dom/smil/nsSMILTimeValueSpec.h
+++ b/dom/smil/nsSMILTimeValueSpec.h
@@ -106,16 +106,17 @@ protected:
   private:
     nsSMILTimeValueSpec* mSpec;
   };
 
   TimeReferenceElement mReferencedElement;
 
   class EventListener MOZ_FINAL : public nsIDOMEventListener
   {
+    ~EventListener() {}
   public:
     EventListener(nsSMILTimeValueSpec* aOwner) : mSpec(aOwner) { }
     void Disconnect()
     {
       mSpec = nullptr;
     }
 
     NS_DECL_ISUPPORTS
--- a/dom/src/geolocation/nsGeoPosition.h
+++ b/dom/src/geolocation/nsGeoPosition.h
@@ -28,18 +28,18 @@ class nsGeoPositionCoords MOZ_FINAL : pu
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIDOMGEOPOSITIONCOORDS
   
   nsGeoPositionCoords(double aLat, double aLong,
                       double aAlt, double aHError,
                       double aVError, double aHeading,
                       double aSpeed);
+private:
   ~nsGeoPositionCoords();
-private:
   const double mLat, mLong, mAlt, mHError, mVError, mHeading, mSpeed;
 };
 
 
 ////////////////////////////////////////////////////
 // nsGeoPosition
 ////////////////////////////////////////////////////
 
@@ -74,25 +74,25 @@ private:
 namespace mozilla {
 namespace dom {
 
 class Coordinates;
 
 class Position MOZ_FINAL : public nsISupports,
                            public nsWrapperCache
 {
+  ~Position();
+
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Position)
 
 public:
   Position(nsISupports* aParent, nsIDOMGeoPosition* aGeoPosition);
 
-  ~Position();
-
   nsISupports* GetParentObject() const;
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   Coordinates* Coords();
 
   uint64_t Timestamp() const;
 
@@ -102,25 +102,25 @@ private:
   nsRefPtr<Coordinates> mCoordinates;
   nsCOMPtr<nsISupports> mParent;
   nsCOMPtr<nsIDOMGeoPosition> mGeoPosition;
 };
 
 class Coordinates MOZ_FINAL : public nsISupports,
                               public nsWrapperCache
 {
+  ~Coordinates();
+
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Coordinates)
 
 public:
   Coordinates(Position* aPosition, nsIDOMGeoPositionCoords* aCoords);
 
-  ~Coordinates();
-
   Position* GetParentObject() const;
 
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   double Latitude() const;
 
   double Longitude() const;
 
--- a/dom/src/geolocation/nsGeolocation.cpp
+++ b/dom/src/geolocation/nsGeolocation.cpp
@@ -80,25 +80,25 @@ class nsGeolocationRequest
 
   void SendLocation(nsIDOMGeoPosition* location);
   bool WantsHighAccuracy() {return !mShutdown && mOptions && mOptions->mEnableHighAccuracy;}
   void SetTimeoutTimer();
   void StopTimeoutTimer();
   void NotifyErrorAndShutdown(uint16_t);
   nsIPrincipal* GetPrincipal();
 
-  ~nsGeolocationRequest();
-
   virtual bool Recv__delete__(const bool& allow,
                               const InfallibleTArray<PermissionChoice>& choices) MOZ_OVERRIDE;
   virtual void IPDLRelease() MOZ_OVERRIDE { Release(); }
 
   bool IsWatch() { return mIsWatchPositionRequest; }
   int32_t WatchId() { return mWatchId; }
  private:
+  ~nsGeolocationRequest();
+
   bool mIsWatchPositionRequest;
 
   nsCOMPtr<nsITimer> mTimeoutTimer;
   GeoPositionCallback mCallback;
   GeoPositionErrorCallback mErrorCallback;
   nsAutoPtr<PositionOptions> mOptions;
 
   nsRefPtr<Geolocation> mLocator;
@@ -116,27 +116,27 @@ CreatePositionOptionsCopy(const Position
   geoOptions->mMaximumAge = aOptions.mMaximumAge;
   geoOptions->mTimeout = aOptions.mTimeout;
 
   return geoOptions.forget();
 }
 
 class GeolocationSettingsCallback : public nsISettingsServiceCallback
 {
+  virtual ~GeolocationSettingsCallback() {
+    MOZ_COUNT_DTOR(GeolocationSettingsCallback);
+  }
+
 public:
   NS_DECL_ISUPPORTS
 
   GeolocationSettingsCallback() {
     MOZ_COUNT_CTOR(GeolocationSettingsCallback);
   }
 
-  virtual ~GeolocationSettingsCallback() {
-    MOZ_COUNT_DTOR(GeolocationSettingsCallback);
-  }
-
   NS_IMETHOD Handle(const nsAString& aName, JS::Handle<JS::Value> aResult)
   {
     MOZ_ASSERT(NS_IsMainThread());
 
     // The geolocation is enabled by default:
     bool value = true;
     if (aResult.isBoolean()) {
       value = aResult.toBoolean();
--- a/dom/src/json/nsJSON.h
+++ b/dom/src/json/nsJSON.h
@@ -40,22 +40,23 @@ protected:
 
   nsCOMPtr<nsIUnicodeEncoder> mEncoder;
 };
 
 class nsJSON : public nsIJSON
 {
 public:
   nsJSON();
-  virtual ~nsJSON();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIJSON
 
 protected:
+  virtual ~nsJSON();
+
   nsresult EncodeInternal(JSContext* cx,
                           const JS::Value& val,
                           nsJSONWriter* writer);
 
   nsresult DecodeInternal(JSContext* cx,
                           nsIInputStream* aStream,
                           int32_t aContentLength,
                           bool aNeedsConverter,
@@ -65,23 +66,24 @@ protected:
 
 nsresult
 NS_NewJSON(nsISupports* aOuter, REFNSIID aIID, void** aResult);
 
 class nsJSONListener : public nsIStreamListener
 {
 public:
   nsJSONListener(JSContext *cx, JS::Value *rootVal, bool needsConverter);
-  virtual ~nsJSONListener();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
 
 protected:
+  virtual ~nsJSONListener();
+
   bool mNeedsConverter;
   JSContext *mCx;
   JS::Value *mRootVal;
   nsCOMPtr<nsIUnicodeDecoder> mDecoder;
   nsCString mSniffBuffer;
   nsTArray<char16_t> mBufferedChars;
   nsresult ProcessBytes(const char* aBuffer, uint32_t aByteLength);
   nsresult ConsumeConverted(const char* aBuffer, uint32_t aByteLength);
--- a/dom/src/jsurl/nsJSProtocolHandler.h
+++ b/dom/src/jsurl/nsJSProtocolHandler.h
@@ -40,24 +40,24 @@ class nsJSProtocolHandler : public nsIPr
 public:
     NS_DECL_ISUPPORTS
 
     // nsIProtocolHandler methods:
     NS_DECL_NSIPROTOCOLHANDLER
 
     // nsJSProtocolHandler methods:
     nsJSProtocolHandler();
-    virtual ~nsJSProtocolHandler();
 
     static nsresult
     Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
 
     nsresult Init();
 
 protected:
+    virtual ~nsJSProtocolHandler();
 
     nsresult EnsureUTF8Spec(const nsAFlatCString &aSpec, const char *aCharset, 
                             nsACString &aUTF8Spec);
 
     nsCOMPtr<nsITextToSubURI>  mTextToSubURI;
 };
 
 
--- a/dom/src/notification/DesktopNotification.cpp
+++ b/dom/src/notification/DesktopNotification.cpp
@@ -24,16 +24,20 @@ namespace dom {
 /*
  * Simple Request
  */
 class DesktopNotificationRequest : public nsIContentPermissionRequest,
                                    public nsRunnable,
                                    public PCOMContentPermissionRequestChild
 
 {
+  ~DesktopNotificationRequest()
+  {
+  }
+
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSICONTENTPERMISSIONREQUEST
 
   DesktopNotificationRequest(DesktopNotification* notification)
     : mDesktopNotification(notification) {}
 
   NS_IMETHOD Run() MOZ_OVERRIDE
@@ -41,20 +45,16 @@ public:
     nsCOMPtr<nsIContentPermissionPrompt> prompt =
       do_CreateInstance(NS_CONTENT_PERMISSION_PROMPT_CONTRACTID);
     if (prompt) {
       prompt->Prompt(this);
     }
     return NS_OK;
   }
 
-  ~DesktopNotificationRequest()
-  {
-  }
-
   virtual bool Recv__delete__(const bool& aAllow,
                               const InfallibleTArray<PermissionChoice>& choices) MOZ_OVERRIDE
   {
     MOZ_ASSERT(choices.IsEmpty(), "DesktopNotification doesn't support permission choice");
     if (aAllow) {
       (void) Allow(JS::UndefinedHandleValue);
     } else {
      (void) Cancel();
--- a/dom/src/notification/DesktopNotification.h
+++ b/dom/src/notification/DesktopNotification.h
@@ -51,20 +51,16 @@ public:
     MOZ_ASSERT(sop);
 
     mPrincipal = sop->GetPrincipal();
     MOZ_ASSERT(mPrincipal);
 
     SetIsDOMBinding();
   }
 
-  virtual ~DesktopNotificationCenter()
-  {
-  }
-
   void Shutdown() {
     mOwner = nullptr;
   }
 
   nsPIDOMWindow* GetParentObject() const
   {
     return mOwner;
   }
@@ -72,16 +68,20 @@ public:
   virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   already_AddRefed<DesktopNotification>
   CreateNotification(const nsAString& title,
                      const nsAString& description,
                      const nsAString& iconURL);
 
 private:
+  virtual ~DesktopNotificationCenter()
+  {
+  }
+
   nsCOMPtr<nsPIDOMWindow> mOwner;
   nsCOMPtr<nsIPrincipal> mPrincipal;
 };
 
 class DesktopNotificationRequest;
 
 class DesktopNotification MOZ_FINAL : public DOMEventTargetHelper
 {
@@ -145,18 +145,16 @@ protected:
 class AlertServiceObserver: public nsIObserver
 {
  public:
   NS_DECL_ISUPPORTS
 
     AlertServiceObserver(DesktopNotification* notification)
     : mNotification(notification) {}
 
-  virtual ~AlertServiceObserver() {}
-
   void Disconnect() { mNotification = nullptr; }
 
   NS_IMETHODIMP
   Observe(nsISupports *aSubject,
           const char *aTopic,
           const char16_t *aData)
   {
 
@@ -167,15 +165,17 @@ class AlertServiceObserver: public nsIOb
       return NS_ERROR_NOT_AVAILABLE;
 #endif
       mNotification->HandleAlertServiceNotification(aTopic);
     }
     return NS_OK;
   };
 
  private:
+  virtual ~AlertServiceObserver() {}
+
   DesktopNotification* mNotification;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif /* mozilla_dom_DesktopNotification_h */
--- a/dom/src/notification/Notification.cpp
+++ b/dom/src/notification/Notification.cpp
@@ -155,23 +155,23 @@ public:
                                            nsIContentPermissionRequest)
 
   NotificationPermissionRequest(nsIPrincipal* aPrincipal, nsPIDOMWindow* aWindow,
                                 NotificationPermissionCallback* aCallback)
     : mPrincipal(aPrincipal), mWindow(aWindow),
       mPermission(NotificationPermission::Default),
       mCallback(aCallback) {}
 
-  virtual ~NotificationPermissionRequest() {}
-
   bool Recv__delete__(const bool& aAllow,
                       const InfallibleTArray<PermissionChoice>& choices);
   void IPDLRelease() { Release(); }
 
 protected:
+  virtual ~NotificationPermissionRequest() {}
+
   nsresult CallCallback();
   nsresult DispatchCallback();
   nsCOMPtr<nsIPrincipal> mPrincipal;
   nsCOMPtr<nsPIDOMWindow> mWindow;
   NotificationPermission mPermission;
   nsRefPtr<NotificationPermissionCallback> mCallback;
 };
 
@@ -179,19 +179,19 @@ class NotificationObserver : public nsIO
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
   NotificationObserver(Notification* aNotification)
     : mNotification(aNotification) {}
 
+protected:
   virtual ~NotificationObserver() {}
 
-protected:
   nsRefPtr<Notification> mNotification;
 };
 
 class NotificationTask : public nsIRunnable
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIRUNNABLE
@@ -199,19 +199,19 @@ public:
   enum NotificationAction {
     eShow,
     eClose
   };
 
   NotificationTask(Notification* aNotification, NotificationAction aAction)
     : mNotification(aNotification), mAction(aAction) {}
 
+protected:
   virtual ~NotificationTask() {}
 
-protected:
   nsRefPtr<Notification> mNotification;
   NotificationAction mAction;
 };
 
 uint32_t Notification::sCount = 0;
 
 NS_IMPL_CYCLE_COLLECTION(NotificationPermissionRequest, mWindow)
 
--- a/dom/src/storage/DOMStorage.h
+++ b/dom/src/storage/DOMStorage.h
@@ -36,31 +36,32 @@ class DOMStorage MOZ_FINAL : public nsID
   virtual bool CanAccess(nsIPrincipal* aPrincipal) MOZ_OVERRIDE;
   virtual bool IsPrivate() MOZ_OVERRIDE { return mIsPrivate; }
 
   DOMStorage(DOMStorageManager* aManager,
              DOMStorageCache* aCache,
              const nsAString& aDocumentURI,
              nsIPrincipal* aPrincipal,
              bool aIsPrivate);
-  ~DOMStorage();
 
   // The method checks whether the caller can use a storage.
   // CanUseStorage is called before any DOM initiated operation
   // on a storage is about to happen and ensures that the storage's
   // session-only flag is properly set according the current settings.
   // It is an optimization since the privileges check and session only
   // state determination are complex and share the code (comes hand in
   // hand together).
   static bool CanUseStorage(DOMStorage* aStorage = nullptr);
 
   bool IsPrivate() const { return mIsPrivate; }
   bool IsSessionOnly() const { return mIsSessionOnly; }
 
 private:
+  ~DOMStorage();
+
   friend class DOMStorageManager;
   friend class DOMStorageCache;
 
   nsRefPtr<DOMStorageManager> mManager;
   nsRefPtr<DOMStorageCache> mCache;
   nsString mDocumentURI;
 
   // Principal this DOMStorage (i.e. localStorage or sessionStorage) has
--- a/dom/src/storage/DOMStorageCache.cpp
+++ b/dom/src/storage/DOMStorageCache.cpp
@@ -237,27 +237,27 @@ DOMStorageCache::Preload()
 }
 
 namespace { // anon
 
 // This class is passed to timer as a tick observer.  It refers the cache
 // and keeps it alive for a time.
 class DOMStorageCacheHolder : public nsITimerCallback
 {
+  virtual ~DOMStorageCacheHolder() {}
+
   NS_DECL_ISUPPORTS
 
   NS_IMETHODIMP
   Notify(nsITimer* aTimer)
   {
     mCache = nullptr;
     return NS_OK;
   }
 
-  virtual ~DOMStorageCacheHolder() {}
-
   nsRefPtr<DOMStorageCache> mCache;
 
 public:
   DOMStorageCacheHolder(DOMStorageCache* aCache) : mCache(aCache) {}
 };
 
 NS_IMPL_ISUPPORTS(DOMStorageCacheHolder, nsITimerCallback)
 
--- a/dom/src/storage/DOMStorageCache.h
+++ b/dom/src/storage/DOMStorageCache.h
@@ -27,18 +27,16 @@ class DOMStorageDBBridge;
 // Interface class on which only the database or IPC may call.
 // Used to populate the cache with DB data.
 class DOMStorageCacheBridge
 {
 public:
   NS_IMETHOD_(MozExternalRefCountType) AddRef(void);
   NS_IMETHOD_(void) Release(void);
 
-  virtual ~DOMStorageCacheBridge() {}
-
   // The scope (origin) in the database usage format (reversed)
   virtual const nsCString& Scope() const = 0;
 
   // Whether the cache is already fully loaded
   virtual bool Loaded() = 0;
 
   // How many items has so far been loaded into the cache, used
   // for optimization purposes
@@ -51,16 +49,18 @@ public:
   // to this cache
   virtual void LoadDone(nsresult aRv) = 0;
 
   // Use to synchronously wait until the cache gets fully loaded with data,
   // this method exits after LoadDone has been called
   virtual void LoadWait() = 0;
 
 protected:
+  virtual ~DOMStorageCacheBridge() {}
+
   ThreadSafeAutoRefCnt mRefCnt;
   NS_DECL_OWNINGTHREAD
 };
 
 // Implementation of scope cache that is responsible for preloading data
 // for persistent storage (localStorage) and hold data for non-private,
 // private and session-only cookie modes.  It is also responsible for
 // persisting data changes using the database, works as a write-back cache.
--- a/dom/src/storage/DOMStorageDBThread.cpp
+++ b/dom/src/storage/DOMStorageDBThread.cpp
@@ -337,16 +337,18 @@ DOMStorageDBThread::ThreadFunc()
 
 extern void
 ReverseString(const nsCSubstring& aSource, nsCSubstring& aResult);
 
 namespace { // anon
 
 class nsReverseStringSQLFunction MOZ_FINAL : public mozIStorageFunction
 {
+  ~nsReverseStringSQLFunction() {}
+
   NS_DECL_ISUPPORTS
   NS_DECL_MOZISTORAGEFUNCTION
 };
 
 NS_IMPL_ISUPPORTS(nsReverseStringSQLFunction, mozIStorageFunction)
 
 NS_IMETHODIMP
 nsReverseStringSQLFunction::OnFunctionCall(
--- a/dom/src/storage/DOMStorageIPC.h
+++ b/dom/src/storage/DOMStorageIPC.h
@@ -20,19 +20,20 @@ class DOMLocalStorageManager;
 
 // Child side of the IPC protocol, exposes as DB interface but
 // is responsible to send all requests to the parent process
 // and expects asynchronous answers. Those are then transparently
 // forwarded back to consumers on the child process.
 class DOMStorageDBChild MOZ_FINAL : public DOMStorageDBBridge
                                   , public PStorageChild
 {
+  virtual ~DOMStorageDBChild();
+
 public:
   DOMStorageDBChild(DOMLocalStorageManager* aManager);
-  virtual ~DOMStorageDBChild();
 
   NS_IMETHOD_(MozExternalRefCountType) AddRef(void);
   NS_IMETHOD_(MozExternalRefCountType) Release(void);
 
   void AddIPDLReference();
   void ReleaseIPDLReference();
 
   virtual nsresult Init();
@@ -103,19 +104,20 @@ private:
 // Receives async requests from child processes and is responsible
 // to send back responses from the DB thread.  Exposes as a fake
 // DOMStorageCache consumer.
 // Also responsible for forwardning all chrome operation notifications
 // such as cookie cleaning etc to the child process.
 class DOMStorageDBParent MOZ_FINAL : public PStorageParent
                                    , public DOMStorageObserverSink
 {
+  virtual ~DOMStorageDBParent();
+
 public:
   DOMStorageDBParent();
-  virtual ~DOMStorageDBParent();
 
   virtual mozilla::ipc::IProtocol*
   CloneProtocol(Channel* aChannel,
                 mozilla::ipc::ProtocolCloneContext* aCtx) MOZ_OVERRIDE;
 
   NS_IMETHOD_(MozExternalRefCountType) AddRef(void);
   NS_IMETHOD_(MozExternalRefCountType) Release(void);
 
--- a/dom/src/storage/DOMStorageObserver.h
+++ b/dom/src/storage/DOMStorageObserver.h
@@ -33,27 +33,27 @@ private:
 // chrome clearing notifications, such as cookie deletion etc.
 class DOMStorageObserver : public nsIObserver
                          , public nsSupportsWeakReference
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
-  virtual ~DOMStorageObserver() {}
-
   static nsresult Init();
   static nsresult Shutdown();
   static DOMStorageObserver* Self() { return sSelf; }
 
   void AddSink(DOMStorageObserverSink* aObs);
   void RemoveSink(DOMStorageObserverSink* aObs);
   void Notify(const char* aTopic, const nsACString& aData = EmptyCString());
 
 private:
+  virtual ~DOMStorageObserver() {}
+
   static DOMStorageObserver* sSelf;
 
   // Weak references
   nsTArray<DOMStorageObserverSink*> mSinks;
   nsCOMPtr<nsITimer> mDBThreadStartDelayTimer;
 };
 
 } // ::dom
--- a/dom/system/OSFileConstants.cpp
+++ b/dom/system/OSFileConstants.cpp
@@ -200,16 +200,18 @@ nsresult GetPathToSpecialDir(const char 
  * to ensure that this does not break existing code, so that future
  * workers spawned after the profile is setup have these constants.
  *
  * For this purpose, we register an observer to set |gPaths->profileDir|
  * and |gPaths->localProfileDir| once the profile is setup.
  */
 class DelayedPathSetter MOZ_FINAL: public nsIObserver
 {
+  ~DelayedPathSetter() {}
+
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
   DelayedPathSetter() {}
 };
 
 NS_IMPL_ISUPPORTS(DelayedPathSetter, nsIObserver)
 
--- a/dom/system/nsDeviceSensors.h
+++ b/dom/system/nsDeviceSensors.h
@@ -29,21 +29,21 @@ class nsDeviceSensors : public nsIDevice
   typedef mozilla::dom::DeviceAccelerationInit DeviceAccelerationInit;
   typedef mozilla::dom::DeviceRotationRateInit DeviceRotationRateInit;
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDEVICESENSORS
 
   nsDeviceSensors();
 
-  virtual ~nsDeviceSensors();
-
   void Notify(const mozilla::hal::SensorData& aSensorData);
 
 private:
+  virtual ~nsDeviceSensors();
+
   // sensor -> window listener
   nsTArray<nsTArray<nsIDOMWindow*>* > mWindowListeners;
 
   void FireDOMLightEvent(mozilla::dom::EventTarget* aTarget,
                          double value);
 
   void FireDOMProximityEvent(mozilla::dom::EventTarget* aTarget,
                              double aValue,
--- a/dom/telephony/Telephony.cpp
+++ b/dom/telephony/Telephony.cpp
@@ -29,56 +29,56 @@
 
 using namespace mozilla::dom;
 using mozilla::ErrorResult;
 
 class Telephony::Listener : public nsITelephonyListener
 {
   Telephony* mTelephony;
 
+  virtual ~Listener() {}
+
 public:
   NS_DECL_ISUPPORTS
   NS_FORWARD_SAFE_NSITELEPHONYLISTENER(mTelephony)
 
   Listener(Telephony* aTelephony)
     : mTelephony(aTelephony)
   {
     MOZ_ASSERT(mTelephony);
   }
 
-  virtual ~Listener() {}
-
   void
   Disconnect()
   {
     MOZ_ASSERT(mTelephony);
     mTelephony = nullptr;
   }
 };
 
 class Telephony::Callback : public nsITelephonyCallback
 {
   nsRefPtr<Telephony> mTelephony;
   nsRefPtr<Promise> mPromise;
   uint32_t mServiceId;
   nsString mNumber;
 
+  virtual ~Callback() {}
+
 public:
   NS_DECL_ISUPPORTS
 
   Callback(Telephony* aTelephony, Promise* aPromise, uint32_t aServiceId,
            const nsAString& aNumber)
     : mTelephony(aTelephony), mPromise(aPromise), mServiceId(aServiceId),
       mNumber(aNumber)
   {
     MOZ_ASSERT(mTelephony);
   }
 
-  virtual ~Callback() {}
-
   NS_IMETHODIMP
   NotifyDialError(const nsAString& aError)
   {
     mPromise->MaybeRejectBrokenly(aError);
     return NS_OK;
   }
 
   NS_IMETHODIMP
--- a/dom/time/TimeManager.h
+++ b/dom/time/TimeManager.h
@@ -44,16 +44,18 @@ public:
     return mWindow;
   }
   JSObject* WrapObject(JSContext* aCx);
 
   void Set(Date& aDate);
   void Set(double aTime);
 
 private:
+  ~TimeManager() {}
+
   nsCOMPtr<nsPIDOMWindow> mWindow;
 };
 
 } // namespace time
 } // namespace dom
 } // namespace mozilla
 
 #endif //mozilla_dom_time_TimeManager_h
--- a/dom/time/TimeService.h
+++ b/dom/time/TimeService.h
@@ -16,20 +16,21 @@ namespace time {
  * This class implements a service which lets us modify the system clock time.
  */
 class TimeService : public nsITimeService
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSITIMESERVICE
 
-  virtual ~TimeService() {};
   static already_AddRefed<TimeService> GetInstance();
 
 private:
+  virtual ~TimeService() {};
+
   static StaticRefPtr<TimeService> sSingleton;
 };
 
 } // namespace time
 } // namespace dom
 } // namespace mozilla
 
 #endif //mozilla_dom_time_TimeService_h
--- a/dom/workers/Location.h
+++ b/dom/workers/Location.h
@@ -42,36 +42,36 @@ class WorkerLocation MOZ_FINAL : public 
     , mSearch(aSearch)
     , mHash(aHash)
     , mOrigin(aOrigin)
   {
     MOZ_COUNT_CTOR(WorkerLocation);
     SetIsDOMBinding();
   }
 
+  ~WorkerLocation()
+  {
+    MOZ_COUNT_DTOR(WorkerLocation);
+  }
+
 public:
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WorkerLocation)
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WorkerLocation)
 
   static already_AddRefed<WorkerLocation>
   Create(WorkerPrivate::LocationInfo& aInfo);
 
   virtual JSObject*
   WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   nsISupports* GetParentObject() const {
     return nullptr;
   }
 
-  ~WorkerLocation()
-  {
-    MOZ_COUNT_DTOR(WorkerLocation);
-  }
-
   void Stringify(nsString& aHref) const
   {
     aHref = mHref;
   }
   void GetHref(nsString& aHref) const
   {
     aHref = mHref;
   }
--- a/dom/workers/Navigator.h
+++ b/dom/workers/Navigator.h
@@ -40,36 +40,36 @@ class WorkerNavigator MOZ_FINAL : public
     , mPlatform(aPlatform)
     , mUserAgent(aUserAgent)
     , mOnline(aOnline)
   {
     MOZ_COUNT_CTOR(WorkerNavigator);
     SetIsDOMBinding();
   }
 
+  ~WorkerNavigator()
+  {
+    MOZ_COUNT_DTOR(WorkerNavigator);
+  }
+
 public:
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WorkerNavigator)
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WorkerNavigator)
 
   static already_AddRefed<WorkerNavigator>
   Create(bool aOnLine);
 
   virtual JSObject*
   WrapObject(JSContext* aCx) MOZ_OVERRIDE;
 
   nsISupports* GetParentObject() const {
     return nullptr;
   }
 
-  ~WorkerNavigator()
-  {
-    MOZ_COUNT_DTOR(WorkerNavigator);
-  }
-
   void GetAppCodeName(nsString& aAppCodeName) const
   {
     aAppCodeName.AssignLiteral("Mozilla");
   }
   void GetAppName(nsString& aAppName) const
   {
     aAppName = mAppName;
   }
--- a/dom/workers/URL.h
+++ b/dom/workers/URL.h
@@ -22,22 +22,23 @@ struct objectURLOptions;
 BEGIN_WORKERS_NAMESPACE
 
 class URLProxy;
 
 class URL MOZ_FINAL : public mozilla::dom::URLSearchParamsObserver
 {
   typedef mozilla::dom::URLSearchParams URLSearchParams;
 
+  ~URL();
+
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_CLASS(URL)
 
   URL(WorkerPrivate* aWorkerPrivate, URLProxy* aURLProxy);
-  ~URL();
 
   nsISupports*
   GetParentObject() const
   {
     // There's only one global on a worker, so we don't need to specify.
     return nullptr;
   }
 
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -1369,16 +1369,18 @@ private:
 void
 DummyCallback(nsITimer* aTimer, void* aClosure)
 {
   // Nothing!
 }
 
 class TimerThreadEventTarget MOZ_FINAL : public nsIEventTarget
 {
+  ~TimerThreadEventTarget() {}
+
   WorkerPrivate* mWorkerPrivate;
   nsRefPtr<WorkerRunnable> mWorkerRunnable;
 
 public:
   TimerThreadEventTarget(WorkerPrivate* aWorkerPrivate,
                          WorkerRunnable* aWorkerRunnable)
   : mWorkerPrivate(aWorkerPrivate), mWorkerRunnable(aWorkerRunnable)
   {
--- a/dom/xbl/XBLChildrenElement.h
+++ b/dom/xbl/XBLChildrenElement.h
@@ -148,21 +148,16 @@ class nsAnonymousContentList : public ns
 public:
   nsAnonymousContentList(nsIContent* aParent)
     : mParent(aParent)
   {
     MOZ_COUNT_CTOR(nsAnonymousContentList);
     SetIsDOMBinding();
   }
 
-  virtual ~nsAnonymousContentList()
-  {
-    MOZ_COUNT_DTOR(nsAnonymousContentList);
-  }
-
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsAnonymousContentList)
   // nsIDOMNodeList interface
   NS_DECL_NSIDOMNODELIST
 
   // nsINodeList interface
   virtual int32_t IndexOf(nsIContent* aContent);
   virtual nsINode* GetParentObject() { return mParent; }
@@ -170,12 +165,17 @@ public:
 
   virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
 
   bool IsListFor(nsIContent* aContent) {
     return mParent == aContent;
   }
 
 private:
+  virtual ~nsAnonymousContentList()
+  {
+    MOZ_COUNT_DTOR(nsAnonymousContentList);
+  }
+
   nsCOMPtr<nsIContent> mParent;
 };
 
 #endif // nsXBLChildrenElement_h___
--- a/dom/xbl/nsBindingManager.h
+++ b/dom/xbl/nsBindingManager.h
@@ -32,25 +32,26 @@ typedef nsTArray<nsRefPtr<nsXBLBinding> 
 class nsIPrincipal;
 
 namespace mozilla {
 class CSSStyleSheet;
 } // namespace mozilla
 
 class nsBindingManager MOZ_FINAL : public nsStubMutationObserver
 {
+  ~nsBindingManager();
+
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
   NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
 
   nsBindingManager(nsIDocument* aDocument);
-  ~nsBindingManager();
 
   nsXBLBinding* GetBindingWithContent(nsIContent* aContent);
 
   void AddBoundContent(nsIContent* aContent);
   void RemoveBoundContent(nsIContent* aContent);
 
   /**
    * Notify the binding manager that an element
--- a/dom/xbl/nsXBLBinding.h
+++ b/dom/xbl/nsXBLBinding.h
@@ -37,17 +37,16 @@ class nsAnonymousContentList;
 // *********************************************************************/
 // The XBLBinding class
 
 class nsXBLBinding MOZ_FINAL
 {
 public:
   nsXBLBinding(nsXBLPrototypeBinding* aProtoBinding);
   nsXBLBinding(mozilla::dom::ShadowRoot* aShadowRoot, nsXBLPrototypeBinding* aProtoBinding);
-  ~nsXBLBinding();
 
   /**
    * XBLBindings are refcounted.  They are held onto in 3 ways:
    * 1. The binding manager's binding table holds onto all bindings that are
    *    currently attached to a content node.
    * 2. Bindings hold onto their base binding.  This is important since
    *    the base binding itself may not be attached to anything.
    * 3. The binding manager holds an additional reference to bindings
@@ -81,16 +80,18 @@ public:
 
   /*
    * Determines whether the binding has a field with the given name.
    */
   bool HasField(nsString& aName);
 
 protected:
 
+  ~nsXBLBinding();
+
   /*
    * Internal version. Requires that aCx is in appropriate xbl scope.
    */
   bool LookupMemberInternal(JSContext* aCx, nsString& aName,
                             JS::Handle<jsid> aNameAsId,
                             JS::MutableHandle<JSPropertyDescriptor> aDesc,
                             JS::Handle<JSObject*> aXBLScope);
 
--- a/dom/xbl/nsXBLDocumentInfo.h
+++ b/dom/xbl/nsXBLDocumentInfo.h
@@ -16,17 +16,16 @@ class nsXBLPrototypeBinding;
 class nsXBLDocGlobalObject;
 
 class nsXBLDocumentInfo MOZ_FINAL : public nsSupportsWeakReference
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   nsXBLDocumentInfo(nsIDocument* aDocument);
-  virtual ~nsXBLDocumentInfo();
 
   already_AddRefed<nsIDocument> GetDocument()
     { nsCOMPtr<nsIDocument> copy = mDocument; return copy.forget(); }
 
   bool GetScriptAccess() const { return mScriptAccess; }
 
   nsIURI* DocumentURI() { return mDocument->GetDocumentURI(); }
 
@@ -47,16 +46,18 @@ public:
 
   void MarkInCCGeneration(uint32_t aGeneration);
 
   static nsresult ReadPrototypeBindings(nsIURI* aURI, nsXBLDocumentInfo** aDocInfo);
 
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsXBLDocumentInfo)
 
 private:
+  virtual ~nsXBLDocumentInfo();
+
   nsCOMPtr<nsIDocument> mDocument;
   bool mScriptAccess;
   bool mIsChrome;
   // the binding table owns each nsXBLPrototypeBinding
   nsAutoPtr<nsClassHashtable<nsCStringHashKey, nsXBLPrototypeBinding>> mBindingTable;
 
   // non-owning pointer to the first binding in the table
   nsXBLPrototypeBinding* mFirstBinding;
--- a/dom/xbl/nsXBLEventHandler.h
+++ b/dom/xbl/nsXBLEventHandler.h
@@ -14,23 +14,23 @@
 class nsIAtom;
 class nsIDOMKeyEvent;
 class nsXBLPrototypeHandler;
 
 class nsXBLEventHandler : public nsIDOMEventListener
 {
 public:
   nsXBLEventHandler(nsXBLPrototypeHandler* aHandler);
-  virtual ~nsXBLEventHandler();
 
   NS_DECL_ISUPPORTS
 
   NS_DECL_NSIDOMEVENTLISTENER
 
 protected:
+  virtual ~nsXBLEventHandler();
   nsXBLPrototypeHandler* mProtoHandler;
 
 private:
   nsXBLEventHandler();
   virtual bool EventMatched(nsIDOMEvent* aEvent)
   {
     return true;
   }
@@ -45,17 +45,16 @@ public:
 private:
   bool EventMatched(nsIDOMEvent* aEvent) MOZ_OVERRIDE;
 };
 
 class nsXBLKeyEventHandler : public nsIDOMEventListener
 {
 public:
   nsXBLKeyEventHandler(nsIAtom* aEventType, uint8_t aPhase, uint8_t aType);
-  virtual ~nsXBLKeyEventHandler();
 
   NS_DECL_ISUPPORTS
 
   NS_DECL_NSIDOMEVENTLISTENER
 
   void AddProtoHandler(nsXBLPrototypeHandler* aProtoHandler)
   {
     mProtoHandlers.AppendElement(aProtoHandler);
@@ -88,16 +87,18 @@ public:
 
   void SetUsingContentXBLScope(bool aUsingContentXBLScope)
   {
     mUsingContentXBLScope = aUsingContentXBLScope;
   }
 
 private:
   nsXBLKeyEventHandler();
+  virtual ~nsXBLKeyEventHandler();
+
   bool ExecuteMatchedHandlers(nsIDOMKeyEvent* aEvent, uint32_t aCharCode,
                                 bool aIgnoreShiftKey);
 
   nsTArray<nsXBLPrototypeHandler*> mProtoHandlers;
   nsCOMPtr<nsIAtom> mEventType;
   uint8_t mPhase;
   uint8_t mType;
   bool mIsBoundToChrome;
--- a/dom/xbl/nsXBLResourceLoader.h
+++ b/dom/xbl/nsXBLResourceLoader.h
@@ -34,17 +34,16 @@ public:
                               nsresult aStatus) MOZ_OVERRIDE;
 
   void LoadResources(bool* aResult);
   void AddResource(nsIAtom* aResourceType, const nsAString& aSrc);
   void AddResourceListener(nsIContent* aElement);
 
   nsXBLResourceLoader(nsXBLPrototypeBinding* aBinding,
                       nsXBLPrototypeResources* aResources);
-  virtual ~nsXBLResourceLoader();
 
   void NotifyBoundElements();
 
   nsresult Write(nsIObjectOutputStream* aStream);
 
 // MEMBER VARIABLES
   nsXBLPrototypeBinding* mBinding; // A pointer back to our binding.
   nsXBLPrototypeResources* mResources; // A pointer back to our resources
@@ -58,11 +57,14 @@ public:
   bool mLoadingResources;
   // We need mInLoadResourcesFunc because we do a mixture of sync and
   // async loads.
   bool mInLoadResourcesFunc;
   int16_t mPendingSheets; // The number of stylesheets that have yet to load.
 
   // Bound elements that are waiting on the stylesheets and scripts.
   nsCOMArray<nsIContent> mBoundElements;
+
+protected:
+  virtual ~nsXBLResourceLoader();
 };
 
 #endif
--- a/dom/xbl/nsXBLService.cpp
+++ b/dom/xbl/nsXBLService.cpp
@@ -163,22 +163,23 @@ public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSIDOMEVENTLISTENER
 
   nsXBLStreamListener(nsIDocument* aBoundDocument,
                       nsIXMLContentSink* aSink,
                       nsIDocument* aBindingDocument);
-  ~nsXBLStreamListener();
 
   void AddRequest(nsXBLBindingRequest* aRequest) { mBindingRequests.AppendElement(aRequest); }
   bool HasRequest(nsIURI* aURI, nsIContent* aBoundElement);
 
 private:
+  ~nsXBLStreamListener();
+
   nsCOMPtr<nsIStreamListener> mInner;
   nsAutoTArray<nsXBLBindingRequest*, 8> mBindingRequests;
 
   nsCOMPtr<nsIWeakReference> mBoundDocument;
   nsCOMPtr<nsIXMLContentSink> mSink; // Only set until OnStartRequest
   nsCOMPtr<nsIDocument> mBindingDocument; // Only set until OnStartRequest
 };
 
--- a/dom/xbl/nsXBLWindowKeyHandler.cpp
+++ b/dom/xbl/nsXBLWindowKeyHandler.cpp
@@ -55,16 +55,17 @@ public:
                       nsXBLPrototypeHandler** handler,
                       nsXBLPrototypeHandler** userHandler);
   void GetHandlers(nsXBLDocumentInfo* aInfo,
                    const nsACString& aRef,
                    nsXBLPrototypeHandler** aResult);
 
   nsXBLSpecialDocInfo() : mInitialized(false) {}
 
+protected:
   virtual ~nsXBLSpecialDocInfo() {}
 
 };
 
 const char nsXBLSpecialDocInfo::sHTMLBindingStr[] =
   "chrome://global/content/platformHTMLBindings.xml";
 
 NS_IMPL_ISUPPORTS(nsXBLSpecialDocInfo, nsIObserver)
--- a/dom/xbl/nsXBLWindowKeyHandler.h
+++ b/dom/xbl/nsXBLWindowKeyHandler.h
@@ -21,22 +21,23 @@ class Element;
 class EventTarget;
 }
 }
 
 class nsXBLWindowKeyHandler : public nsIDOMEventListener
 {
 public:
   nsXBLWindowKeyHandler(nsIDOMElement* aElement, mozilla::dom::EventTarget* aTarget);
-  virtual ~nsXBLWindowKeyHandler();
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMEVENTLISTENER
 
 protected:
+  virtual ~nsXBLWindowKeyHandler();
+
   nsresult WalkHandlers(nsIDOMKeyEvent* aKeyEvent, nsIAtom* aEventType);
 
   // walk the handlers, looking for one to handle the event
   bool WalkHandlersInternal(nsIDOMKeyEvent* aKeyEvent,
                             nsIAtom* aEventType,
                             nsXBLPrototypeHandler* aHandler,
                             bool aExecute);
 
--- a/dom/xslt/xpath/XPathEvaluator.cpp
+++ b/dom/xslt/xpath/XPathEvaluator.cpp
@@ -62,16 +62,20 @@ private:
 
 NS_IMPL_ISUPPORTS(XPathEvaluator, nsIDOMXPathEvaluator)
 
 XPathEvaluator::XPathEvaluator(nsIDocument* aDocument)
     : mDocument(do_GetWeakReference(aDocument))
 {
 }
 
+XPathEvaluator::~XPathEvaluator()
+{
+}
+
 NS_IMETHODIMP
 XPathEvaluator::CreateNSResolver(nsIDOMNode *aNodeResolver,
                                  nsIDOMXPathNSResolver **aResult)
 {
     NS_ENSURE_ARG(aNodeResolver);
     if (!nsContentUtils::CanCallerAccess(aNodeResolver))
         return NS_ERROR_DOM_SECURITY_ERR;
 
--- a/dom/xslt/xpath/XPathEvaluator.h
+++ b/dom/xslt/xpath/XPathEvaluator.h
@@ -23,16 +23,18 @@ namespace dom {
 class GlobalObject;
 class XPathResult;
 
 /**
  * A class for evaluating an XPath expression string
  */
 class XPathEvaluator MOZ_FINAL : public nsIDOMXPathEvaluator
 {
+    ~XPathEvaluator();
+
 public:
     XPathEvaluator(nsIDocument* aDocument = nullptr);
 
     NS_DECL_ISUPPORTS
 
     // nsIDOMXPathEvaluator interface
     NS_DECL_NSIDOMXPATHEVALUATOR
 
--- a/dom/xslt/xpath/XPathResult.h
+++ b/dom/xslt/xpath/XPathResult.h
@@ -43,20 +43,21 @@ namespace dom {
 
 /**
  * A class for evaluating an XPath expression string
  */
 class XPathResult MOZ_FINAL : public nsIXPathResult,
                               public nsStubMutationObserver,
                               public nsWrapperCache
 {
+    ~XPathResult();
+
 public:
     XPathResult(nsINode* aParent);
     XPathResult(const XPathResult &aResult);
-    ~XPathResult();
 
     enum {
         ANY_TYPE = 0U,
         NUMBER_TYPE = 1U,
         STRING_TYPE = 2U,
         BOOLEAN_TYPE = 3U,
         UNORDERED_NODE_ITERATOR_TYPE = 4U,
         ORDERED_NODE_ITERATOR_TYPE = 5U,
--- a/dom/xslt/xpath/nsXPathExpression.h
+++ b/dom/xslt/xpath/nsXPathExpression.h
@@ -34,16 +34,18 @@ public:
 
     // nsIDOMXPathExpression interface
     NS_DECL_NSIDOMXPATHEXPRESSION
 
     // nsIDOMNSXPathExpression interface
     NS_DECL_NSIDOMNSXPATHEXPRESSION
 
 private:
+    ~nsXPathExpression() {}
+
     nsAutoPtr<Expr> mExpression;
     nsRefPtr<txResultRecycler> mRecycler;
     nsCOMPtr<nsIDOMDocument> mDocument;
 
     class EvalContextImpl : public txIEvalContext
     {
     public:
         EvalContextImpl(const txXPathNode& aContextNode,
--- a/dom/xslt/xpath/nsXPathNSResolver.h
+++ b/dom/xslt/xpath/nsXPathNSResolver.h
@@ -12,16 +12,18 @@
 #include "nsCycleCollectionParticipant.h"
 #include "mozilla/Attributes.h"
 
 /**
  * A class for evaluating an XPath expression string
  */
 class nsXPathNSResolver MOZ_FINAL : public nsIDOMXPathNSResolver
 {
+    ~nsXPathNSResolver() {}
+
 public:
     nsXPathNSResolver(nsIDOMNode* aNode);
 
     // nsISupports interface
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(nsXPathNSResolver)
 
     // nsIDOMXPathNSResolver interface
--- a/dom/xslt/xpath/txXPCOMExtensionFunction.cpp
+++ b/dom/xslt/xpath/txXPCOMExtensionFunction.cpp
@@ -31,16 +31,18 @@ public:
     NS_DECL_TXIFUNCTIONEVALUATIONCONTEXT
 
     void ClearContext()
     {
         mContext = nullptr;
     }
 
 private:
+    ~txFunctionEvaluationContext() {}
+
     txIEvalContext *mContext;
     nsCOMPtr<nsISupports> mState;
 };
 
 txFunctionEvaluationContext::txFunctionEvaluationContext(txIEvalContext *aContext,
                                                          nsISupports *aState)
     : mContext(aContext),
       mState(aState)
--- a/dom/xslt/xpath/txXPathObjectAdaptor.h
+++ b/dom/xslt/xpath/txXPathObjectAdaptor.h
@@ -19,26 +19,27 @@ 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;
     }
 
 protected:
     txXPathObjectAdaptor() : mValue(nullptr)
     {
     }
 
+    virtual ~txXPathObjectAdaptor() {}
+
     nsRefPtr<txAExprResult> mValue;
 };
 
 #endif // txXPathObjectAdaptor_h__
--- a/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
+++ b/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
@@ -88,16 +88,18 @@ public:
     virtual nsISupports *GetTarget() { return nullptr; }
 
 private:
     nsRefPtr<txStylesheetCompiler> mCompiler;
     nsCOMPtr<nsIStreamListener> mListener;
     bool mCheckedForXML;
 
 protected:
+    ~txStylesheetSink() {}
+
     // This exists solely to suppress a warning from nsDerivedSafe
     txStylesheetSink();
 };
 
 txStylesheetSink::txStylesheetSink(txStylesheetCompiler* aCompiler,
                                    nsIParser* aParser)
     : mCompiler(aCompiler),
       mCheckedForXML(false)
--- a/dom/xslt/xslt/txMozillaXMLOutput.cpp
+++ b/dom/xslt/xslt/txMozillaXMLOutput.cpp
@@ -945,16 +945,20 @@ txMozillaXMLOutput::createHTMLElement(ns
 }
 
 txTransformNotifier::txTransformNotifier()
     : mPendingStylesheetCount(0),
       mInTransform(false)      
 {
 }
 
+txTransformNotifier::~txTransformNotifier()
+{
+}
+
 NS_IMPL_ISUPPORTS(txTransformNotifier,
                   nsIScriptLoaderObserver,
                   nsICSSLoaderObserver)
 
 NS_IMETHODIMP
 txTransformNotifier::ScriptAvailable(nsresult aResult, 
                                      nsIScriptElement *aElement, 
                                      bool aIsInline,
--- a/dom/xslt/xslt/txMozillaXMLOutput.h
+++ b/dom/xslt/xslt/txMozillaXMLOutput.h
@@ -45,16 +45,17 @@ public:
     void Init(nsITransformObserver* aObserver);
     nsresult AddScriptElement(nsIScriptElement* aElement);
     void AddPendingStylesheet();
     void OnTransformEnd(nsresult aResult = NS_OK);
     void OnTransformStart();
     nsresult SetOutputDocument(nsIDocument* aDocument);
 
 private:
+    ~txTransformNotifier();
     void SignalTransformEnd(nsresult aResult = NS_OK);
 
     nsCOMPtr<nsIDocument> mDocument;
     nsCOMPtr<nsITransformObserver> mObserver;
     nsCOMArray<nsIScriptElement> mScriptElements;
     uint32_t mPendingStylesheetCount;
     bool mInTransform;
 };
--- a/dom/xslt/xslt/txMozillaXSLTProcessor.h
+++ b/dom/xslt/xslt/txMozillaXSLTProcessor.h
@@ -44,21 +44,16 @@ class txMozillaXSLTProcessor MOZ_FINAL :
                                          public nsIJSNativeInitializer
 {
 public:
     /**
      * Creates a new txMozillaXSLTProcessor
      */
     txMozillaXSLTProcessor();
 
-    /**
-     * Default destructor for txMozillaXSLTProcessor
-     */
-    ~txMozillaXSLTProcessor();
-
     // nsISupports interface
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(txMozillaXSLTProcessor,
                                              nsIXSLTProcessor)
 
     // nsIXSLTProcessor interface
     NS_DECL_NSIXSLTPROCESSOR
 
@@ -107,16 +102,21 @@ public:
     // nsIJSNativeInitializer
     NS_IMETHODIMP Initialize(nsISupports* aOwner, JSContext *cx, JSObject *obj,
                              const JS::CallArgs& aArgs);
 
     static nsresult Startup();
     static void Shutdown();
 
 private:
+    /**
+     * Default destructor for txMozillaXSLTProcessor
+     */
+    ~txMozillaXSLTProcessor();
+
     nsresult DoTransform();
     void notifyError();
     nsresult ensureStylesheet();
 
     nsRefPtr<txStylesheet> mStylesheet;
     nsIDocument* mStylesheetDocument; // weak
     nsCOMPtr<nsIContent> mEmbeddedStylesheetRoot;