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 (libjar parts); r=glandium

This commit is contained in:
Ehsan Akhgari 2012-06-12 23:27:07 -04:00
Родитель cf9afb9577
Коммит b054ec7c9f
6 изменённых файлов: 13 добавлений и 7 удалений

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

@ -30,6 +30,7 @@
#include "nsIObserverService.h"
#include "nsWeakReference.h"
#include "nsIObserver.h"
#include "mozilla/Attributes.h"
class nsIInputStream;
class nsJARManifestItem;
@ -153,7 +154,7 @@ private:
* Enumerates a list of files in a zip archive
* (based on a pattern match in its member nsZipFind).
*/
class nsJAREnumerator : public nsIUTF8StringEnumerator
class nsJAREnumerator MOZ_FINAL : public nsIUTF8StringEnumerator
{
public:
NS_DECL_ISUPPORTS

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

@ -10,13 +10,14 @@
#include "nsIInputStream.h"
#include "nsJAR.h"
#include "nsTArray.h"
#include "mozilla/Attributes.h"
/*-------------------------------------------------------------------------
* Class nsJARInputStream declaration. This class defines the type of the
* object returned by calls to nsJAR::GetInputStream(filename) for the
* purpose of reading a file item out of a JAR file.
*------------------------------------------------------------------------*/
class nsJARInputStream : public nsIInputStream
class nsJARInputStream MOZ_FINAL : public nsIInputStream
{
public:
nsJARInputStream() :

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

@ -10,6 +10,7 @@
#include "nsCOMPtr.h"
#include "nsIPipe.h"
#include "zlib.h"
#include "mozilla/Attributes.h"
#define DEFLATECONVERTER_CLASSNAME "Deflate converter"
#define DEFLATECONVERTER_CID { 0x461cd5dd, 0x73c6, 0x47a4, \
@ -17,7 +18,7 @@
#define ZIP_BUFLEN (4 * 1024 - 1)
class nsDeflateConverter : public nsIStreamConverter
class nsDeflateConverter MOZ_FINAL : public nsIStreamConverter
{
public:
NS_DECL_ISUPPORTS

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

@ -10,8 +10,9 @@
#include "nsIOutputStream.h"
#include "nsIStreamListener.h"
#include "nsAutoPtr.h"
#include "mozilla/Attributes.h"
class nsZipDataStream : public nsIStreamListener
class nsZipDataStream MOZ_FINAL : public nsIStreamListener
{
public:
NS_DECL_ISUPPORTS

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

@ -11,6 +11,7 @@
#include "nsIInputStream.h"
#include "nsIZipReader.h"
#include "nsAutoPtr.h"
#include "mozilla/Attributes.h"
// High word is S_IFREG, low word is DOS file attribute
#define ZIP_ATTRS_FILE 0x80000000
@ -22,7 +23,7 @@
// Combine file type attributes with unix style permissions
#define ZIP_ATTRS(p, a) ((p & 0xfff) << 16) | a
class nsZipHeader : public nsIZipEntry
class nsZipHeader MOZ_FINAL : public nsIZipEntry
{
public:
NS_DECL_ISUPPORTS

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

@ -15,6 +15,7 @@
#include "nsCOMArray.h"
#include "nsTArray.h"
#include "nsDataHashtable.h"
#include "mozilla/Attributes.h"
#define ZIPWRITER_CONTRACTID "@mozilla.org/zipwriter;1"
#define ZIPWRITER_CLASSNAME "Zip Writer"
@ -36,8 +37,8 @@ public:
PRUint32 mPermissions;
};
class nsZipWriter : public nsIZipWriter,
public nsIRequestObserver
class nsZipWriter MOZ_FINAL : public nsIZipWriter,
public nsIRequestObserver
{
public:
NS_DECL_ISUPPORTS