Bug 884061 - Part 3p: Use NS_DECL_THREADSAFE_ISUPPORTS in modules/, r=taras,bsmedberg

--HG--
extra : rebase_source : e7b1a1d25ae9e602cae50f11d718dd1a94db782d
This commit is contained in:
Joshua Cranmer 2013-07-18 21:23:44 -05:00
parent b9c7101910
commit 3ca10f9d0e
18 changed files with 42 additions and 39 deletions

View File

@ -98,15 +98,15 @@ nsJAR::~nsJAR()
Close();
}
NS_IMPL_THREADSAFE_QUERY_INTERFACE1(nsJAR, nsIZipReader)
NS_IMPL_THREADSAFE_ADDREF(nsJAR)
NS_IMPL_QUERY_INTERFACE1(nsJAR, nsIZipReader)
NS_IMPL_ADDREF(nsJAR)
// Custom Release method works with nsZipReaderCache...
nsrefcnt nsJAR::Release(void)
{
nsrefcnt count;
NS_PRECONDITION(0 != mRefCnt, "dup release");
count = NS_AtomicDecrementRefcnt(mRefCnt);
count = --mRefCnt;
NS_LOG_RELEASE(this, count, "nsJAR");
if (0 == count) {
mRefCnt = 1; /* stabilize */
@ -866,7 +866,7 @@ nsresult nsJAR::CalculateDigest(const char* aInBuf, uint32_t aLen,
return hasher->Finish(true, digest);
}
NS_IMPL_THREADSAFE_ISUPPORTS1(nsJAREnumerator, nsIUTF8StringEnumerator)
NS_IMPL_ISUPPORTS1(nsJAREnumerator, nsIUTF8StringEnumerator)
//----------------------------------------------
// nsJAREnumerator::HasMore
@ -908,7 +908,7 @@ nsJAREnumerator::GetNext(nsACString& aResult)
}
NS_IMPL_THREADSAFE_ISUPPORTS1(nsJARItem, nsIZipEntry)
NS_IMPL_ISUPPORTS1(nsJARItem, nsIZipEntry)
nsJARItem::nsJARItem(nsZipItem* aZipItem)
: mSize(aZipItem->Size()),
@ -1008,7 +1008,7 @@ nsJARItem::GetLastModifiedTime(PRTime* aLastModTime)
////////////////////////////////////////////////////////////////////////////////
// nsIZipReaderCache
NS_IMPL_THREADSAFE_ISUPPORTS3(nsZipReaderCache, nsIZipReaderCache, nsIObserver, nsISupportsWeakReference)
NS_IMPL_ISUPPORTS3(nsZipReaderCache, nsIZipReaderCache, nsIObserver, nsISupportsWeakReference)
nsZipReaderCache::nsZipReaderCache()
: mLock("nsZipReaderCache.mLock")

View File

@ -66,7 +66,7 @@ class nsJAR : public nsIZipReader
NS_DEFINE_STATIC_CID_ACCESSOR( NS_ZIPREADER_CID )
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIZIPREADER
@ -130,7 +130,7 @@ class nsJAR : public nsIZipReader
class nsJARItem : public nsIZipEntry
{
public:
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIZIPENTRY
nsJARItem(nsZipItem* aZipItem);
@ -155,7 +155,7 @@ private:
class nsJAREnumerator MOZ_FINAL : public nsIUTF8StringEnumerator
{
public:
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIUTF8STRINGENUMERATOR
nsJAREnumerator(nsZipFind *aFind) : mFind(aFind), mName(nullptr) {
@ -180,7 +180,7 @@ class nsZipReaderCache : public nsIZipReaderCache, public nsIObserver,
public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIZIPREADERCACHE
NS_DECL_NSIOBSERVER

View File

@ -61,7 +61,7 @@ static PRLogModuleInfo *gJarProtocolLog = nullptr;
class nsJARInputThunk : public nsIInputStream
{
public:
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIINPUTSTREAM
nsJARInputThunk(nsIZipReader *zipReader,
@ -104,7 +104,7 @@ private:
int64_t mContentLength;
};
NS_IMPL_THREADSAFE_ISUPPORTS1(nsJARInputThunk, nsIInputStream)
NS_IMPL_ISUPPORTS1(nsJARInputThunk, nsIInputStream)
nsresult
nsJARInputThunk::Init()

View File

@ -34,7 +34,7 @@ class nsJARChannel : public nsIJARChannel
, public nsHashPropertyBag
{
public:
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIREQUEST
NS_DECL_NSICHANNEL
NS_DECL_NSIJARCHANNEL

View File

@ -22,7 +22,7 @@
* nsISupports implementation
*--------------------------------------------*/
NS_IMPL_THREADSAFE_ISUPPORTS1(nsJARInputStream, nsIInputStream)
NS_IMPL_ISUPPORTS1(nsJARInputStream, nsIInputStream)
/*----------------------------------------------------------
* nsJARInputStream implementation

View File

@ -29,7 +29,7 @@ class nsJARInputStream MOZ_FINAL : public nsIInputStream
~nsJARInputStream() { Close(); }
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIINPUTSTREAM
// takes ownership of |fd|, even on failure

View File

@ -124,7 +124,7 @@ nsJARProtocolHandler::RemoteOpenFileComplete(nsIHashable *aRemoteFile,
}
}
NS_IMPL_THREADSAFE_ISUPPORTS3(nsJARProtocolHandler,
NS_IMPL_ISUPPORTS3(nsJARProtocolHandler,
nsIJARProtocolHandler,
nsIProtocolHandler,
nsISupportsWeakReference)

View File

@ -27,7 +27,7 @@ class nsJARProtocolHandler : public nsIJARProtocolHandler
RemoteFileListenerArray;
public:
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIPROTOCOLHANDLER
NS_DECL_NSIJARPROTOCOLHANDLER

View File

@ -37,8 +37,8 @@ nsJARURI::~nsJARURI()
}
// XXX Why is this threadsafe?
NS_IMPL_THREADSAFE_ADDREF(nsJARURI)
NS_IMPL_THREADSAFE_RELEASE(nsJARURI)
NS_IMPL_ADDREF(nsJARURI)
NS_IMPL_RELEASE(nsJARURI)
NS_INTERFACE_MAP_BEGIN(nsJARURI)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIJARURI)
NS_INTERFACE_MAP_ENTRY(nsIURI)

View File

@ -39,7 +39,7 @@ class nsJARURI : public nsIJARURI,
public nsIIPCSerializableURI
{
public:
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIURI
NS_DECL_NSIURL
NS_DECL_NSIJARURI

View File

@ -163,8 +163,8 @@ nsZipHandle::nsZipHandle()
MOZ_COUNT_CTOR(nsZipHandle);
}
NS_IMPL_THREADSAFE_ADDREF(nsZipHandle)
NS_IMPL_THREADSAFE_RELEASE(nsZipHandle)
NS_IMPL_ADDREF(nsZipHandle)
NS_IMPL_RELEASE(nsZipHandle)
nsresult nsZipHandle::Init(nsIFile *file, nsZipHandle **ret, PRFileDesc **aFd)
{
@ -825,8 +825,8 @@ nsZipArchive::nsZipArchive()
memset(mFiles, 0, sizeof(mFiles));
}
NS_IMPL_THREADSAFE_ADDREF(nsZipArchive)
NS_IMPL_THREADSAFE_RELEASE(nsZipArchive)
NS_IMPL_ADDREF(nsZipArchive)
NS_IMPL_RELEASE(nsZipArchive)
nsZipArchive::~nsZipArchive()
{

View File

@ -20,6 +20,7 @@
#include "zipstruct.h"
#include "nsAutoPtr.h"
#include "nsIFile.h"
#include "nsISupportsImpl.h" // For mozilla::ThreadSafeAutoRefCnt
#include "mozilla/FileUtils.h"
#include "mozilla/FileLocation.h"
@ -204,7 +205,8 @@ public:
private:
//--- private members ---
nsrefcnt mRefCnt; /* ref count */
mozilla::ThreadSafeAutoRefCnt mRefCnt; /* ref count */
NS_DECL_OWNINGTHREAD
nsZipItem* mFiles[ZIP_TABSIZE];
PLArenaPool mArena;
@ -396,7 +398,8 @@ private:
PRFileMap * mMap; /* nspr datastructure for mmap */
nsAutoPtr<nsZipItemPtr<uint8_t> > mBuf;
nsrefcnt mRefCnt; /* ref count */
mozilla::ThreadSafeAutoRefCnt mRefCnt; /* ref count */
NS_DECL_OWNINGTHREAD
};
nsresult gZlibInit(z_stream *zs);

View File

@ -22,7 +22,7 @@
* Currently only the deflate compression method is supported.
* The CRC checksum for the entry's data is also generated here.
*/
NS_IMPL_THREADSAFE_ISUPPORTS2(nsZipDataStream, nsIStreamListener,
NS_IMPL_ISUPPORTS2(nsZipDataStream, nsIStreamListener,
nsIRequestObserver)
nsresult nsZipDataStream::Init(nsZipWriter *aWriter,

View File

@ -15,7 +15,7 @@
class nsZipDataStream MOZ_FINAL : public nsIStreamListener
{
public:
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER

View File

@ -43,7 +43,7 @@ class Preferences : public nsIPrefService,
public:
typedef mozilla::dom::PrefSetting PrefSetting;
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIPREFSERVICE
NS_FORWARD_NSIPREFBRANCH(sRootBranch->)
NS_DECL_NSIOBSERVER

View File

@ -327,8 +327,8 @@ Preferences::~Preferences()
* nsISupports Implementation
*/
NS_IMPL_THREADSAFE_ADDREF(Preferences)
NS_IMPL_THREADSAFE_RELEASE(Preferences)
NS_IMPL_ADDREF(Preferences)
NS_IMPL_RELEASE(Preferences)
NS_INTERFACE_MAP_BEGIN(Preferences)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIPrefService)

View File

@ -99,8 +99,8 @@ nsPrefBranch::~nsPrefBranch()
* nsISupports Implementation
*/
NS_IMPL_THREADSAFE_ADDREF(nsPrefBranch)
NS_IMPL_THREADSAFE_RELEASE(nsPrefBranch)
NS_IMPL_ADDREF(nsPrefBranch)
NS_IMPL_RELEASE(nsPrefBranch)
NS_INTERFACE_MAP_BEGIN(nsPrefBranch)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIPrefBranch)
@ -833,8 +833,8 @@ nsPrefLocalizedString::~nsPrefLocalizedString()
* nsISupports Implementation
*/
NS_IMPL_THREADSAFE_ADDREF(nsPrefLocalizedString)
NS_IMPL_THREADSAFE_RELEASE(nsPrefLocalizedString)
NS_IMPL_ADDREF(nsPrefLocalizedString)
NS_IMPL_RELEASE(nsPrefLocalizedString)
NS_INTERFACE_MAP_BEGIN(nsPrefLocalizedString)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIPrefLocalizedString)
@ -887,7 +887,7 @@ nsPrefLocalizedString::SetDataWithLength(uint32_t aLength,
// nsRelativeFilePref
//----------------------------------------------------------------------------
NS_IMPL_THREADSAFE_ISUPPORTS1(nsRelativeFilePref, nsIRelativeFilePref)
NS_IMPL_ISUPPORTS1(nsRelativeFilePref, nsIRelativeFilePref)
nsRelativeFilePref::nsRelativeFilePref()
{

View File

@ -174,7 +174,7 @@ class nsPrefBranch : public nsIPrefBranchInternal,
public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIPREFBRANCH
NS_DECL_NSIPREFBRANCH2
NS_DECL_NSIOBSERVER
@ -227,7 +227,7 @@ public:
nsPrefLocalizedString();
virtual ~nsPrefLocalizedString();
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_FORWARD_NSISUPPORTSSTRING(mUnicodeString->)
NS_FORWARD_NSISUPPORTSPRIMITIVE(mUnicodeString->)
@ -245,7 +245,7 @@ private:
class nsRelativeFilePref : public nsIRelativeFilePref
{
public:
NS_DECL_ISUPPORTS
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIRELATIVEFILEPREF
nsRelativeFilePref();