mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1028588 - Fix dangerous public destructors in libjar/ - r=aklotz
This commit is contained in:
parent
2b28b04041
commit
b149e693e3
@ -59,10 +59,13 @@ class nsJAR : public nsIZipReader
|
||||
// Allows nsZipReaderCache to access mOuterZipEntry
|
||||
friend class nsZipReaderCache;
|
||||
|
||||
private:
|
||||
|
||||
virtual ~nsJAR();
|
||||
|
||||
public:
|
||||
|
||||
nsJAR();
|
||||
virtual ~nsJAR();
|
||||
|
||||
NS_DEFINE_STATIC_CID_ACCESSOR( NS_ZIPREADER_CID )
|
||||
|
||||
@ -136,9 +139,10 @@ public:
|
||||
NS_DECL_NSIZIPENTRY
|
||||
|
||||
nsJARItem(nsZipItem* aZipItem);
|
||||
virtual ~nsJARItem() {}
|
||||
|
||||
private:
|
||||
virtual ~nsJARItem() {}
|
||||
|
||||
uint32_t mSize; /* size in original file */
|
||||
uint32_t mRealsize; /* inflated size */
|
||||
uint32_t mCrc32;
|
||||
@ -188,7 +192,6 @@ public:
|
||||
NS_DECL_NSIOBSERVER
|
||||
|
||||
nsZipReaderCache();
|
||||
virtual ~nsZipReaderCache();
|
||||
|
||||
nsresult ReleaseZip(nsJAR* reader);
|
||||
|
||||
@ -196,6 +199,8 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~nsZipReaderCache();
|
||||
|
||||
mozilla::Mutex mLock;
|
||||
uint32_t mCacheSize;
|
||||
ZipsHashtable mZips;
|
||||
|
@ -82,11 +82,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~nsJARInputThunk()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
int64_t GetContentLength()
|
||||
{
|
||||
return mContentLength;
|
||||
@ -96,6 +91,11 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
virtual ~nsJARInputThunk()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
bool mUsingJarCache;
|
||||
nsCOMPtr<nsIZipReader> mJarReader;
|
||||
nsCString mJarDirSpec;
|
||||
|
@ -27,8 +27,6 @@ class nsJARInputStream MOZ_FINAL : public nsIInputStream
|
||||
memset(&mZs, 0, sizeof(z_stream));
|
||||
}
|
||||
|
||||
~nsJARInputStream() { Close(); }
|
||||
|
||||
NS_DECL_THREADSAFE_ISUPPORTS
|
||||
NS_DECL_NSIINPUTSTREAM
|
||||
|
||||
@ -40,6 +38,8 @@ class nsJARInputStream MOZ_FINAL : public nsIInputStream
|
||||
const char* aDir);
|
||||
|
||||
private:
|
||||
~nsJARInputStream() { Close(); }
|
||||
|
||||
nsRefPtr<nsZipHandle> mFd; // handle for reading
|
||||
uint32_t mOutSize; // inflated size
|
||||
uint32_t mInCrc; // CRC as provided by the zipentry
|
||||
|
@ -33,7 +33,6 @@ public:
|
||||
|
||||
// nsJARProtocolHandler methods:
|
||||
nsJARProtocolHandler();
|
||||
virtual ~nsJARProtocolHandler();
|
||||
|
||||
static nsJARProtocolHandler *GetSingleton();
|
||||
|
||||
@ -50,6 +49,8 @@ public:
|
||||
void RemoteOpenFileComplete(nsIHashable *aRemoteFile, nsresult aStatus);
|
||||
|
||||
protected:
|
||||
virtual ~nsJARProtocolHandler();
|
||||
|
||||
nsCOMPtr<nsIZipReaderCache> mJARCache;
|
||||
nsCOMPtr<nsIMIMEService> mMimeService;
|
||||
|
||||
|
@ -52,7 +52,6 @@ public:
|
||||
|
||||
// nsJARURI
|
||||
nsJARURI();
|
||||
virtual ~nsJARURI();
|
||||
|
||||
nsresult Init(const char *charsetHint);
|
||||
nsresult FormatSpec(const nsACString &entryPath, nsACString &result,
|
||||
@ -63,6 +62,8 @@ public:
|
||||
nsresult SetSpecWithBase(const nsACString& aSpec, nsIURI* aBaseURL);
|
||||
|
||||
protected:
|
||||
virtual ~nsJARURI();
|
||||
|
||||
// enum used in a few places to specify how .ref attribute should be handled
|
||||
enum RefHandlingEnum {
|
||||
eIgnoreRef,
|
||||
|
@ -95,13 +95,13 @@ class nsZipArchive
|
||||
{
|
||||
friend class nsZipFind;
|
||||
|
||||
/** destructing the object closes the archive */
|
||||
~nsZipArchive();
|
||||
|
||||
public:
|
||||
/** constructing does not open the archive. See OpenArchive() */
|
||||
nsZipArchive();
|
||||
|
||||
/** destructing the object closes the archive */
|
||||
~nsZipArchive();
|
||||
|
||||
/**
|
||||
* OpenArchive
|
||||
*
|
||||
|
@ -30,6 +30,8 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
~nsZipDataStream() {}
|
||||
|
||||
nsCOMPtr<nsIStreamListener> mOutput;
|
||||
nsCOMPtr<nsIOutputStream> mStream;
|
||||
nsRefPtr<nsZipWriter> mWriter;
|
||||
|
@ -25,6 +25,12 @@
|
||||
|
||||
class nsZipHeader MOZ_FINAL : public nsIZipEntry
|
||||
{
|
||||
~nsZipHeader()
|
||||
{
|
||||
mExtraField = nullptr;
|
||||
mLocalExtraField = nullptr;
|
||||
}
|
||||
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIZIPENTRY
|
||||
@ -52,12 +58,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
~nsZipHeader()
|
||||
{
|
||||
mExtraField = nullptr;
|
||||
mLocalExtraField = nullptr;
|
||||
}
|
||||
|
||||
uint32_t mCRC;
|
||||
uint32_t mCSize;
|
||||
uint32_t mUSize;
|
||||
|
Loading…
Reference in New Issue
Block a user