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 (places parts); r=mak

This commit is contained in:
Ehsan Akhgari 2012-06-19 23:58:39 -04:00
Родитель 58567c5e45
Коммит 4984997def
10 изменённых файлов: 42 добавлений и 31 удалений

Просмотреть файл

@ -23,6 +23,7 @@
#include "mozilla/Util.h"
#include "mozilla/Preferences.h"
#include "mozilla/Services.h"
#include "mozilla/Attributes.h"
// Time between corrupt database backups.
#define RECENT_BACKUP_TIME_MICROSEC (PRInt64)86400 * PR_USEC_PER_SEC // 24H
@ -208,7 +209,7 @@ SetJournalMode(nsCOMPtr<mozIStorageConnection>& aDBConn,
return JOURNAL_DELETE;
}
class BlockingConnectionCloseCallback : public mozIStorageCompletionCallback {
class BlockingConnectionCloseCallback MOZ_FINAL : public mozIStorageCompletionCallback {
bool mDone;
public:

Просмотреть файл

@ -11,6 +11,7 @@
#include "nsIObserver.h"
#include "mozilla/storage.h"
#include "mozilla/storage/StatementCache.h"
#include "mozilla/Attributes.h"
// This is the schema version. Update it at any schema change and add a
// corresponding migrateVxx method below.
@ -58,8 +59,8 @@ enum JournalMode {
, JOURNAL_WAL
};
class Database : public nsIObserver
, public nsSupportsWeakReference
class Database MOZ_FINAL : public nsIObserver
, public nsSupportsWeakReference
{
typedef mozilla::storage::StatementCache<mozIStorageStatement> StatementCache;
typedef mozilla::storage::StatementCache<mozIStorageAsyncStatement> AsyncStatementCache;

Просмотреть файл

@ -27,6 +27,7 @@
#include "mozilla/Util.h"
#include "nsContentUtils.h"
#include "nsIMemoryReporter.h"
#include "mozilla/Attributes.h"
// Initial size for the cache holding visited status observers.
#define VISIT_OBSERVERS_INITIAL_CACHE_SIZE 128
@ -1248,7 +1249,7 @@ private:
/**
* Adds download-specific annotations to a download page.
*/
class SetDownloadAnnotations : public mozIVisitInfoCallback
class SetDownloadAnnotations MOZ_FINAL : public mozIVisitInfoCallback
{
public:
NS_DECL_ISUPPORTS

Просмотреть файл

@ -12,6 +12,7 @@
*/
#include "mozIStorageFunction.h"
#include "mozilla/Attributes.h"
class mozIStorageConnection;
@ -52,7 +53,7 @@ namespace places {
* @param aSearchBehavior
* A bitfield dictating the search behavior.
*/
class MatchAutoCompleteFunction : public mozIStorageFunction
class MatchAutoCompleteFunction MOZ_FINAL : public mozIStorageFunction
{
public:
NS_DECL_ISUPPORTS
@ -189,7 +190,7 @@ private:
* @param [optional] isBookmarked
* Whether the page is bookmarked. Default is false.
*/
class CalculateFrecencyFunction : public mozIStorageFunction
class CalculateFrecencyFunction MOZ_FINAL : public mozIStorageFunction
{
public:
NS_DECL_ISUPPORTS
@ -210,7 +211,7 @@ public:
*
* @return a guid for the item.
*/
class GenerateGUIDFunction : public mozIStorageFunction
class GenerateGUIDFunction MOZ_FINAL : public mozIStorageFunction
{
public:
NS_DECL_ISUPPORTS
@ -233,7 +234,7 @@ public:
*
* @return the unreversed host of the page.
*/
class GetUnreversedHostFunction : public mozIStorageFunction
class GetUnreversedHostFunction MOZ_FINAL : public mozIStorageFunction
{
public:
NS_DECL_ISUPPORTS
@ -261,7 +262,7 @@ public:
* @return
* The same URL, with redundant parts removed.
*/
class FixupURLFunction : public mozIStorageFunction
class FixupURLFunction MOZ_FINAL : public mozIStorageFunction
{
public:
NS_DECL_ISUPPORTS

Просмотреть файл

@ -12,12 +12,13 @@
#include "nsIURI.h"
#include "nsString.h"
#include "nsWeakReference.h"
#include "mozilla/Attributes.h"
// {e8b8bdb7-c96c-4d82-9c6f-2b3c585ec7ea}
#define NS_ANNOPROTOCOLHANDLER_CID \
{ 0xe8b8bdb7, 0xc96c, 0x4d82, { 0x9c, 0x6f, 0x2b, 0x3c, 0x58, 0x5e, 0xc7, 0xea } }
class nsAnnoProtocolHandler : public nsIProtocolHandler, public nsSupportsWeakReference
class nsAnnoProtocolHandler MOZ_FINAL : public nsIProtocolHandler, public nsSupportsWeakReference
{
public:
nsAnnoProtocolHandler() {}

Просмотреть файл

@ -15,10 +15,11 @@
#include "nsToolkitCompsCID.h"
#include "Database.h"
#include "nsString.h"
#include "mozilla/Attributes.h"
class nsAnnotationService : public nsIAnnotationService
, public nsIObserver
, public nsSupportsWeakReference
class nsAnnotationService MOZ_FINAL : public nsIAnnotationService
, public nsIObserver
, public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS

Просмотреть файл

@ -19,6 +19,7 @@
#include "nsITimer.h"
#include "Database.h"
#include "mozilla/storage.h"
#include "mozilla/Attributes.h"
#include "AsyncFaviconHelpers.h"
@ -50,9 +51,9 @@ public:
PRTime created;
};
class nsFaviconService : public nsIFaviconService
, public mozIAsyncFavicons
, public nsITimerCallback
class nsFaviconService MOZ_FINAL : public nsIFaviconService
, public mozIAsyncFavicons
, public nsITimerCallback
{
public:
nsFaviconService();

Просмотреть файл

@ -14,6 +14,7 @@
#include "nsCategoryCache.h"
#include "nsTHashtable.h"
#include "nsWeakReference.h"
#include "mozilla/Attributes.h"
class nsNavBookmarks;
class nsIOutputStream;
@ -85,11 +86,11 @@ namespace places {
} // namespace places
} // namespace mozilla
class nsNavBookmarks : public nsINavBookmarksService
, public nsINavHistoryObserver
, public nsIAnnotationObserver
, public nsIObserver
, public nsSupportsWeakReference
class nsNavBookmarks MOZ_FINAL : public nsINavBookmarksService
, public nsINavHistoryObserver
, public nsIAnnotationObserver
, public nsIObserver
, public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS
@ -367,7 +368,7 @@ private:
static const PRInt32 kGetChildrenIndex_FolderTitle;
static const PRInt32 kGetChildrenIndex_Guid;
class RemoveFolderTransaction : public nsITransaction {
class RemoveFolderTransaction MOZ_FINAL : public nsITransaction {
public:
RemoveFolderTransaction(PRInt64 aID) : mID(aID) {}

Просмотреть файл

@ -29,6 +29,7 @@
#include "nsNavHistoryResult.h"
#include "nsNavHistoryQuery.h"
#include "Database.h"
#include "mozilla/Attributes.h"
#define QUERYUPDATE_TIME 0
#define QUERYUPDATE_SIMPLE 1
@ -67,13 +68,13 @@ class nsIAutoCompleteController;
// nsNavHistory
class nsNavHistory : public nsSupportsWeakReference
, public nsINavHistoryService
, public nsIObserver
, public nsIBrowserHistory
, public nsPIPlacesDatabase
, public nsPIPlacesHistoryListenersNotifier
, public mozIStorageVacuumParticipant
class nsNavHistory MOZ_FINAL : public nsSupportsWeakReference
, public nsINavHistoryService
, public nsIObserver
, public nsIBrowserHistory
, public nsPIPlacesDatabase
, public nsPIPlacesHistoryListenersNotifier
, public mozIStorageVacuumParticipant
{
friend class PlacesSQLQueryBuilder;

Просмотреть файл

@ -17,10 +17,12 @@
// This class encapsulates the parameters for basic history queries for
// building UI, trees, lists, etc.
#include "mozilla/Attributes.h"
#define NS_NAVHISTORYQUERY_IID \
{ 0xb10185e0, 0x86eb, 0x4612, { 0x95, 0x7c, 0x09, 0x34, 0xf2, 0xb1, 0xce, 0xd7 } }
class nsNavHistoryQuery : public nsINavHistoryQuery
class nsNavHistoryQuery MOZ_FINAL : public nsINavHistoryQuery
{
public:
nsNavHistoryQuery();
@ -97,7 +99,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsNavHistoryQuery, NS_NAVHISTORYQUERY_IID)
#define NS_NAVHISTORYQUERYOPTIONS_IID \
{0x95f8ba3b, 0xd681, 0x4d89, {0xab, 0xd1, 0xfd, 0xae, 0xf2, 0xa3, 0xde, 0x18}}
class nsNavHistoryQueryOptions : public nsINavHistoryQueryOptions
class nsNavHistoryQueryOptions MOZ_FINAL : public nsINavHistoryQueryOptions
{
public:
nsNavHistoryQueryOptions()