Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Commit

Permalink
Bug 758992 - Make the classes which use the XPCOM nsISupports impleme…
Browse files Browse the repository at this point in the history
…ntation macros final, to avoid the warning about deleting using a pointer to a base class with virtual functions and no virtual dtor (uriloader parts); r=bzbarsky
  • Loading branch information
ehsan committed Jun 13, 2012
1 parent f5afd2c commit 651a275
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 30 deletions.
3 changes: 2 additions & 1 deletion uriloader/base/nsURILoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "nsIInterfaceRequestorUtils.h"
#include "nsString.h"
#include "nsIWeakReference.h"
#include "mozilla/Attributes.h"

#ifdef MOZ_LOGGING
// Uncomment the next line to force logging on in release builds
Expand All @@ -23,7 +24,7 @@

class nsDocumentOpenInfo;

class nsURILoader : public nsIURILoader
class nsURILoader MOZ_FINAL : public nsIURILoader
{
public:
NS_DECL_NSIURILOADER
Expand Down
7 changes: 4 additions & 3 deletions uriloader/exthandler/nsExternalHelperAppService.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "nsWeakReference.h"
#include "nsIPrompt.h"
#include "nsAutoPtr.h"
#include "mozilla/Attributes.h"

class nsExternalAppHandler;
class nsIMIMEInfo;
Expand Down Expand Up @@ -205,9 +206,9 @@ class nsExternalHelperAppService
* stored the data into. We create a handler every time we have to process
* data using a helper app.
*/
class nsExternalAppHandler : public nsIStreamListener,
public nsIHelperAppLauncher,
public nsITimerCallback
class nsExternalAppHandler MOZ_FINAL : public nsIStreamListener,
public nsIHelperAppLauncher,
public nsITimerCallback
{
public:
NS_DECL_ISUPPORTS
Expand Down
3 changes: 2 additions & 1 deletion uriloader/exthandler/nsExternalProtocolHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
#include "nsString.h"
#include "nsWeakReference.h"
#include "nsIExternalProtocolService.h"
#include "mozilla/Attributes.h"

class nsIURI;

// protocol handlers need to support weak references if we want the netlib nsIOService to cache them.
class nsExternalProtocolHandler : public nsIExternalProtocolHandler, public nsSupportsWeakReference
class nsExternalProtocolHandler MOZ_FINAL : public nsIExternalProtocolHandler, public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS
Expand Down
7 changes: 4 additions & 3 deletions uriloader/prefetch/OfflineCacheUpdateGlue.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "nsAutoPtr.h"
#include "nsString.h"
#include "nsWeakReference.h"
#include "mozilla/Attributes.h"

class nsOfflineCacheUpdate;

Expand All @@ -34,9 +35,9 @@ namespace docshell {
NS_SCRIPTABLE NS_IMETHOD RemoveObserver(nsIOfflineCacheUpdateObserver *aObserver) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveObserver(aObserver); } \
NS_SCRIPTABLE NS_IMETHOD GetByteProgress(PRUint64 * _result) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetByteProgress(_result); }

class OfflineCacheUpdateGlue : public nsSupportsWeakReference
, public nsIOfflineCacheUpdate
, public nsIOfflineCacheUpdateObserver
class OfflineCacheUpdateGlue MOZ_FINAL : public nsSupportsWeakReference
, public nsIOfflineCacheUpdate
, public nsIOfflineCacheUpdateObserver
{
public:
NS_DECL_ISUPPORTS
Expand Down
7 changes: 4 additions & 3 deletions uriloader/prefetch/nsOfflineCacheUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "prlog.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "mozilla/Preferences.h"
#include "mozilla/Attributes.h"

#include "nsXULAppAPI.h"

Expand Down Expand Up @@ -88,9 +89,9 @@ DropReferenceFromURL(nsIURI * aURI)
// nsManifestCheck
//-----------------------------------------------------------------------------

class nsManifestCheck : public nsIStreamListener
, public nsIChannelEventSink
, public nsIInterfaceRequestor
class nsManifestCheck MOZ_FINAL : public nsIStreamListener
, public nsIChannelEventSink
, public nsIInterfaceRequestor
{
public:
nsManifestCheck(nsOfflineCacheUpdate *aUpdate,
Expand Down
17 changes: 9 additions & 8 deletions uriloader/prefetch/nsOfflineCacheUpdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "nsTArray.h"
#include "nsWeakReference.h"
#include "nsICryptoHash.h"
#include "mozilla/Attributes.h"

class nsOfflineCacheUpdate;

Expand Down Expand Up @@ -182,10 +183,10 @@ class nsOfflineCacheUpdateOwner
virtual nsresult UpdateFinished(nsOfflineCacheUpdate *aUpdate) = 0;
};

class nsOfflineCacheUpdate : public nsIOfflineCacheUpdate
, public nsIOfflineCacheUpdateObserver
, public nsIRunnable
, public nsOfflineCacheUpdateOwner
class nsOfflineCacheUpdate MOZ_FINAL : public nsIOfflineCacheUpdate
, public nsIOfflineCacheUpdateObserver
, public nsIRunnable
, public nsOfflineCacheUpdateOwner
{
public:
NS_DECL_ISUPPORTS
Expand Down Expand Up @@ -293,10 +294,10 @@ class nsOfflineCacheUpdate : public nsIOfflineCacheUpdate
PRUint64 mByteProgress;
};

class nsOfflineCacheUpdateService : public nsIOfflineCacheUpdateService
, public nsIObserver
, public nsOfflineCacheUpdateOwner
, public nsSupportsWeakReference
class nsOfflineCacheUpdateService MOZ_FINAL : public nsIOfflineCacheUpdateService
, public nsIObserver
, public nsOfflineCacheUpdateOwner
, public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS
Expand Down
5 changes: 3 additions & 2 deletions uriloader/prefetch/nsOfflineCacheUpdateService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "prlog.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "mozilla/Preferences.h"
#include "mozilla/Attributes.h"

using namespace mozilla;

Expand Down Expand Up @@ -78,8 +79,8 @@ class AutoFreeArray {
// nsOfflineCachePendingUpdate
//-----------------------------------------------------------------------------

class nsOfflineCachePendingUpdate : public nsIWebProgressListener
, public nsSupportsWeakReference
class nsOfflineCachePendingUpdate MOZ_FINAL : public nsIWebProgressListener
, public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS
Expand Down
3 changes: 2 additions & 1 deletion uriloader/prefetch/nsPrefetchService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "plstr.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "mozilla/Preferences.h"
#include "mozilla/Attributes.h"

using namespace mozilla;

Expand Down Expand Up @@ -66,7 +67,7 @@ PRTimeToSeconds(PRTime t_usec)
//-----------------------------------------------------------------------------
// nsPrefetchQueueEnumerator
//-----------------------------------------------------------------------------
class nsPrefetchQueueEnumerator : public nsISimpleEnumerator
class nsPrefetchQueueEnumerator MOZ_FINAL : public nsISimpleEnumerator
{
public:
NS_DECL_ISUPPORTS
Expand Down
17 changes: 9 additions & 8 deletions uriloader/prefetch/nsPrefetchService.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "nsWeakReference.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "mozilla/Attributes.h"

class nsPrefetchService;
class nsPrefetchListener;
Expand All @@ -27,10 +28,10 @@ class nsPrefetchNode;
// nsPrefetchService
//-----------------------------------------------------------------------------

class nsPrefetchService : public nsIPrefetchService
, public nsIWebProgressListener
, public nsIObserver
, public nsSupportsWeakReference
class nsPrefetchService MOZ_FINAL : public nsIPrefetchService
, public nsIWebProgressListener
, public nsIObserver
, public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS
Expand Down Expand Up @@ -81,10 +82,10 @@ class nsPrefetchService : public nsIPrefetchService
// nsPrefetchNode
//-----------------------------------------------------------------------------

class nsPrefetchNode : public nsIDOMLoadStatus
, public nsIStreamListener
, public nsIInterfaceRequestor
, public nsIChannelEventSink
class nsPrefetchNode MOZ_FINAL : public nsIDOMLoadStatus
, public nsIStreamListener
, public nsIInterfaceRequestor
, public nsIChannelEventSink
{
public:
NS_DECL_ISUPPORTS
Expand Down

0 comments on commit 651a275

Please sign in to comment.