From 8e4039f7a3cae7c71238e4d0b63abaa8e79e36fd Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 19 Jun 2012 23:27:32 -0400 Subject: [PATCH] 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 (toolkit parts); r=jrmuizel --- toolkit/components/alerts/mac/nsAlertsImageLoadListener.h | 3 ++- toolkit/components/places/tests/cpp/places_test_harness.h | 5 +++-- toolkit/components/places/tests/cpp/test_IHistory.cpp | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/toolkit/components/alerts/mac/nsAlertsImageLoadListener.h b/toolkit/components/alerts/mac/nsAlertsImageLoadListener.h index 196d988ba92..1e65f828f42 100644 --- a/toolkit/components/alerts/mac/nsAlertsImageLoadListener.h +++ b/toolkit/components/alerts/mac/nsAlertsImageLoadListener.h @@ -9,8 +9,9 @@ #include "nsIStreamLoader.h" #include "nsStringAPI.h" +#include "mozilla/Attributes.h" -class nsAlertsImageLoadListener : public nsIStreamLoaderObserver +class nsAlertsImageLoadListener MOZ_FINAL : public nsIStreamLoaderObserver { public: nsAlertsImageLoadListener(const nsAString &aName, diff --git a/toolkit/components/places/tests/cpp/places_test_harness.h b/toolkit/components/places/tests/cpp/places_test_harness.h index fb9e36c7c3e..efb01fba39d 100644 --- a/toolkit/components/places/tests/cpp/places_test_harness.h +++ b/toolkit/components/places/tests/cpp/places_test_harness.h @@ -19,6 +19,7 @@ #include "nsPIPlacesDatabase.h" #include "nsIObserver.h" #include "prinrval.h" +#include "mozilla/Attributes.h" #define TOPIC_FRECENCY_UPDATED "places-frecency-updated" #define WAITFORTOPIC_TIMEOUT_SECONDS 5 @@ -95,7 +96,7 @@ void do_test_finished(); /** * Spins current thread until a topic is received. */ -class WaitForTopicSpinner : public nsIObserver +class WaitForTopicSpinner MOZ_FINAL : public nsIObserver { public: NS_DECL_ISUPPORTS @@ -299,7 +300,7 @@ do_get_lastVisit(PRInt64 placeId, VisitRecord& result) static const char TOPIC_PROFILE_CHANGE[] = "profile-before-change"; static const char TOPIC_PLACES_CONNECTION_CLOSED[] = "places-connection-closed"; -class WaitForConnectionClosed : public nsIObserver +class WaitForConnectionClosed MOZ_FINAL : public nsIObserver { nsRefPtr mSpinner; public: diff --git a/toolkit/components/places/tests/cpp/test_IHistory.cpp b/toolkit/components/places/tests/cpp/test_IHistory.cpp index df65b369a09..627fbfd63f3 100644 --- a/toolkit/components/places/tests/cpp/test_IHistory.cpp +++ b/toolkit/components/places/tests/cpp/test_IHistory.cpp @@ -8,6 +8,7 @@ #include "nsIBrowserHistory.h" #include "nsIPrefService.h" #include "nsIPrefBranch.h" +#include "mozilla/Attributes.h" #include "mock_Link.h" using namespace mozilla::dom; @@ -46,7 +47,7 @@ new_test_uri() return testURI.forget(); } -class VisitURIObserver : public nsIObserver +class VisitURIObserver MOZ_FINAL : public nsIObserver { public: NS_DECL_ISUPPORTS @@ -282,7 +283,7 @@ namespace test_observer_topic_dispatched_helpers { #define URI_VISITED "visited" #define URI_NOT_VISITED "not visited" #define URI_VISITED_RESOLUTION_TOPIC "visited-status-resolution" - class statusObserver : public nsIObserver + class statusObserver MOZ_FINAL : public nsIObserver { public: NS_DECL_ISUPPORTS