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

This commit is contained in:
Ehsan Akhgari 2012-06-12 23:35:10 -04:00
parent 0fef409822
commit ce3833d9c1
15 changed files with 38 additions and 23 deletions

View File

@ -12,11 +12,12 @@
#include "mozIStorageStatementCallback.h"
#include "mozIStorageVacuumParticipant.h"
#include "nsCategoryCache.h"
#include "mozilla/Attributes.h"
namespace mozilla {
namespace storage {
class VacuumManager : public nsIObserver
class VacuumManager MOZ_FINAL : public nsIObserver
{
public:
NS_DECL_ISUPPORTS

View File

@ -8,13 +8,14 @@
#define mozStorageArgValueArray_h
#include "mozIStorageValueArray.h"
#include "mozilla/Attributes.h"
#include "sqlite3.h"
namespace mozilla {
namespace storage {
class ArgValueArray : public mozIStorageValueArray
class ArgValueArray MOZ_FINAL : public mozIStorageValueArray
{
public:
ArgValueArray(PRInt32 aArgc, sqlite3_value **aArgv);

View File

@ -16,6 +16,7 @@
#include "mozStorageStatementData.h"
#include "mozIStorageAsyncStatement.h"
#include "StorageBaseStatementInternal.h"
#include "mozilla/Attributes.h"
class nsIXPConnectJSObjectHolder;
struct sqlite3_stmt;
@ -26,8 +27,8 @@ namespace storage {
class AsyncStatementJSHelper;
class Connection;
class AsyncStatement : public mozIStorageAsyncStatement
, public StorageBaseStatementInternal
class AsyncStatement MOZ_FINAL : public mozIStorageAsyncStatement
, public StorageBaseStatementInternal
{
public:
NS_DECL_ISUPPORTS

View File

@ -13,6 +13,7 @@
#include "nsThreadUtils.h"
#include "mozilla/Mutex.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/Attributes.h"
#include "SQLiteMutex.h"
#include "mozIStoragePendingStatement.h"
@ -28,8 +29,8 @@ class Connection;
class ResultSet;
class StatementData;
class AsyncExecuteStatements : public nsIRunnable
, public mozIStoragePendingStatement
class AsyncExecuteStatements MOZ_FINAL : public nsIRunnable
, public mozIStoragePendingStatement
{
public:
NS_DECL_ISUPPORTS

View File

@ -9,6 +9,7 @@
#include "mozIStorageStatementParams.h"
#include "nsIXPCScriptable.h"
#include "mozilla/Attributes.h"
class mozIStorageAsyncStatement;
@ -21,8 +22,8 @@ class AsyncStatement;
* Since mozIStorageStatementParams is just a tagging interface we do not have
* an async variant.
*/
class AsyncStatementParams : public mozIStorageStatementParams
, public nsIXPCScriptable
class AsyncStatementParams MOZ_FINAL : public mozIStorageStatementParams
, public nsIXPCScriptable
{
public:
AsyncStatementParams(AsyncStatement *aStatement);

View File

@ -9,6 +9,7 @@
#include "nsAutoPtr.h"
#include "nsTArray.h"
#include "mozilla/Attributes.h"
#include "mozIStorageBindingParamsArray.h"
@ -17,7 +18,7 @@ namespace storage {
class StorageBaseStatementInternal;
class BindingParamsArray : public mozIStorageBindingParamsArray
class BindingParamsArray MOZ_FINAL : public mozIStorageBindingParamsArray
{
typedef nsTArray< nsCOMPtr<mozIStorageBindingParams> > array_type;

View File

@ -15,6 +15,7 @@
#include "mozilla/Telemetry.h"
#include "mozilla/Mutex.h"
#include "mozilla/CondVar.h"
#include "mozilla/Attributes.h"
#include "mozIStorageAggregateFunction.h"
#include "mozIStorageCompletionCallback.h"
@ -379,7 +380,7 @@ private:
////////////////////////////////////////////////////////////////////////////////
//// Memory Reporting
class StorageMemoryReporter : public nsIMemoryReporter
class StorageMemoryReporter MOZ_FINAL : public nsIMemoryReporter
{
public:
NS_DECL_ISUPPORTS

View File

@ -19,6 +19,7 @@
#include "mozStorageService.h"
#include "nsIMutableArray.h"
#include "mozilla/Attributes.h"
#include "sqlite3.h"
@ -30,8 +31,8 @@ class nsIThread;
namespace mozilla {
namespace storage {
class Connection : public mozIStorageConnection
, public nsIInterfaceRequestor
class Connection MOZ_FINAL : public mozIStorageConnection
, public nsIInterfaceRequestor
{
public:
NS_DECL_ISUPPORTS

View File

@ -9,11 +9,12 @@
#include "mozIStorageError.h"
#include "nsString.h"
#include "mozilla/Attributes.h"
namespace mozilla {
namespace storage {
class Error : public mozIStorageError
class Error MOZ_FINAL : public mozIStorageError
{
public:
NS_DECL_ISUPPORTS

View File

@ -9,12 +9,13 @@
#include "mozIStorageResultSet.h"
#include "nsCOMArray.h"
#include "mozilla/Attributes.h"
class mozIStorageRow;
namespace mozilla {
namespace storage {
class ResultSet : public mozIStorageResultSet
class ResultSet MOZ_FINAL : public mozIStorageResultSet
{
public:
NS_DECL_ISUPPORTS

View File

@ -10,13 +10,14 @@
#include "mozIStorageRow.h"
#include "nsCOMArray.h"
#include "nsDataHashtable.h"
#include "mozilla/Attributes.h"
class nsIVariant;
struct sqlite3_stmt;
namespace mozilla {
namespace storage {
class Row : public mozIStorageRow
class Row MOZ_FINAL : public mozIStorageRow
{
public:
NS_DECL_ISUPPORTS

View File

@ -19,6 +19,7 @@
#include "nsIObserverService.h"
#include "mozilla/Services.h"
#include "mozilla/Preferences.h"
#include "mozilla/Attributes.h"
#include "sqlite3.h"
#include "test_quota.h"
@ -119,7 +120,7 @@ NS_MEMORY_REPORTER_IMPLEMENT(StorageSQLite,
GetStorageSQLiteMemoryUsed,
"Memory used by SQLite.")
class StorageSQLiteMultiReporter : public nsIMemoryMultiReporter
class StorageSQLiteMultiReporter MOZ_FINAL : public nsIMemoryMultiReporter
{
private:
Service *mService; // a weakref because Service contains a strongref to this

View File

@ -17,6 +17,7 @@
#include "mozIStorageStatement.h"
#include "mozIStorageValueArray.h"
#include "StorageBaseStatementInternal.h"
#include "mozilla/Attributes.h"
class nsIXPConnectJSObjectHolder;
struct sqlite3_stmt;
@ -26,9 +27,9 @@ namespace storage {
class StatementJSHelper;
class Connection;
class Statement : public mozIStorageStatement
, public mozIStorageValueArray
, public StorageBaseStatementInternal
class Statement MOZ_FINAL : public mozIStorageStatement
, public mozIStorageValueArray
, public StorageBaseStatementInternal
{
public:
NS_DECL_ISUPPORTS

View File

@ -9,6 +9,7 @@
#include "mozIStorageStatementParams.h"
#include "nsIXPCScriptable.h"
#include "mozilla/Attributes.h"
class mozIStorageStatement;
@ -17,8 +18,8 @@ namespace storage {
class Statement;
class StatementParams : public mozIStorageStatementParams
, public nsIXPCScriptable
class StatementParams MOZ_FINAL : public mozIStorageStatementParams
, public nsIXPCScriptable
{
public:
StatementParams(mozIStorageStatement *aStatement);

View File

@ -9,14 +9,15 @@
#include "mozIStorageStatementRow.h"
#include "nsIXPCScriptable.h"
#include "mozilla/Attributes.h"
namespace mozilla {
namespace storage {
class Statement;
class StatementRow : public mozIStorageStatementRow
, public nsIXPCScriptable
class StatementRow MOZ_FINAL : public mozIStorageStatementRow
, public nsIXPCScriptable
{
public:
NS_DECL_ISUPPORTS