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
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 12 Jun 2012 23:35:10 -0400
changeset 101432 8b34c182b276f12ed95b0fb74a2b40cbab2c8e75
parent 101431 ed4548cac45fe74300ef7aa9a20be9e67b4679cc
child 101433 2da255c1aeb9568f3fb7fe30e5661c03b103542f
push id1316
push userakeybl@mozilla.com
push dateMon, 27 Aug 2012 22:37:00 +0000
treeherdermozilla-beta@db4b09302ee2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs758992
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
storage/src/VacuumManager.h
storage/src/mozStorageArgValueArray.h
storage/src/mozStorageAsyncStatement.h
storage/src/mozStorageAsyncStatementExecution.h
storage/src/mozStorageAsyncStatementParams.h
storage/src/mozStorageBindingParamsArray.h
storage/src/mozStorageConnection.cpp
storage/src/mozStorageConnection.h
storage/src/mozStorageError.h
storage/src/mozStorageResultSet.h
storage/src/mozStorageRow.h
storage/src/mozStorageService.cpp
storage/src/mozStorageStatement.h
storage/src/mozStorageStatementParams.h
storage/src/mozStorageStatementRow.h
--- a/storage/src/VacuumManager.h
+++ b/storage/src/VacuumManager.h
@@ -7,21 +7,22 @@
 #ifndef mozilla_storage_VacuumManager_h__
 #define mozilla_storage_VacuumManager_h__
 
 #include "nsCOMPtr.h"
 #include "nsIObserver.h"
 #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
   NS_DECL_NSIOBSERVER
 
   VacuumManager();
 
   /**
--- a/storage/src/mozStorageArgValueArray.h
+++ b/storage/src/mozStorageArgValueArray.h
@@ -3,23 +3,24 @@
  * 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/. */
 
 #ifndef mozStorageArgValueArray_h
 #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);
 
   NS_DECL_ISUPPORTS
   NS_DECL_MOZISTORAGEVALUEARRAY
 
 private:
--- a/storage/src/mozStorageAsyncStatement.h
+++ b/storage/src/mozStorageAsyncStatement.h
@@ -11,28 +11,29 @@
 #include "nsString.h"
 
 #include "nsTArray.h"
 
 #include "mozStorageBindingParamsArray.h"
 #include "mozStorageStatementData.h"
 #include "mozIStorageAsyncStatement.h"
 #include "StorageBaseStatementInternal.h"
+#include "mozilla/Attributes.h"
 
 class nsIXPConnectJSObjectHolder;
 struct sqlite3_stmt;
 
 namespace mozilla {
 namespace storage {
 
 class AsyncStatementJSHelper;
 class Connection;
 
-class AsyncStatement : public mozIStorageAsyncStatement
-                     , public StorageBaseStatementInternal
+class AsyncStatement MOZ_FINAL : public mozIStorageAsyncStatement
+                               , public StorageBaseStatementInternal
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_MOZISTORAGEASYNCSTATEMENT
   NS_DECL_MOZISTORAGEBASESTATEMENT
   NS_DECL_MOZISTORAGEBINDINGPARAMS
   NS_DECL_STORAGEBASESTATEMENTINTERNAL
 
--- a/storage/src/mozStorageAsyncStatementExecution.h
+++ b/storage/src/mozStorageAsyncStatementExecution.h
@@ -8,33 +8,34 @@
 #define mozStorageAsyncStatementExecution_h
 
 #include "nscore.h"
 #include "nsTArray.h"
 #include "nsAutoPtr.h"
 #include "nsThreadUtils.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/TimeStamp.h"
+#include "mozilla/Attributes.h"
 
 #include "SQLiteMutex.h"
 #include "mozIStoragePendingStatement.h"
 #include "mozIStorageStatementCallback.h"
 
 struct sqlite3_stmt;
 class mozStorageTransaction;
 
 namespace mozilla {
 namespace storage {
 
 class Connection;
 class ResultSet;
 class StatementData;
 
-class AsyncExecuteStatements : public nsIRunnable
-                             , public mozIStoragePendingStatement
+class AsyncExecuteStatements MOZ_FINAL : public nsIRunnable
+                                       , public mozIStoragePendingStatement
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIRUNNABLE
   NS_DECL_MOZISTORAGEPENDINGSTATEMENT
 
   /**
    * Describes the state of execution.
--- a/storage/src/mozStorageAsyncStatementParams.h
+++ b/storage/src/mozStorageAsyncStatementParams.h
@@ -4,30 +4,31 @@
  * 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/. */
 
 #ifndef mozilla_storage_mozStorageAsyncStatementParams_h_
 #define mozilla_storage_mozStorageAsyncStatementParams_h_
 
 #include "mozIStorageStatementParams.h"
 #include "nsIXPCScriptable.h"
+#include "mozilla/Attributes.h"
 
 class mozIStorageAsyncStatement;
 
 namespace mozilla {
 namespace storage {
 
 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);
 
   // interfaces
   NS_DECL_ISUPPORTS
   NS_DECL_MOZISTORAGESTATEMENTPARAMS
   NS_DECL_NSIXPCSCRIPTABLE
--- a/storage/src/mozStorageBindingParamsArray.h
+++ b/storage/src/mozStorageBindingParamsArray.h
@@ -4,25 +4,26 @@
  * 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/. */
 
 #ifndef mozStorageBindingParamsArray_h
 #define mozStorageBindingParamsArray_h
 
 #include "nsAutoPtr.h"
 #include "nsTArray.h"
+#include "mozilla/Attributes.h"
 
 #include "mozIStorageBindingParamsArray.h"
 
 namespace mozilla {
 namespace storage {
 
 class StorageBaseStatementInternal;
 
-class BindingParamsArray : public mozIStorageBindingParamsArray
+class BindingParamsArray MOZ_FINAL : public mozIStorageBindingParamsArray
 {
   typedef nsTArray< nsCOMPtr<mozIStorageBindingParams> > array_type;
 
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_MOZISTORAGEBINDINGPARAMSARRAY
 
   BindingParamsArray(StorageBaseStatementInternal *aOwningStatement);
--- a/storage/src/mozStorageConnection.cpp
+++ b/storage/src/mozStorageConnection.cpp
@@ -10,16 +10,17 @@
 #include "nsIMutableArray.h"
 #include "nsAutoPtr.h"
 #include "nsIMemoryReporter.h"
 #include "nsThreadUtils.h"
 #include "nsIFile.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/CondVar.h"
+#include "mozilla/Attributes.h"
 
 #include "mozIStorageAggregateFunction.h"
 #include "mozIStorageCompletionCallback.h"
 #include "mozIStorageFunction.h"
 
 #include "mozStorageAsyncStatementExecution.h"
 #include "mozStorageSQLFunctions.h"
 #include "mozStorageConnection.h"
@@ -374,17 +375,17 @@ private:
   nsCOMPtr<nsIRunnable> mCallbackEvent;
 };
 
 } // anonymous namespace
 
 ////////////////////////////////////////////////////////////////////////////////
 //// Memory Reporting
 
-class StorageMemoryReporter : public nsIMemoryReporter
+class StorageMemoryReporter MOZ_FINAL : public nsIMemoryReporter
 {
 public:
   NS_DECL_ISUPPORTS
 
   enum ReporterType {
     Cache_Used,
     Schema_Used,
     Stmt_Used
--- a/storage/src/mozStorageConnection.h
+++ b/storage/src/mozStorageConnection.h
@@ -14,29 +14,30 @@
 
 #include "nsDataHashtable.h"
 #include "mozIStorageProgressHandler.h"
 #include "SQLiteMutex.h"
 #include "mozIStorageConnection.h"
 #include "mozStorageService.h"
 
 #include "nsIMutableArray.h"
+#include "mozilla/Attributes.h"
 
 #include "sqlite3.h"
 
 struct PRLock;
 class nsIFile;
 class nsIEventTarget;
 class nsIThread;
 
 namespace mozilla {
 namespace storage {
 
-class Connection : public mozIStorageConnection
-                 , public nsIInterfaceRequestor
+class Connection MOZ_FINAL : public mozIStorageConnection
+                           , public nsIInterfaceRequestor
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_MOZISTORAGECONNECTION
   NS_DECL_NSIINTERFACEREQUESTOR
 
   /**
    * Structure used to describe user functions on the database connection.
--- a/storage/src/mozStorageError.h
+++ b/storage/src/mozStorageError.h
@@ -4,21 +4,22 @@
  * 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/. */
 
 #ifndef mozStorageError_h
 #define mozStorageError_h
 
 #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
   NS_DECL_MOZISTORAGEERROR
 
   Error(int aResult, const char *aMessage);
 
 private:
--- a/storage/src/mozStorageResultSet.h
+++ b/storage/src/mozStorageResultSet.h
@@ -4,22 +4,23 @@
  * 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/. */
 
 #ifndef mozStorageResultSet_h
 #define mozStorageResultSet_h
 
 #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
   NS_DECL_MOZISTORAGERESULTSET
 
   ResultSet();
   ~ResultSet();
 
--- a/storage/src/mozStorageRow.h
+++ b/storage/src/mozStorageRow.h
@@ -5,23 +5,24 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozStorageRow_h
 #define mozStorageRow_h
 
 #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
   NS_DECL_MOZISTORAGEROW
   NS_DECL_MOZISTORAGEVALUEARRAY
 
   /**
    * Initializes the object with the given statement.  Copies the values from
--- a/storage/src/mozStorageService.cpp
+++ b/storage/src/mozStorageService.cpp
@@ -14,16 +14,17 @@
 #include "nsThreadUtils.h"
 #include "mozStoragePrivateHelpers.h"
 #include "nsILocale.h"
 #include "nsILocaleService.h"
 #include "nsIXPConnect.h"
 #include "nsIObserverService.h"
 #include "mozilla/Services.h"
 #include "mozilla/Preferences.h"
+#include "mozilla/Attributes.h"
 
 #include "sqlite3.h"
 #include "test_quota.h"
 #include "test_quota.c"
 
 #ifdef SQLITE_OS_WIN
 // "windows.h" was included and it can #define lots of things we care about...
 #undef CompareString
@@ -114,17 +115,17 @@ GetStorageSQLiteMemoryUsed()
 // and more importantly, we also gather the total via telemetry.
 NS_MEMORY_REPORTER_IMPLEMENT(StorageSQLite,
     "storage-sqlite",
     KIND_OTHER,
     UNITS_BYTES,
     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
   nsCString mStmtDesc;
   nsCString mCacheDesc;
   nsCString mSchemaDesc;
 
 public:
--- a/storage/src/mozStorageStatement.h
+++ b/storage/src/mozStorageStatement.h
@@ -12,28 +12,29 @@
 
 #include "nsTArray.h"
 
 #include "mozStorageBindingParamsArray.h"
 #include "mozStorageStatementData.h"
 #include "mozIStorageStatement.h"
 #include "mozIStorageValueArray.h"
 #include "StorageBaseStatementInternal.h"
+#include "mozilla/Attributes.h"
 
 class nsIXPConnectJSObjectHolder;
 struct sqlite3_stmt;
 
 namespace mozilla {
 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
   NS_DECL_MOZISTORAGESTATEMENT
   NS_DECL_MOZISTORAGEBASESTATEMENT
   NS_DECL_MOZISTORAGEBINDINGPARAMS
   // NS_DECL_MOZISTORAGEVALUEARRAY (methods in mozIStorageStatement)
   NS_DECL_STORAGEBASESTATEMENTINTERNAL
--- a/storage/src/mozStorageStatementParams.h
+++ b/storage/src/mozStorageStatementParams.h
@@ -4,26 +4,27 @@
  * 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/. */
 
 #ifndef MOZSTORAGESTATEMENTPARAMS_H
 #define MOZSTORAGESTATEMENTPARAMS_H
 
 #include "mozIStorageStatementParams.h"
 #include "nsIXPCScriptable.h"
+#include "mozilla/Attributes.h"
 
 class mozIStorageStatement;
 
 namespace mozilla {
 namespace storage {
 
 class Statement;
 
-class StatementParams : public mozIStorageStatementParams
-                      , public nsIXPCScriptable
+class StatementParams MOZ_FINAL : public mozIStorageStatementParams
+                                , public nsIXPCScriptable
 {
 public:
   StatementParams(mozIStorageStatement *aStatement);
 
   // interfaces
   NS_DECL_ISUPPORTS
   NS_DECL_MOZISTORAGESTATEMENTPARAMS
   NS_DECL_NSIXPCSCRIPTABLE
--- a/storage/src/mozStorageStatementRow.h
+++ b/storage/src/mozStorageStatementRow.h
@@ -4,24 +4,25 @@
  * 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/. */
 
 #ifndef MOZSTORAGESTATEMENTROW_H
 #define MOZSTORAGESTATEMENTROW_H
 
 #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
   NS_DECL_MOZISTORAGESTATEMENTROW
   NS_DECL_NSIXPCSCRIPTABLE
 
   StatementRow(Statement *aStatement);
 protected: