зеркало из https://github.com/mozilla/gecko-dev.git
Bug 884061 - Part 3y: Use NS_DECL_THREADSAFE_ISUPPORTS in xpcom/, r=bsmedberg
--HG-- extra : rebase_source : d54f6973e3ff859207115013e8361781769ffc76
This commit is contained in:
Родитель
c0dfb98101
Коммит
1a6dffc73f
|
@ -116,7 +116,7 @@ class MapsReporter MOZ_FINAL : public nsIMemoryMultiReporter
|
||||||
public:
|
public:
|
||||||
MapsReporter();
|
MapsReporter();
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
NS_IMETHOD GetName(nsACString &aName)
|
NS_IMETHOD GetName(nsACString &aName)
|
||||||
{
|
{
|
||||||
|
@ -158,7 +158,7 @@ private:
|
||||||
nsTHashtable<nsCStringHashKey> mMozillaLibraries;
|
nsTHashtable<nsCStringHashKey> mMozillaLibraries;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(MapsReporter, nsIMemoryMultiReporter)
|
NS_IMPL_ISUPPORTS1(MapsReporter, nsIMemoryMultiReporter)
|
||||||
|
|
||||||
MapsReporter::MapsReporter()
|
MapsReporter::MapsReporter()
|
||||||
: mSearchedForLibxul(false)
|
: mSearchedForLibxul(false)
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#include "nsReadableUtils.h"
|
#include "nsReadableUtils.h"
|
||||||
#include "jsapi.h"
|
#include "jsapi.h"
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsConsoleMessage, nsIConsoleMessage)
|
NS_IMPL_ISUPPORTS1(nsConsoleMessage, nsIConsoleMessage)
|
||||||
|
|
||||||
nsConsoleMessage::nsConsoleMessage()
|
nsConsoleMessage::nsConsoleMessage()
|
||||||
: mTimeStamp(0),
|
: mTimeStamp(0),
|
||||||
|
|
|
@ -16,7 +16,7 @@ public:
|
||||||
nsConsoleMessage();
|
nsConsoleMessage();
|
||||||
nsConsoleMessage(const PRUnichar *message);
|
nsConsoleMessage(const PRUnichar *message);
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSICONSOLEMESSAGE
|
NS_DECL_NSICONSOLEMESSAGE
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ADDREF(nsConsoleService)
|
NS_IMPL_ADDREF(nsConsoleService)
|
||||||
NS_IMPL_THREADSAFE_RELEASE(nsConsoleService)
|
NS_IMPL_RELEASE(nsConsoleService)
|
||||||
NS_IMPL_CLASSINFO(nsConsoleService, NULL, nsIClassInfo::THREADSAFE | nsIClassInfo::SINGLETON, NS_CONSOLESERVICE_CID)
|
NS_IMPL_CLASSINFO(nsConsoleService, NULL, nsIClassInfo::THREADSAFE | nsIClassInfo::SINGLETON, NS_CONSOLESERVICE_CID)
|
||||||
NS_IMPL_QUERY_INTERFACE1_CI(nsConsoleService, nsIConsoleService)
|
NS_IMPL_QUERY_INTERFACE1_CI(nsConsoleService, nsIConsoleService)
|
||||||
NS_IMPL_CI_INTERFACE_GETTER1(nsConsoleService, nsIConsoleService)
|
NS_IMPL_CI_INTERFACE_GETTER1(nsConsoleService, nsIConsoleService)
|
||||||
|
|
|
@ -25,7 +25,7 @@ public:
|
||||||
nsConsoleService();
|
nsConsoleService();
|
||||||
nsresult Init();
|
nsresult Init();
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSICONSOLESERVICE
|
NS_DECL_NSICONSOLESERVICE
|
||||||
|
|
||||||
void SetIsDelivering() {
|
void SetIsDelivering() {
|
||||||
|
|
|
@ -42,7 +42,7 @@ public:
|
||||||
class nsExceptionManager MOZ_FINAL : public nsIExceptionManager
|
class nsExceptionManager MOZ_FINAL : public nsIExceptionManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIEXCEPTIONMANAGER
|
NS_DECL_NSIEXCEPTIONMANAGER
|
||||||
|
|
||||||
nsExceptionManager(nsExceptionService *svc);
|
nsExceptionManager(nsExceptionService *svc);
|
||||||
|
@ -67,7 +67,7 @@ int32_t nsExceptionManager::totalInstances = 0;
|
||||||
// one per thread.
|
// one per thread.
|
||||||
// An exception if the destructor, which may be called on
|
// An exception if the destructor, which may be called on
|
||||||
// the thread shutting down xpcom
|
// the thread shutting down xpcom
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsExceptionManager, nsIExceptionManager)
|
NS_IMPL_ISUPPORTS1(nsExceptionManager, nsIExceptionManager)
|
||||||
|
|
||||||
nsExceptionManager::nsExceptionManager(nsExceptionService *svc) :
|
nsExceptionManager::nsExceptionManager(nsExceptionService *svc) :
|
||||||
mNextThread(nullptr),
|
mNextThread(nullptr),
|
||||||
|
@ -122,10 +122,10 @@ nsExceptionManager *nsExceptionService::firstThread = nullptr;
|
||||||
int32_t nsExceptionService::totalInstances = 0;
|
int32_t nsExceptionService::totalInstances = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS3(nsExceptionService,
|
NS_IMPL_ISUPPORTS3(nsExceptionService,
|
||||||
nsIExceptionService,
|
nsIExceptionService,
|
||||||
nsIExceptionManager,
|
nsIExceptionManager,
|
||||||
nsIObserver)
|
nsIObserver)
|
||||||
|
|
||||||
nsExceptionService::nsExceptionService()
|
nsExceptionService::nsExceptionService()
|
||||||
: mProviders(4, true) /* small, thread-safe hashtable */
|
: mProviders(4, true) /* small, thread-safe hashtable */
|
||||||
|
|
|
@ -21,7 +21,7 @@ class nsExceptionManager;
|
||||||
class nsExceptionService MOZ_FINAL : public nsIExceptionService, public nsIObserver
|
class nsExceptionService MOZ_FINAL : public nsIExceptionService, public nsIObserver
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIEXCEPTIONSERVICE
|
NS_DECL_NSIEXCEPTIONSERVICE
|
||||||
NS_DECL_NSIEXCEPTIONMANAGER
|
NS_DECL_NSIEXCEPTIONMANAGER
|
||||||
NS_DECL_NSIOBSERVER
|
NS_DECL_NSIOBSERVER
|
||||||
|
|
|
@ -310,7 +310,7 @@ interface nsIMemoryReporterManager : nsISupports
|
||||||
#define NS_MEMORY_REPORTER_IMPLEMENT_HELPER(_classname, _path, _kind, _units, _amountFunction, _desc, _ts) \
|
#define NS_MEMORY_REPORTER_IMPLEMENT_HELPER(_classname, _path, _kind, _units, _amountFunction, _desc, _ts) \
|
||||||
class MemoryReporter_##_classname MOZ_FINAL : public nsIMemoryReporter { \
|
class MemoryReporter_##_classname MOZ_FINAL : public nsIMemoryReporter { \
|
||||||
public: \
|
public: \
|
||||||
NS_DECL_ISUPPORTS \
|
NS_DECL##_ts##ISUPPORTS \
|
||||||
NS_IMETHOD GetProcess(nsACString &process) { process.Truncate(); return NS_OK; } \
|
NS_IMETHOD GetProcess(nsACString &process) { process.Truncate(); return NS_OK; } \
|
||||||
NS_IMETHOD GetPath(nsACString &memoryPath) { memoryPath.AssignLiteral(_path); return NS_OK; } \
|
NS_IMETHOD GetPath(nsACString &memoryPath) { memoryPath.AssignLiteral(_path); return NS_OK; } \
|
||||||
NS_IMETHOD GetKind(int *kind) { *kind = _kind; return NS_OK; } \
|
NS_IMETHOD GetKind(int *kind) { *kind = _kind; return NS_OK; } \
|
||||||
|
@ -318,14 +318,14 @@ interface nsIMemoryReporterManager : nsISupports
|
||||||
NS_IMETHOD GetAmount(int64_t *amount) { *amount = _amountFunction(); return NS_OK; } \
|
NS_IMETHOD GetAmount(int64_t *amount) { *amount = _amountFunction(); return NS_OK; } \
|
||||||
NS_IMETHOD GetDescription(nsACString &desc) { desc.AssignLiteral(_desc); return NS_OK; } \
|
NS_IMETHOD GetDescription(nsACString &desc) { desc.AssignLiteral(_desc); return NS_OK; } \
|
||||||
}; \
|
}; \
|
||||||
NS_IMPL##_ts##ISUPPORTS1(MemoryReporter_##_classname, nsIMemoryReporter)
|
NS_IMPL_ISUPPORTS1(MemoryReporter_##_classname, nsIMemoryReporter)
|
||||||
|
|
||||||
// The only difference between this and NS_MEMORY_REPORTER_IMPLEMENT_HELPER
|
// The only difference between this and NS_MEMORY_REPORTER_IMPLEMENT_HELPER
|
||||||
// is that the function used to implement GetAmount is fallible.
|
// is that the function used to implement GetAmount is fallible.
|
||||||
#define NS_FALLIBLE_MEMORY_REPORTER_IMPLEMENT_HELPER(_classname, _path, _kind, _units, _amountFunction, _desc, _ts) \
|
#define NS_FALLIBLE_MEMORY_REPORTER_IMPLEMENT_HELPER(_classname, _path, _kind, _units, _amountFunction, _desc, _ts) \
|
||||||
class MemoryReporter_##_classname MOZ_FINAL : public nsIMemoryReporter { \
|
class MemoryReporter_##_classname MOZ_FINAL : public nsIMemoryReporter { \
|
||||||
public: \
|
public: \
|
||||||
NS_DECL_ISUPPORTS \
|
NS_DECL##_ts##ISUPPORTS \
|
||||||
NS_IMETHOD GetProcess(nsACString &process) { process.Truncate(); return NS_OK; } \
|
NS_IMETHOD GetProcess(nsACString &process) { process.Truncate(); return NS_OK; } \
|
||||||
NS_IMETHOD GetPath(nsACString &memoryPath) { memoryPath.AssignLiteral(_path); return NS_OK; } \
|
NS_IMETHOD GetPath(nsACString &memoryPath) { memoryPath.AssignLiteral(_path); return NS_OK; } \
|
||||||
NS_IMETHOD GetKind(int32_t *kind) { *kind = _kind; return NS_OK; } \
|
NS_IMETHOD GetKind(int32_t *kind) { *kind = _kind; return NS_OK; } \
|
||||||
|
@ -333,7 +333,7 @@ interface nsIMemoryReporterManager : nsISupports
|
||||||
NS_IMETHOD GetAmount(int64_t *amount) { return _amountFunction(amount); } \
|
NS_IMETHOD GetAmount(int64_t *amount) { return _amountFunction(amount); } \
|
||||||
NS_IMETHOD GetDescription(nsACString &desc) { desc.AssignLiteral(_desc); return NS_OK; }\
|
NS_IMETHOD GetDescription(nsACString &desc) { desc.AssignLiteral(_desc); return NS_OK; }\
|
||||||
}; \
|
}; \
|
||||||
NS_IMPL##_ts##ISUPPORTS1(MemoryReporter_##_classname, nsIMemoryReporter)
|
NS_IMPL_ISUPPORTS1(MemoryReporter_##_classname, nsIMemoryReporter)
|
||||||
|
|
||||||
#define NS_MEMORY_REPORTER_IMPLEMENT(_c, _p, _k, _u, _a, _d) \
|
#define NS_MEMORY_REPORTER_IMPLEMENT(_c, _p, _k, _u, _a, _d) \
|
||||||
NS_MEMORY_REPORTER_IMPLEMENT_HELPER(_c, _p, _k, _u, _a, _d, _)
|
NS_MEMORY_REPORTER_IMPLEMENT_HELPER(_c, _p, _k, _u, _a, _d, _)
|
||||||
|
@ -448,7 +448,7 @@ public:
|
||||||
|
|
||||||
virtual ~MemoryReporterBase() {}
|
virtual ~MemoryReporterBase() {}
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
NS_IMETHOD GetProcess(nsACString& aProcess)
|
NS_IMETHOD GetProcess(nsACString& aProcess)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,7 +11,8 @@
|
||||||
class nsInterfaceRequestorAgg MOZ_FINAL : public nsIInterfaceRequestor
|
class nsInterfaceRequestorAgg MOZ_FINAL : public nsIInterfaceRequestor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
// XXX This needs to support threadsafe refcounting until we fix bug 243591.
|
||||||
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIINTERFACEREQUESTOR
|
NS_DECL_NSIINTERFACEREQUESTOR
|
||||||
|
|
||||||
nsInterfaceRequestorAgg(nsIInterfaceRequestor *aFirst,
|
nsInterfaceRequestorAgg(nsIInterfaceRequestor *aFirst,
|
||||||
|
@ -32,8 +33,7 @@ private:
|
||||||
nsCOMPtr<nsIEventTarget> mConsumerTarget;
|
nsCOMPtr<nsIEventTarget> mConsumerTarget;
|
||||||
};
|
};
|
||||||
|
|
||||||
// XXX This needs to support threadsafe refcounting until we fix bug 243591.
|
NS_IMPL_ISUPPORTS1(nsInterfaceRequestorAgg, nsIInterfaceRequestor)
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsInterfaceRequestorAgg, nsIInterfaceRequestor)
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsInterfaceRequestorAgg::GetInterface(const nsIID &aIID, void **aResult)
|
nsInterfaceRequestorAgg::GetInterface(const nsIID &aIID, void **aResult)
|
||||||
|
|
|
@ -191,7 +191,7 @@ public:
|
||||||
virtual void OnFileCanReadWithoutBlocking(int aFd) = 0;
|
virtual void OnFileCanReadWithoutBlocking(int aFd) = 0;
|
||||||
virtual void OnFileCanWriteWithoutBlocking(int aFd) {};
|
virtual void OnFileCanWriteWithoutBlocking(int aFd) {};
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize this object. This should be called right after the object is
|
* Initialize this object. This should be called right after the object is
|
||||||
|
@ -258,7 +258,7 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(FdWatcher, nsIObserver);
|
NS_IMPL_ISUPPORTS1(FdWatcher, nsIObserver);
|
||||||
|
|
||||||
class SignalPipeWatcher : public FdWatcher
|
class SignalPipeWatcher : public FdWatcher
|
||||||
{
|
{
|
||||||
|
|
|
@ -682,7 +682,7 @@ NS_IMPL_ISUPPORTS1(DMDMultiReporter, nsIMemoryMultiReporter)
|
||||||
** nsMemoryReporterManager implementation
|
** nsMemoryReporterManager implementation
|
||||||
**/
|
**/
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsMemoryReporterManager, nsIMemoryReporterManager)
|
NS_IMPL_ISUPPORTS1(nsMemoryReporterManager, nsIMemoryReporterManager)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsMemoryReporterManager::Init()
|
nsMemoryReporterManager::Init()
|
||||||
|
@ -1199,7 +1199,7 @@ nsMemoryReporterManager::MinimizeMemoryUsage(nsIRunnable* aCallback,
|
||||||
// Most memory reporters don't need thread safety, but some do. Make them all
|
// Most memory reporters don't need thread safety, but some do. Make them all
|
||||||
// thread-safe just to be safe. Memory reporters are created and destroyed
|
// thread-safe just to be safe. Memory reporters are created and destroyed
|
||||||
// infrequently enough that the performance cost should be negligible.
|
// infrequently enough that the performance cost should be negligible.
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(MemoryReporterBase, nsIMemoryReporter)
|
NS_IMPL_ISUPPORTS1(MemoryReporterBase, nsIMemoryReporter)
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
NS_RegisterMemoryReporter (nsIMemoryReporter *reporter)
|
NS_RegisterMemoryReporter (nsIMemoryReporter *reporter)
|
||||||
|
|
|
@ -16,7 +16,7 @@ using mozilla::Mutex;
|
||||||
class nsMemoryReporterManager : public nsIMemoryReporterManager
|
class nsMemoryReporterManager : public nsIMemoryReporterManager
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIMEMORYREPORTERMANAGER
|
NS_DECL_NSIMEMORYREPORTERMANAGER
|
||||||
|
|
||||||
nsMemoryReporterManager();
|
nsMemoryReporterManager();
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsUUIDGenerator, nsIUUIDGenerator)
|
NS_IMPL_ISUPPORTS1(nsUUIDGenerator, nsIUUIDGenerator)
|
||||||
|
|
||||||
nsUUIDGenerator::nsUUIDGenerator()
|
nsUUIDGenerator::nsUUIDGenerator()
|
||||||
: mLock("nsUUIDGenerator.mLock")
|
: mLock("nsUUIDGenerator.mLock")
|
||||||
|
|
|
@ -15,7 +15,7 @@ class nsUUIDGenerator MOZ_FINAL : public nsIUUIDGenerator {
|
||||||
public:
|
public:
|
||||||
nsUUIDGenerator();
|
nsUUIDGenerator();
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
NS_DECL_NSIUUIDGENERATOR
|
NS_DECL_NSIUUIDGENERATOR
|
||||||
|
|
||||||
|
|
|
@ -110,7 +110,7 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIMODULE
|
NS_DECL_NSIMODULE
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -834,12 +834,12 @@ nsComponentManagerImpl::~nsComponentManagerImpl()
|
||||||
PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: Destroyed."));
|
PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: Destroyed."));
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS5(nsComponentManagerImpl,
|
NS_IMPL_ISUPPORTS5(nsComponentManagerImpl,
|
||||||
nsIComponentManager,
|
nsIComponentManager,
|
||||||
nsIServiceManager,
|
nsIServiceManager,
|
||||||
nsIComponentRegistrar,
|
nsIComponentRegistrar,
|
||||||
nsISupportsWeakReference,
|
nsISupportsWeakReference,
|
||||||
nsIInterfaceRequestor)
|
nsIInterfaceRequestor)
|
||||||
|
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
@ -126,7 +126,7 @@ class nsComponentManagerImpl MOZ_FINAL
|
||||||
, public nsIInterfaceRequestor
|
, public nsIInterfaceRequestor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIINTERFACEREQUESTOR
|
NS_DECL_NSIINTERFACEREQUESTOR
|
||||||
NS_DECL_NSICOMPONENTMANAGER
|
NS_DECL_NSICOMPONENTMANAGER
|
||||||
NS_DECL_NSICOMPONENTREGISTRAR
|
NS_DECL_NSICOMPONENTREGISTRAR
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include "nsAtomService.h"
|
#include "nsAtomService.h"
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsAtomService, nsIAtomService)
|
NS_IMPL_ISUPPORTS1(nsAtomService, nsIAtomService)
|
||||||
|
|
||||||
nsAtomService::nsAtomService()
|
nsAtomService::nsAtomService()
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,7 @@ class nsAtomService MOZ_FINAL : public nsIAtomService
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nsAtomService();
|
nsAtomService();
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
NS_DECL_NSIATOMSERVICE
|
NS_DECL_NSIATOMSERVICE
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,8 @@ NS_NewHashPropertyBag(nsIWritablePropertyBag* *_retval)
|
||||||
* nsHashPropertyBag impl
|
* nsHashPropertyBag impl
|
||||||
*/
|
*/
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ADDREF(nsHashPropertyBag)
|
NS_IMPL_ADDREF(nsHashPropertyBag)
|
||||||
NS_IMPL_THREADSAFE_RELEASE(nsHashPropertyBag)
|
NS_IMPL_RELEASE(nsHashPropertyBag)
|
||||||
NS_INTERFACE_MAP_BEGIN(nsHashPropertyBag)
|
NS_INTERFACE_MAP_BEGIN(nsHashPropertyBag)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIWritablePropertyBag)
|
NS_INTERFACE_MAP_ENTRY(nsIWritablePropertyBag)
|
||||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIPropertyBag, nsIWritablePropertyBag)
|
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIPropertyBag, nsIWritablePropertyBag)
|
||||||
|
|
|
@ -23,7 +23,7 @@ public:
|
||||||
|
|
||||||
nsresult Init();
|
nsresult Init();
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
NS_DECL_NSIPROPERTYBAG
|
NS_DECL_NSIPROPERTYBAG
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ GetObserverServiceLog()
|
||||||
// nsObserverService Implementation
|
// nsObserverService Implementation
|
||||||
|
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsObserverService, nsIObserverService, nsObserverService)
|
NS_IMPL_ISUPPORTS2(nsObserverService, nsIObserverService, nsObserverService)
|
||||||
|
|
||||||
nsObserverService::nsObserverService() :
|
nsObserverService::nsObserverService() :
|
||||||
mShuttingDown(false)
|
mShuttingDown(false)
|
||||||
|
|
|
@ -21,7 +21,7 @@ public:
|
||||||
|
|
||||||
nsObserverService();
|
nsObserverService();
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIOBSERVERSERVICE
|
NS_DECL_NSIOBSERVERSERVICE
|
||||||
|
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
|
|
|
@ -494,7 +494,7 @@ nsPersistentProperties::Create(nsISupports *aOuter, REFNSIID aIID, void **aResul
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsPersistentProperties, nsIPersistentProperties, nsIProperties)
|
NS_IMPL_ISUPPORTS2(nsPersistentProperties, nsIPersistentProperties, nsIProperties)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsPersistentProperties::Load(nsIInputStream *aIn)
|
nsPersistentProperties::Load(nsIInputStream *aIn)
|
||||||
|
|
|
@ -22,7 +22,7 @@ public:
|
||||||
nsPersistentProperties();
|
nsPersistentProperties();
|
||||||
nsresult Init();
|
nsresult Init();
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIPROPERTIES
|
NS_DECL_NSIPROPERTIES
|
||||||
NS_DECL_NSIPERSISTENTPROPERTIES
|
NS_DECL_NSIPERSISTENTPROPERTIES
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,7 @@ nsSupportsArray::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
|
||||||
return it->QueryInterface(aIID, aResult);
|
return it->QueryInterface(aIID, aResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS3(nsSupportsArray, nsISupportsArray, nsICollection, nsISerializable)
|
NS_IMPL_ISUPPORTS3(nsSupportsArray, nsISupportsArray, nsICollection, nsISerializable)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsSupportsArray::Read(nsIObjectInputStream *aStream)
|
nsSupportsArray::Read(nsIObjectInputStream *aStream)
|
||||||
|
|
|
@ -21,7 +21,7 @@ public:
|
||||||
static nsresult
|
static nsresult
|
||||||
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
|
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
NS_DECL_NSISERIALIZABLE
|
NS_DECL_NSISERIALIZABLE
|
||||||
|
|
||||||
|
|
|
@ -146,8 +146,8 @@ NS_IMETHODIMP nsSupportsStringImpl::SetData(const nsAString& aData)
|
||||||
|
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsSupportsPRBoolImpl, nsISupportsPRBool,
|
NS_IMPL_ISUPPORTS2(nsSupportsPRBoolImpl, nsISupportsPRBool,
|
||||||
nsISupportsPrimitive)
|
nsISupportsPrimitive)
|
||||||
|
|
||||||
nsSupportsPRBoolImpl::nsSupportsPRBoolImpl()
|
nsSupportsPRBoolImpl::nsSupportsPRBoolImpl()
|
||||||
: mData(false)
|
: mData(false)
|
||||||
|
@ -683,8 +683,8 @@ NS_IMETHODIMP nsSupportsDoubleImpl::ToString(char **_retval)
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsSupportsVoidImpl, nsISupportsVoid,
|
NS_IMPL_ISUPPORTS2(nsSupportsVoidImpl, nsISupportsVoid,
|
||||||
nsISupportsPrimitive)
|
nsISupportsPrimitive)
|
||||||
|
|
||||||
nsSupportsVoidImpl::nsSupportsVoidImpl()
|
nsSupportsVoidImpl::nsSupportsVoidImpl()
|
||||||
: mData(nullptr)
|
: mData(nullptr)
|
||||||
|
@ -725,9 +725,9 @@ NS_IMETHODIMP nsSupportsVoidImpl::ToString(char **_retval)
|
||||||
/***************************************************************************/
|
/***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsSupportsInterfacePointerImpl,
|
NS_IMPL_ISUPPORTS2(nsSupportsInterfacePointerImpl,
|
||||||
nsISupportsInterfacePointer,
|
nsISupportsInterfacePointer,
|
||||||
nsISupportsPrimitive)
|
nsISupportsPrimitive)
|
||||||
|
|
||||||
nsSupportsInterfacePointerImpl::nsSupportsInterfacePointerImpl()
|
nsSupportsInterfacePointerImpl::nsSupportsInterfacePointerImpl()
|
||||||
: mIID(nullptr)
|
: mIID(nullptr)
|
||||||
|
|
|
@ -67,7 +67,7 @@ private:
|
||||||
class nsSupportsPRBoolImpl MOZ_FINAL : public nsISupportsPRBool
|
class nsSupportsPRBoolImpl MOZ_FINAL : public nsISupportsPRBool
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSISUPPORTSPRIMITIVE
|
NS_DECL_NSISUPPORTSPRIMITIVE
|
||||||
NS_DECL_NSISUPPORTSPRBOOL
|
NS_DECL_NSISUPPORTSPRBOOL
|
||||||
|
|
||||||
|
@ -271,7 +271,7 @@ private:
|
||||||
class nsSupportsVoidImpl MOZ_FINAL : public nsISupportsVoid
|
class nsSupportsVoidImpl MOZ_FINAL : public nsISupportsVoid
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSISUPPORTSPRIMITIVE
|
NS_DECL_NSISUPPORTSPRIMITIVE
|
||||||
NS_DECL_NSISUPPORTSVOID
|
NS_DECL_NSISUPPORTSVOID
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ private:
|
||||||
class nsSupportsInterfacePointerImpl MOZ_FINAL : public nsISupportsInterfacePointer
|
class nsSupportsInterfacePointerImpl MOZ_FINAL : public nsISupportsInterfacePointer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSISUPPORTSPRIMITIVE
|
NS_DECL_NSISUPPORTSPRIMITIVE
|
||||||
NS_DECL_NSISUPPORTSINTERFACEPOINTER
|
NS_DECL_NSISUPPORTSINTERFACEPOINTER
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(GenericFactory, nsIFactory)
|
NS_IMPL_ISUPPORTS1(GenericFactory, nsIFactory)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
GenericFactory::CreateInstance(nsISupports* aOuter, REFNSIID aIID,
|
GenericFactory::CreateInstance(nsISupports* aOuter, REFNSIID aIID,
|
||||||
|
|
|
@ -22,7 +22,7 @@ class GenericFactory MOZ_FINAL : public nsIFactory
|
||||||
public:
|
public:
|
||||||
typedef Module::ConstructorProcPtr ConstructorProcPtr;
|
typedef Module::ConstructorProcPtr ConstructorProcPtr;
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIFACTORY
|
NS_DECL_NSIFACTORY
|
||||||
|
|
||||||
GenericFactory(ConstructorProcPtr ctor)
|
GenericFactory(ConstructorProcPtr ctor)
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(GenericModule, nsIModule)
|
NS_IMPL_ISUPPORTS1(GenericModule, nsIModule)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
GenericModule::GetClassObject(nsIComponentManager* aCompMgr,
|
GenericModule::GetClassObject(nsIComponentManager* aCompMgr,
|
||||||
|
|
|
@ -142,13 +142,9 @@ public:
|
||||||
|
|
||||||
bool operator==(const nsMainThreadPtrHolder<T>& aOther) const { return mRawPtr == aOther.mRawPtr; }
|
bool operator==(const nsMainThreadPtrHolder<T>& aOther) const { return mRawPtr == aOther.mRawPtr; }
|
||||||
|
|
||||||
NS_IMETHOD_(nsrefcnt) Release();
|
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(nsMainThreadPtrHolder<T>)
|
||||||
NS_IMETHOD_(nsrefcnt) AddRef();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// This class is threadsafe and reference-counted.
|
|
||||||
nsAutoRefCnt mRefCnt;
|
|
||||||
|
|
||||||
// Our wrapped pointer.
|
// Our wrapped pointer.
|
||||||
T* mRawPtr;
|
T* mRawPtr;
|
||||||
|
|
||||||
|
@ -161,11 +157,6 @@ private:
|
||||||
nsMainThreadPtrHolder(const nsMainThreadPtrHolder& other);
|
nsMainThreadPtrHolder(const nsMainThreadPtrHolder& other);
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T>
|
|
||||||
NS_IMPL_THREADSAFE_ADDREF(nsMainThreadPtrHolder<T>)
|
|
||||||
template<class T>
|
|
||||||
NS_IMPL_THREADSAFE_RELEASE(nsMainThreadPtrHolder<T>)
|
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
class nsMainThreadPtrHandle
|
class nsMainThreadPtrHandle
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
#ifndef XPCOM_GLUE_AVOID_NSPR
|
#ifndef XPCOM_GLUE_AVOID_NSPR
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsRunnable, nsIRunnable)
|
NS_IMPL_ISUPPORTS1(nsRunnable, nsIRunnable)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsRunnable::Run()
|
nsRunnable::Run()
|
||||||
|
@ -37,7 +37,7 @@ nsRunnable::Run()
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsCancelableRunnable, nsICancelableRunnable,
|
NS_IMPL_ISUPPORTS2(nsCancelableRunnable, nsICancelableRunnable,
|
||||||
nsIRunnable)
|
nsIRunnable)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
@ -247,14 +247,14 @@ class nsNameThreadRunnable MOZ_FINAL : public nsIRunnable
|
||||||
public:
|
public:
|
||||||
nsNameThreadRunnable(const nsACString &name) : mName(name) { }
|
nsNameThreadRunnable(const nsACString &name) : mName(name) { }
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIRUNNABLE
|
NS_DECL_NSIRUNNABLE
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const nsCString mName;
|
const nsCString mName;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsNameThreadRunnable, nsIRunnable)
|
NS_IMPL_ISUPPORTS1(nsNameThreadRunnable, nsIRunnable)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsNameThreadRunnable::Run()
|
nsNameThreadRunnable::Run()
|
||||||
|
|
|
@ -236,7 +236,7 @@ extern NS_COM_GLUE nsIThread *NS_GetCurrentThread();
|
||||||
class NS_COM_GLUE nsRunnable : public nsIRunnable
|
class NS_COM_GLUE nsRunnable : public nsIRunnable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIRUNNABLE
|
NS_DECL_NSIRUNNABLE
|
||||||
|
|
||||||
nsRunnable() {
|
nsRunnable() {
|
||||||
|
@ -251,7 +251,7 @@ protected:
|
||||||
class NS_COM_GLUE nsCancelableRunnable : public nsICancelableRunnable
|
class NS_COM_GLUE nsCancelableRunnable : public nsICancelableRunnable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIRUNNABLE
|
NS_DECL_NSIRUNNABLE
|
||||||
NS_DECL_NSICANCELABLERUNNABLE
|
NS_DECL_NSICANCELABLERUNNABLE
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ nsAppFileLocationProvider::nsAppFileLocationProvider()
|
||||||
// nsAppFileLocationProvider::nsISupports
|
// nsAppFileLocationProvider::nsISupports
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsAppFileLocationProvider, nsIDirectoryServiceProvider, nsIDirectoryServiceProvider2)
|
NS_IMPL_ISUPPORTS2(nsAppFileLocationProvider, nsIDirectoryServiceProvider, nsIDirectoryServiceProvider2)
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
// nsAppFileLocationProvider::nsIDirectoryServiceProvider
|
// nsAppFileLocationProvider::nsIDirectoryServiceProvider
|
||||||
|
|
|
@ -18,7 +18,7 @@ class nsAppFileLocationProvider MOZ_FINAL : public nsIDirectoryServiceProvider2
|
||||||
public:
|
public:
|
||||||
nsAppFileLocationProvider();
|
nsAppFileLocationProvider();
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIDIRECTORYSERVICEPROVIDER
|
NS_DECL_NSIDIRECTORYSERVICEPROVIDER
|
||||||
NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
|
NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
|
||||||
|
|
||||||
|
|
|
@ -288,7 +288,7 @@ nsDirectoryService::~nsDirectoryService()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS4(nsDirectoryService, nsIProperties, nsIDirectoryService, nsIDirectoryServiceProvider, nsIDirectoryServiceProvider2)
|
NS_IMPL_ISUPPORTS4(nsDirectoryService, nsIProperties, nsIDirectoryService, nsIDirectoryServiceProvider, nsIDirectoryServiceProvider2)
|
||||||
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
|
|
@ -24,7 +24,7 @@ class nsDirectoryService MOZ_FINAL : public nsIDirectoryService,
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// nsISupports interface
|
// nsISupports interface
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
NS_DECL_NSIPROPERTIES
|
NS_DECL_NSIPROPERTIES
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "nsIOutputStream.h"
|
#include "nsIOutputStream.h"
|
||||||
#include "nsStreamUtils.h"
|
#include "nsStreamUtils.h"
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsIOUtil, nsIIOUtil)
|
NS_IMPL_ISUPPORTS1(nsIOUtil, nsIIOUtil)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsIOUtil::InputStreamIsBuffered(nsIInputStream* aStream, bool* _retval)
|
nsIOUtil::InputStreamIsBuffered(nsIInputStream* aStream, bool* _retval)
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
class nsIOUtil MOZ_FINAL : public nsIIOUtil
|
class nsIOUtil MOZ_FINAL : public nsIIOUtil
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIIOUTIL
|
NS_DECL_NSIIOUTIL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ GetTeeLog()
|
||||||
class nsInputStreamTee MOZ_FINAL : public nsIInputStreamTee
|
class nsInputStreamTee MOZ_FINAL : public nsIInputStreamTee
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIINPUTSTREAM
|
NS_DECL_NSIINPUTSTREAM
|
||||||
NS_DECL_NSIINPUTSTREAMTEE
|
NS_DECL_NSIINPUTSTREAMTEE
|
||||||
|
|
||||||
|
@ -205,9 +205,9 @@ nsInputStreamTee::WriteSegmentFun(nsIInputStream *in, void *closure, const char
|
||||||
return tee->TeeSegment(fromSegment, *writeCount);
|
return tee->TeeSegment(fromSegment, *writeCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsInputStreamTee,
|
NS_IMPL_ISUPPORTS2(nsInputStreamTee,
|
||||||
nsIInputStreamTee,
|
nsIInputStreamTee,
|
||||||
nsIInputStream)
|
nsIInputStream)
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsInputStreamTee::Close()
|
nsInputStreamTee::Close()
|
||||||
{
|
{
|
||||||
|
|
|
@ -580,11 +580,11 @@ nsLocalFile::nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void*
|
||||||
// nsLocalFile::nsISupports
|
// nsLocalFile::nsISupports
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS4(nsLocalFile,
|
NS_IMPL_ISUPPORTS4(nsLocalFile,
|
||||||
nsILocalFile,
|
nsILocalFile,
|
||||||
nsIFile,
|
nsIFile,
|
||||||
nsILocalFileOS2,
|
nsILocalFileOS2,
|
||||||
nsIHashable)
|
nsIHashable)
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
static nsresult nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
|
static nsresult nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
|
||||||
|
|
||||||
// nsISupports interface
|
// nsISupports interface
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
// nsIFile interface
|
// nsIFile interface
|
||||||
NS_DECL_NSIFILE
|
NS_DECL_NSIFILE
|
||||||
|
|
|
@ -239,16 +239,16 @@ nsLocalFile::nsLocalFile(const nsLocalFile& other)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_WIDGET_COCOA
|
#ifdef MOZ_WIDGET_COCOA
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS4(nsLocalFile,
|
NS_IMPL_ISUPPORTS4(nsLocalFile,
|
||||||
nsILocalFileMac,
|
nsILocalFileMac,
|
||||||
nsILocalFile,
|
nsILocalFile,
|
||||||
nsIFile,
|
nsIFile,
|
||||||
nsIHashable)
|
nsIHashable)
|
||||||
#else
|
#else
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS3(nsLocalFile,
|
NS_IMPL_ISUPPORTS3(nsLocalFile,
|
||||||
nsILocalFile,
|
nsILocalFile,
|
||||||
nsIFile,
|
nsIFile,
|
||||||
nsIHashable)
|
nsIHashable)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
|
|
|
@ -91,7 +91,7 @@ public:
|
||||||
|
|
||||||
static nsresult nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
|
static nsresult nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIFILE
|
NS_DECL_NSIFILE
|
||||||
NS_DECL_NSILOCALFILE
|
NS_DECL_NSILOCALFILE
|
||||||
#ifdef MOZ_WIDGET_COCOA
|
#ifdef MOZ_WIDGET_COCOA
|
||||||
|
|
|
@ -979,11 +979,11 @@ nsLocalFile::nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void*
|
||||||
// nsLocalFile::nsISupports
|
// nsLocalFile::nsISupports
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS4(nsLocalFile,
|
NS_IMPL_ISUPPORTS4(nsLocalFile,
|
||||||
nsILocalFile,
|
nsILocalFile,
|
||||||
nsIFile,
|
nsIFile,
|
||||||
nsILocalFileWin,
|
nsILocalFileWin,
|
||||||
nsIHashable)
|
nsIHashable)
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
@ -34,7 +34,7 @@ public:
|
||||||
static nsresult nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
|
static nsresult nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr);
|
||||||
|
|
||||||
// nsISupports interface
|
// nsISupports interface
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
// nsIFile interface
|
// nsIFile interface
|
||||||
NS_DECL_NSIFILE
|
NS_DECL_NSIFILE
|
||||||
|
|
|
@ -33,7 +33,7 @@ class nsMultiplexInputStream MOZ_FINAL : public nsIMultiplexInputStream,
|
||||||
public:
|
public:
|
||||||
nsMultiplexInputStream();
|
nsMultiplexInputStream();
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIINPUTSTREAM
|
NS_DECL_NSIINPUTSTREAM
|
||||||
NS_DECL_NSIMULTIPLEXINPUTSTREAM
|
NS_DECL_NSIMULTIPLEXINPUTSTREAM
|
||||||
NS_DECL_NSISEEKABLESTREAM
|
NS_DECL_NSISEEKABLESTREAM
|
||||||
|
@ -60,8 +60,8 @@ private:
|
||||||
nsresult mStatus;
|
nsresult mStatus;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ADDREF(nsMultiplexInputStream)
|
NS_IMPL_ADDREF(nsMultiplexInputStream)
|
||||||
NS_IMPL_THREADSAFE_RELEASE(nsMultiplexInputStream)
|
NS_IMPL_RELEASE(nsMultiplexInputStream)
|
||||||
|
|
||||||
NS_IMPL_CLASSINFO(nsMultiplexInputStream, NULL, nsIClassInfo::THREADSAFE,
|
NS_IMPL_CLASSINFO(nsMultiplexInputStream, NULL, nsIClassInfo::THREADSAFE,
|
||||||
NS_MULTIPLEXINPUTSTREAM_CID)
|
NS_MULTIPLEXINPUTSTREAM_CID)
|
||||||
|
|
|
@ -128,7 +128,7 @@ private:
|
||||||
nsPipe *mPipe;
|
nsPipe *mPipe;
|
||||||
|
|
||||||
// separate refcnt so that we know when to close the consumer
|
// separate refcnt so that we know when to close the consumer
|
||||||
nsrefcnt mReaderRefCnt;
|
mozilla::ThreadSafeAutoRefCnt mReaderRefCnt;
|
||||||
int64_t mLogicalOffset;
|
int64_t mLogicalOffset;
|
||||||
bool mBlocking;
|
bool mBlocking;
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ private:
|
||||||
nsPipe *mPipe;
|
nsPipe *mPipe;
|
||||||
|
|
||||||
// separate refcnt so that we know when to close the producer
|
// separate refcnt so that we know when to close the producer
|
||||||
nsrefcnt mWriterRefCnt;
|
mozilla::ThreadSafeAutoRefCnt mWriterRefCnt;
|
||||||
int64_t mLogicalOffset;
|
int64_t mLogicalOffset;
|
||||||
bool mBlocking;
|
bool mBlocking;
|
||||||
|
|
||||||
|
@ -201,7 +201,7 @@ public:
|
||||||
friend class nsPipeInputStream;
|
friend class nsPipeInputStream;
|
||||||
friend class nsPipeOutputStream;
|
friend class nsPipeOutputStream;
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIPIPE
|
NS_DECL_NSIPIPE
|
||||||
|
|
||||||
// nsPipe methods:
|
// nsPipe methods:
|
||||||
|
@ -311,7 +311,7 @@ nsPipe::~nsPipe()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsPipe, nsIPipe)
|
NS_IMPL_ISUPPORTS1(nsPipe, nsIPipe)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsPipe::Init(bool nonBlockingIn,
|
nsPipe::Init(bool nonBlockingIn,
|
||||||
|
@ -680,14 +680,14 @@ nsPipeInputStream::OnInputException(nsresult reason, nsPipeEvents &events)
|
||||||
NS_IMETHODIMP_(nsrefcnt)
|
NS_IMETHODIMP_(nsrefcnt)
|
||||||
nsPipeInputStream::AddRef(void)
|
nsPipeInputStream::AddRef(void)
|
||||||
{
|
{
|
||||||
NS_AtomicIncrementRefcnt(mReaderRefCnt);
|
++mReaderRefCnt;
|
||||||
return mPipe->AddRef();
|
return mPipe->AddRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP_(nsrefcnt)
|
NS_IMETHODIMP_(nsrefcnt)
|
||||||
nsPipeInputStream::Release(void)
|
nsPipeInputStream::Release(void)
|
||||||
{
|
{
|
||||||
if (NS_AtomicDecrementRefcnt(mReaderRefCnt) == 0)
|
if (--mReaderRefCnt == 0)
|
||||||
Close();
|
Close();
|
||||||
return mPipe->Release();
|
return mPipe->Release();
|
||||||
}
|
}
|
||||||
|
@ -1035,14 +1035,14 @@ nsPipeOutputStream::OnOutputException(nsresult reason, nsPipeEvents &events)
|
||||||
NS_IMETHODIMP_(nsrefcnt)
|
NS_IMETHODIMP_(nsrefcnt)
|
||||||
nsPipeOutputStream::AddRef()
|
nsPipeOutputStream::AddRef()
|
||||||
{
|
{
|
||||||
NS_AtomicIncrementRefcnt(mWriterRefCnt);
|
++mWriterRefCnt;
|
||||||
return mPipe->AddRef();
|
return mPipe->AddRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP_(nsrefcnt)
|
NS_IMETHODIMP_(nsrefcnt)
|
||||||
nsPipeOutputStream::Release()
|
nsPipeOutputStream::Release()
|
||||||
{
|
{
|
||||||
if (NS_AtomicDecrementRefcnt(mWriterRefCnt) == 0)
|
if (--mWriterRefCnt == 0)
|
||||||
Close();
|
Close();
|
||||||
return mPipe->Release();
|
return mPipe->Release();
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,9 +59,9 @@ nsStorageStream::~nsStorageStream()
|
||||||
delete mSegmentedBuffer;
|
delete mSegmentedBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsStorageStream,
|
NS_IMPL_ISUPPORTS2(nsStorageStream,
|
||||||
nsIStorageStream,
|
nsIStorageStream,
|
||||||
nsIOutputStream)
|
nsIOutputStream)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsStorageStream::Init(uint32_t segmentSize, uint32_t maxSize,
|
nsStorageStream::Init(uint32_t segmentSize, uint32_t maxSize,
|
||||||
|
@ -320,7 +320,7 @@ public:
|
||||||
NS_ADDREF(mStorageStream);
|
NS_ADDREF(mStorageStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIINPUTSTREAM
|
NS_DECL_NSIINPUTSTREAM
|
||||||
NS_DECL_NSISEEKABLESTREAM
|
NS_DECL_NSISEEKABLESTREAM
|
||||||
|
|
||||||
|
@ -348,9 +348,9 @@ private:
|
||||||
uint32_t SegOffset(uint32_t aPosition) {return aPosition & (mSegmentSize - 1);}
|
uint32_t SegOffset(uint32_t aPosition) {return aPosition & (mSegmentSize - 1);}
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsStorageInputStream,
|
NS_IMPL_ISUPPORTS2(nsStorageInputStream,
|
||||||
nsIInputStream,
|
nsIInputStream,
|
||||||
nsISeekableStream)
|
nsISeekableStream)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsStorageStream::NewInputStream(int32_t aStartingOffset, nsIInputStream* *aInputStream)
|
nsStorageStream::NewInputStream(int32_t aStartingOffset, nsIInputStream* *aInputStream)
|
||||||
|
|
|
@ -37,7 +37,7 @@ class nsStorageStream MOZ_FINAL : public nsIStorageStream,
|
||||||
public:
|
public:
|
||||||
nsStorageStream();
|
nsStorageStream();
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSISTORAGESTREAM
|
NS_DECL_NSISTORAGESTREAM
|
||||||
NS_DECL_NSIOUTPUTSTREAM
|
NS_DECL_NSIOUTPUTSTREAM
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ class nsInputStreamReadyEvent MOZ_FINAL : public nsIRunnable
|
||||||
, public nsIInputStreamCallback
|
, public nsIInputStreamCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
nsInputStreamReadyEvent(nsIInputStreamCallback *callback,
|
nsInputStreamReadyEvent(nsIInputStreamCallback *callback,
|
||||||
nsIEventTarget *target)
|
nsIEventTarget *target)
|
||||||
|
@ -91,8 +91,8 @@ private:
|
||||||
nsCOMPtr<nsIEventTarget> mTarget;
|
nsCOMPtr<nsIEventTarget> mTarget;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsInputStreamReadyEvent, nsIRunnable,
|
NS_IMPL_ISUPPORTS2(nsInputStreamReadyEvent, nsIRunnable,
|
||||||
nsIInputStreamCallback)
|
nsIInputStreamCallback)
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ class nsOutputStreamReadyEvent MOZ_FINAL : public nsIRunnable
|
||||||
, public nsIOutputStreamCallback
|
, public nsIOutputStreamCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
nsOutputStreamReadyEvent(nsIOutputStreamCallback *callback,
|
nsOutputStreamReadyEvent(nsIOutputStreamCallback *callback,
|
||||||
nsIEventTarget *target)
|
nsIEventTarget *target)
|
||||||
|
@ -169,8 +169,8 @@ private:
|
||||||
nsCOMPtr<nsIEventTarget> mTarget;
|
nsCOMPtr<nsIEventTarget> mTarget;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsOutputStreamReadyEvent, nsIRunnable,
|
NS_IMPL_ISUPPORTS2(nsOutputStreamReadyEvent, nsIRunnable,
|
||||||
nsIOutputStreamCallback)
|
nsIOutputStreamCallback)
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ class nsAStreamCopier : public nsIInputStreamCallback
|
||||||
, public nsIRunnable
|
, public nsIRunnable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
nsAStreamCopier()
|
nsAStreamCopier()
|
||||||
: mLock("nsAStreamCopier.mLock")
|
: mLock("nsAStreamCopier.mLock")
|
||||||
|
@ -459,10 +459,10 @@ protected:
|
||||||
nsresult mCancelStatus;
|
nsresult mCancelStatus;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS3(nsAStreamCopier,
|
NS_IMPL_ISUPPORTS3(nsAStreamCopier,
|
||||||
nsIInputStreamCallback,
|
nsIInputStreamCallback,
|
||||||
nsIOutputStreamCallback,
|
nsIOutputStreamCallback,
|
||||||
nsIRunnable)
|
nsIRunnable)
|
||||||
|
|
||||||
class nsStreamCopierIB MOZ_FINAL : public nsAStreamCopier
|
class nsStreamCopierIB MOZ_FINAL : public nsAStreamCopier
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,7 +35,7 @@ class nsStringInputStream MOZ_FINAL : public nsIStringInputStream
|
||||||
, public nsIIPCSerializableInputStream
|
, public nsIIPCSerializableInputStream
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIINPUTSTREAM
|
NS_DECL_NSIINPUTSTREAM
|
||||||
NS_DECL_NSISTRINGINPUTSTREAM
|
NS_DECL_NSISTRINGINPUTSTREAM
|
||||||
NS_DECL_NSISEEKABLESTREAM
|
NS_DECL_NSISEEKABLESTREAM
|
||||||
|
@ -78,8 +78,8 @@ private:
|
||||||
|
|
||||||
// This class needs to support threadsafe refcounting since people often
|
// This class needs to support threadsafe refcounting since people often
|
||||||
// allocate a string stream, and then read it from a background thread.
|
// allocate a string stream, and then read it from a background thread.
|
||||||
NS_IMPL_THREADSAFE_ADDREF(nsStringInputStream)
|
NS_IMPL_ADDREF(nsStringInputStream)
|
||||||
NS_IMPL_THREADSAFE_RELEASE(nsStringInputStream)
|
NS_IMPL_RELEASE(nsStringInputStream)
|
||||||
|
|
||||||
NS_IMPL_CLASSINFO(nsStringInputStream, NULL, nsIClassInfo::THREADSAFE,
|
NS_IMPL_CLASSINFO(nsStringInputStream, NULL, nsIClassInfo::THREADSAFE,
|
||||||
NS_STRINGINPUTSTREAM_CID)
|
NS_STRINGINPUTSTREAM_CID)
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespace mozilla {
|
||||||
class XPTInterfaceInfoManager MOZ_FINAL
|
class XPTInterfaceInfoManager MOZ_FINAL
|
||||||
: public nsIInterfaceInfoManager
|
: public nsIInterfaceInfoManager
|
||||||
{
|
{
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIINTERFACEINFOMANAGER
|
NS_DECL_NSIINTERFACEINFOMANAGER
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -595,7 +595,7 @@ xptiInterfaceInfo::~xptiInterfaceInfo()
|
||||||
nsrefcnt
|
nsrefcnt
|
||||||
xptiInterfaceInfo::AddRef(void)
|
xptiInterfaceInfo::AddRef(void)
|
||||||
{
|
{
|
||||||
nsrefcnt cnt = NS_AtomicIncrementRefcnt(mRefCnt);
|
nsrefcnt cnt = ++mRefCnt;
|
||||||
NS_LOG_ADDREF(this, cnt, "xptiInterfaceInfo", sizeof(*this));
|
NS_LOG_ADDREF(this, cnt, "xptiInterfaceInfo", sizeof(*this));
|
||||||
return cnt;
|
return cnt;
|
||||||
}
|
}
|
||||||
|
@ -604,7 +604,7 @@ nsrefcnt
|
||||||
xptiInterfaceInfo::Release(void)
|
xptiInterfaceInfo::Release(void)
|
||||||
{
|
{
|
||||||
xptiInterfaceEntry* entry = mEntry;
|
xptiInterfaceEntry* entry = mEntry;
|
||||||
nsrefcnt cnt = NS_AtomicDecrementRefcnt(mRefCnt);
|
nsrefcnt cnt = --mRefCnt;
|
||||||
NS_LOG_RELEASE(this, cnt, "xptiInterfaceInfo");
|
NS_LOG_RELEASE(this, cnt, "xptiInterfaceInfo");
|
||||||
if(!cnt)
|
if(!cnt)
|
||||||
{
|
{
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(XPTInterfaceInfoManager,
|
NS_IMPL_ISUPPORTS1(XPTInterfaceInfoManager,
|
||||||
nsIInterfaceInfoManager)
|
nsIInterfaceInfoManager)
|
||||||
|
|
||||||
static XPTInterfaceInfoManager* gInterfaceInfoManager = nullptr;
|
static XPTInterfaceInfoManager* gInterfaceInfoManager = nullptr;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|
|
@ -291,7 +291,7 @@ private:
|
||||||
class xptiInterfaceInfo MOZ_FINAL : public nsIInterfaceInfo
|
class xptiInterfaceInfo MOZ_FINAL : public nsIInterfaceInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
// Use delegation to implement (most!) of nsIInterfaceInfo.
|
// Use delegation to implement (most!) of nsIInterfaceInfo.
|
||||||
NS_IMETHOD GetName(char * *aName) { return !mEntry ? NS_ERROR_UNEXPECTED : mEntry->GetName(aName); }
|
NS_IMETHOD GetName(char * *aName) { return !mEntry ? NS_ERROR_UNEXPECTED : mEntry->GetName(aName); }
|
||||||
|
|
|
@ -106,7 +106,7 @@ WriteAll(nsIOutputStream *os, const char *buf, uint32_t bufLen, uint32_t *lenWri
|
||||||
|
|
||||||
class nsReceiver : public nsIRunnable {
|
class nsReceiver : public nsIRunnable {
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
NS_IMETHOD Run() {
|
NS_IMETHOD Run() {
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
@ -146,7 +146,7 @@ protected:
|
||||||
uint32_t mCount;
|
uint32_t mCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsReceiver, nsIRunnable)
|
NS_IMPL_ISUPPORTS1(nsReceiver, nsIRunnable)
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
TestPipe(nsIInputStream* in, nsIOutputStream* out)
|
TestPipe(nsIInputStream* in, nsIOutputStream* out)
|
||||||
|
@ -197,7 +197,7 @@ TestPipe(nsIInputStream* in, nsIOutputStream* out)
|
||||||
|
|
||||||
class nsShortReader : public nsIRunnable {
|
class nsShortReader : public nsIRunnable {
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
NS_IMETHOD Run() {
|
NS_IMETHOD Run() {
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
@ -261,7 +261,7 @@ protected:
|
||||||
Monitor* mMon;
|
Monitor* mMon;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsShortReader, nsIRunnable)
|
NS_IMPL_ISUPPORTS1(nsShortReader, nsIRunnable)
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
TestShortWrites(nsIInputStream* in, nsIOutputStream* out)
|
TestShortWrites(nsIInputStream* in, nsIOutputStream* out)
|
||||||
|
@ -316,7 +316,7 @@ TestShortWrites(nsIInputStream* in, nsIOutputStream* out)
|
||||||
class nsPump : public nsIRunnable
|
class nsPump : public nsIRunnable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
NS_IMETHOD Run() {
|
NS_IMETHOD Run() {
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
@ -352,8 +352,7 @@ protected:
|
||||||
uint32_t mCount;
|
uint32_t mCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsPump,
|
NS_IMPL_ISUPPORTS1(nsPump, nsIRunnable)
|
||||||
nsIRunnable)
|
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
TestChainedPipes()
|
TestChainedPipes()
|
||||||
|
|
|
@ -87,7 +87,7 @@ private:
|
||||||
class Factory MOZ_FINAL : public nsIFactory
|
class Factory MOZ_FINAL : public nsIFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
Factory() : mFirstComponentCreated(false) { }
|
Factory() : mFirstComponentCreated(false) { }
|
||||||
|
|
||||||
|
@ -102,12 +102,12 @@ public:
|
||||||
bool mFirstComponentCreated;
|
bool mFirstComponentCreated;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(Factory, nsIFactory)
|
NS_IMPL_ISUPPORTS1(Factory, nsIFactory)
|
||||||
|
|
||||||
class Component1 MOZ_FINAL : public nsISupports
|
class Component1 MOZ_FINAL : public nsISupports
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
Component1() {
|
Component1() {
|
||||||
// This is the real test - make sure that only one instance is ever created.
|
// This is the real test - make sure that only one instance is ever created.
|
||||||
|
@ -116,8 +116,8 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ADDREF(Component1)
|
NS_IMPL_ADDREF(Component1)
|
||||||
NS_IMPL_THREADSAFE_RELEASE(Component1)
|
NS_IMPL_RELEASE(Component1)
|
||||||
|
|
||||||
NS_INTERFACE_MAP_BEGIN(Component1)
|
NS_INTERFACE_MAP_BEGIN(Component1)
|
||||||
NS_INTERFACE_MAP_ENTRY(Component1)
|
NS_INTERFACE_MAP_ENTRY(Component1)
|
||||||
|
@ -127,7 +127,7 @@ NS_INTERFACE_MAP_END
|
||||||
class Component2 MOZ_FINAL : public nsISupports
|
class Component2 MOZ_FINAL : public nsISupports
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
Component2() {
|
Component2() {
|
||||||
// This is the real test - make sure that only one instance is ever created.
|
// This is the real test - make sure that only one instance is ever created.
|
||||||
|
@ -136,8 +136,8 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ADDREF(Component2)
|
NS_IMPL_ADDREF(Component2)
|
||||||
NS_IMPL_THREADSAFE_RELEASE(Component2)
|
NS_IMPL_RELEASE(Component2)
|
||||||
|
|
||||||
NS_INTERFACE_MAP_BEGIN(Component2)
|
NS_INTERFACE_MAP_BEGIN(Component2)
|
||||||
NS_INTERFACE_MAP_ENTRY(Component2)
|
NS_INTERFACE_MAP_ENTRY(Component2)
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
class Task : public nsIRunnable
|
class Task : public nsIRunnable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
Task(int i) : mIndex(i) {}
|
Task(int i) : mIndex(i) {}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ public:
|
||||||
private:
|
private:
|
||||||
int mIndex;
|
int mIndex;
|
||||||
};
|
};
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(Task, nsIRunnable)
|
NS_IMPL_ISUPPORTS1(Task, nsIRunnable)
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
RunTests()
|
RunTests()
|
||||||
|
|
|
@ -48,11 +48,11 @@ static bool gAllThreadsShutDown = false;
|
||||||
class Listener MOZ_FINAL : public nsIThreadPoolListener
|
class Listener MOZ_FINAL : public nsIThreadPoolListener
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSITHREADPOOLLISTENER
|
NS_DECL_NSITHREADPOOLLISTENER
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(Listener, nsIThreadPoolListener)
|
NS_IMPL_ISUPPORTS1(Listener, nsIThreadPoolListener)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
Listener::OnThreadCreated()
|
Listener::OnThreadCreated()
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
class nsRunner : public nsIRunnable {
|
class nsRunner : public nsIRunnable {
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
NS_IMETHOD Run() {
|
NS_IMETHOD Run() {
|
||||||
nsCOMPtr<nsIThread> thread;
|
nsCOMPtr<nsIThread> thread;
|
||||||
|
@ -38,7 +38,7 @@ protected:
|
||||||
int mNum;
|
int mNum;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsRunner, nsIRunnable)
|
NS_IMPL_ISUPPORTS1(nsRunner, nsIRunnable)
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
TestThreads()
|
TestThreads()
|
||||||
|
@ -75,7 +75,7 @@ TestThreads()
|
||||||
|
|
||||||
class nsStressRunner : public nsIRunnable {
|
class nsStressRunner : public nsIRunnable {
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
NS_IMETHOD Run() {
|
NS_IMETHOD Run() {
|
||||||
NS_ASSERTION(!mWasRun, "run twice!");
|
NS_ASSERTION(!mWasRun, "run twice!");
|
||||||
|
@ -106,7 +106,7 @@ protected:
|
||||||
|
|
||||||
int32_t nsStressRunner::gNum = 0;
|
int32_t nsStressRunner::gNum = 0;
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsStressRunner, nsIRunnable)
|
NS_IMPL_ISUPPORTS1(nsStressRunner, nsIRunnable)
|
||||||
|
|
||||||
static int Stress(int loops, int threads)
|
static int Stress(int loops, int threads)
|
||||||
{
|
{
|
||||||
|
|
|
@ -72,7 +72,7 @@ private:
|
||||||
class TimerCallback MOZ_FINAL : public nsITimerCallback
|
class TimerCallback MOZ_FINAL : public nsITimerCallback
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
|
|
||||||
TimerCallback(nsIThread** aThreadPtr, ReentrantMonitor* aReentrantMonitor)
|
TimerCallback(nsIThread** aThreadPtr, ReentrantMonitor* aReentrantMonitor)
|
||||||
: mThreadPtr(aThreadPtr), mReentrantMonitor(aReentrantMonitor) { }
|
: mThreadPtr(aThreadPtr), mReentrantMonitor(aReentrantMonitor) { }
|
||||||
|
@ -94,7 +94,7 @@ private:
|
||||||
ReentrantMonitor* mReentrantMonitor;
|
ReentrantMonitor* mReentrantMonitor;
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(TimerCallback, nsITimerCallback)
|
NS_IMPL_ISUPPORTS1(TimerCallback, nsITimerCallback)
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
TestTargetedTimers()
|
TestTargetedTimers()
|
||||||
|
|
|
@ -334,12 +334,12 @@ LazyIdleThread::SelfDestruct()
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ADDREF(LazyIdleThread)
|
NS_IMPL_ADDREF(LazyIdleThread)
|
||||||
|
|
||||||
NS_IMETHODIMP_(nsrefcnt)
|
NS_IMETHODIMP_(nsrefcnt)
|
||||||
LazyIdleThread::Release()
|
LazyIdleThread::Release()
|
||||||
{
|
{
|
||||||
nsrefcnt count = NS_AtomicDecrementRefcnt(mRefCnt);
|
nsrefcnt count = --mRefCnt;
|
||||||
NS_LOG_RELEASE(this, count, "LazyIdleThread");
|
NS_LOG_RELEASE(this, count, "LazyIdleThread");
|
||||||
|
|
||||||
if (!count) {
|
if (!count) {
|
||||||
|
@ -363,11 +363,11 @@ LazyIdleThread::Release()
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_QUERY_INTERFACE5(LazyIdleThread, nsIThread,
|
NS_IMPL_QUERY_INTERFACE5(LazyIdleThread, nsIThread,
|
||||||
nsIEventTarget,
|
nsIEventTarget,
|
||||||
nsITimerCallback,
|
nsITimerCallback,
|
||||||
nsIThreadObserver,
|
nsIThreadObserver,
|
||||||
nsIObserver)
|
nsIObserver)
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
LazyIdleThread::Dispatch(nsIRunnable* aEvent,
|
LazyIdleThread::Dispatch(nsIRunnable* aEvent,
|
||||||
|
|
|
@ -38,7 +38,7 @@ class LazyIdleThread MOZ_FINAL : public nsIThread,
|
||||||
public nsIObserver
|
public nsIObserver
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIEVENTTARGET
|
NS_DECL_NSIEVENTTARGET
|
||||||
NS_DECL_NSITHREAD
|
NS_DECL_NSITHREAD
|
||||||
NS_DECL_NSITIMERCALLBACK
|
NS_DECL_NSITIMERCALLBACK
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS2(TimerThread, nsIRunnable, nsIObserver)
|
NS_IMPL_ISUPPORTS2(TimerThread, nsIRunnable, nsIObserver)
|
||||||
|
|
||||||
TimerThread::TimerThread() :
|
TimerThread::TimerThread() :
|
||||||
mInitInProgress(0),
|
mInitInProgress(0),
|
||||||
|
|
|
@ -30,7 +30,7 @@ public:
|
||||||
TimerThread();
|
TimerThread();
|
||||||
NS_HIDDEN_(nsresult) InitLocks();
|
NS_HIDDEN_(nsresult) InitLocks();
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIRUNNABLE
|
NS_DECL_NSIRUNNABLE
|
||||||
NS_DECL_NSIOBSERVER
|
NS_DECL_NSIOBSERVER
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsEnvironment, nsIEnvironment)
|
NS_IMPL_ISUPPORTS1(nsEnvironment, nsIEnvironment)
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsEnvironment::Create(nsISupports *aOuter, REFNSIID aIID,
|
nsEnvironment::Create(nsISupports *aOuter, REFNSIID aIID,
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
class nsEnvironment MOZ_FINAL : public nsIEnvironment
|
class nsEnvironment MOZ_FINAL : public nsIEnvironment
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIENVIRONMENT
|
NS_DECL_NSIENVIRONMENT
|
||||||
|
|
||||||
static nsresult Create(nsISupports *aOuter, REFNSIID aIID,
|
static nsresult Create(nsISupports *aOuter, REFNSIID aIID,
|
||||||
|
|
|
@ -36,7 +36,7 @@ class nsProcess MOZ_FINAL : public nsIProcess,
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIPROCESS
|
NS_DECL_NSIPROCESS
|
||||||
NS_DECL_NSIOBSERVER
|
NS_DECL_NSIOBSERVER
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,8 @@ cpu_type_t pref_cpu_types[2] = {
|
||||||
//-------------------------------------------------------------------//
|
//-------------------------------------------------------------------//
|
||||||
// nsIProcess implementation
|
// nsIProcess implementation
|
||||||
//-------------------------------------------------------------------//
|
//-------------------------------------------------------------------//
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS2(nsProcess, nsIProcess,
|
NS_IMPL_ISUPPORTS2(nsProcess, nsIProcess,
|
||||||
nsIObserver)
|
nsIObserver)
|
||||||
|
|
||||||
//Constructor
|
//Constructor
|
||||||
nsProcess::nsProcess()
|
nsProcess::nsProcess()
|
||||||
|
|
|
@ -130,8 +130,8 @@ nsThreadClassInfo::GetClassIDNoAlloc(nsCID *result)
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ADDREF(nsThread)
|
NS_IMPL_ADDREF(nsThread)
|
||||||
NS_IMPL_THREADSAFE_RELEASE(nsThread)
|
NS_IMPL_RELEASE(nsThread)
|
||||||
NS_INTERFACE_MAP_BEGIN(nsThread)
|
NS_INTERFACE_MAP_BEGIN(nsThread)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIThread)
|
NS_INTERFACE_MAP_ENTRY(nsIThread)
|
||||||
NS_INTERFACE_MAP_ENTRY(nsIThreadInternal)
|
NS_INTERFACE_MAP_ENTRY(nsIThreadInternal)
|
||||||
|
|
|
@ -21,7 +21,7 @@ class nsThread MOZ_FINAL : public nsIThreadInternal,
|
||||||
public nsISupportsPriority
|
public nsISupportsPriority
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIEVENTTARGET
|
NS_DECL_NSIEVENTTARGET
|
||||||
NS_DECL_NSITHREAD
|
NS_DECL_NSITHREAD
|
||||||
NS_DECL_NSITHREADINTERNAL
|
NS_DECL_NSITHREADINTERNAL
|
||||||
|
|
|
@ -37,8 +37,8 @@ GetThreadPoolLog()
|
||||||
#define DEFAULT_IDLE_THREAD_LIMIT 1
|
#define DEFAULT_IDLE_THREAD_LIMIT 1
|
||||||
#define DEFAULT_IDLE_THREAD_TIMEOUT PR_SecondsToInterval(60)
|
#define DEFAULT_IDLE_THREAD_TIMEOUT PR_SecondsToInterval(60)
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ADDREF(nsThreadPool)
|
NS_IMPL_ADDREF(nsThreadPool)
|
||||||
NS_IMPL_THREADSAFE_RELEASE(nsThreadPool)
|
NS_IMPL_RELEASE(nsThreadPool)
|
||||||
NS_IMPL_CLASSINFO(nsThreadPool, NULL, nsIClassInfo::THREADSAFE,
|
NS_IMPL_CLASSINFO(nsThreadPool, NULL, nsIClassInfo::THREADSAFE,
|
||||||
NS_THREADPOOL_CID)
|
NS_THREADPOOL_CID)
|
||||||
NS_IMPL_QUERY_INTERFACE3_CI(nsThreadPool, nsIThreadPool, nsIEventTarget,
|
NS_IMPL_QUERY_INTERFACE3_CI(nsThreadPool, nsIThreadPool, nsIEventTarget,
|
||||||
|
|
|
@ -20,7 +20,7 @@ class nsThreadPool MOZ_FINAL : public nsIThreadPool,
|
||||||
public nsIRunnable
|
public nsIRunnable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSIEVENTTARGET
|
NS_DECL_NSIEVENTTARGET
|
||||||
NS_DECL_NSITHREADPOOL
|
NS_DECL_NSITHREADPOOL
|
||||||
NS_DECL_NSIRUNNABLE
|
NS_DECL_NSIRUNNABLE
|
||||||
|
|
|
@ -188,15 +188,15 @@ void TimerEventAllocator::Free(void* aPtr)
|
||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_QUERY_INTERFACE1(nsTimerImpl, nsITimer)
|
NS_IMPL_QUERY_INTERFACE1(nsTimerImpl, nsITimer)
|
||||||
NS_IMPL_THREADSAFE_ADDREF(nsTimerImpl)
|
NS_IMPL_ADDREF(nsTimerImpl)
|
||||||
|
|
||||||
NS_IMETHODIMP_(nsrefcnt) nsTimerImpl::Release(void)
|
NS_IMETHODIMP_(nsrefcnt) nsTimerImpl::Release(void)
|
||||||
{
|
{
|
||||||
nsrefcnt count;
|
nsrefcnt count;
|
||||||
|
|
||||||
MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");
|
MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");
|
||||||
count = NS_AtomicDecrementRefcnt(mRefCnt);
|
count = --mRefCnt;
|
||||||
NS_LOG_RELEASE(this, count, "nsTimerImpl");
|
NS_LOG_RELEASE(this, count, "nsTimerImpl");
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
mRefCnt = 1; /* stabilize */
|
mRefCnt = 1; /* stabilize */
|
||||||
|
|
|
@ -57,7 +57,7 @@ public:
|
||||||
nsresult PostTimerEvent();
|
nsresult PostTimerEvent();
|
||||||
void SetDelayInternal(uint32_t aDelay);
|
void SetDelayInternal(uint32_t aDelay);
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_THREADSAFE_ISUPPORTS
|
||||||
NS_DECL_NSITIMER
|
NS_DECL_NSITIMER
|
||||||
|
|
||||||
int32_t GetGeneration() { return mGeneration; }
|
int32_t GetGeneration() { return mGeneration; }
|
||||||
|
|
Загрузка…
Ссылка в новой задаче