Bug 758992 - Make the classes which use the XPCOM nsISupports implementation macros final, to avoid the warning about deleting using a pointer to a base class with virtual functions and no virtual dtor (browser parts); r=jrmuizel
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 19 Jun 2012 23:24:24 -0400
changeset 98438 76e0145803ba97a87db7b0f0c9e918efe0f7240b
parent 98437 b84af5d0c13c73da78aa54439326589e9d3ab3dd
child 98439 c5ca1456419a44b862906d947cbf9a761b57b291
push idunknown
push userunknown
push dateunknown
reviewersjrmuizel
bugs758992
milestone16.0a1
Bug 758992 - Make the classes which use the XPCOM nsISupports implementation macros final, to avoid the warning about deleting using a pointer to a base class with virtual functions and no virtual dtor (browser parts); r=jrmuizel
browser/components/dirprovider/DirectoryProvider.h
browser/components/feeds/src/nsFeedSniffer.h
browser/components/privatebrowsing/src/nsPrivateBrowsingServiceWrapper.h
--- a/browser/components/dirprovider/DirectoryProvider.h
+++ b/browser/components/dirprovider/DirectoryProvider.h
@@ -4,32 +4,33 @@
 
 #ifndef DirectoryProvider_h__
 #define DirectoryProvider_h__
 
 #include "nsIDirectoryService.h"
 #include "nsComponentManagerUtils.h"
 #include "nsISimpleEnumerator.h"
 #include "nsIFile.h"
+#include "mozilla/Attributes.h"
 
 #define NS_BROWSERDIRECTORYPROVIDER_CONTRACTID \
   "@mozilla.org/browser/directory-provider;1"
 
 namespace mozilla {
 namespace browser {
 
-class DirectoryProvider : public nsIDirectoryServiceProvider2
+class DirectoryProvider MOZ_FINAL : public nsIDirectoryServiceProvider2
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDIRECTORYSERVICEPROVIDER
   NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
 
 private:
-  class AppendingEnumerator : public nsISimpleEnumerator
+  class AppendingEnumerator MOZ_FINAL : public nsISimpleEnumerator
   {
   public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSISIMPLEENUMERATOR
 
     AppendingEnumerator(nsISimpleEnumerator* aBase,
                         char const *const *aAppendList);
 
--- a/browser/components/feeds/src/nsFeedSniffer.h
+++ b/browser/components/feeds/src/nsFeedSniffer.h
@@ -2,18 +2,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "nsIContentSniffer.h"
 #include "nsIStreamListener.h"
 #include "nsStringAPI.h"
+#include "mozilla/Attributes.h"
 
-class nsFeedSniffer : public nsIContentSniffer, nsIStreamListener
+class nsFeedSniffer MOZ_FINAL : public nsIContentSniffer,
+                                       nsIStreamListener
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSICONTENTSNIFFER
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSISTREAMLISTENER
 
   static NS_METHOD AppendSegmentToString(nsIInputStream* inputStream,
--- a/browser/components/privatebrowsing/src/nsPrivateBrowsingServiceWrapper.h
+++ b/browser/components/privatebrowsing/src/nsPrivateBrowsingServiceWrapper.h
@@ -1,20 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsCOMPtr.h"
 #include "nsIPrivateBrowsingService.h"
 #include "nsIObserver.h"
+#include "mozilla/Attributes.h"
 
 class nsIJSContextStack;
 
-class nsPrivateBrowsingServiceWrapper : public nsIPrivateBrowsingService,
-                                        public nsIObserver
+class nsPrivateBrowsingServiceWrapper MOZ_FINAL : public nsIPrivateBrowsingService,
+                                                  public nsIObserver
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIPRIVATEBROWSINGSERVICE
   NS_DECL_NSIOBSERVER
 
   nsresult Init();