diff --git a/xpcom/base/MapsMemoryReporter.cpp b/xpcom/base/MapsMemoryReporter.cpp index e95ddf112e44..a76732ed6bfb 100644 --- a/xpcom/base/MapsMemoryReporter.cpp +++ b/xpcom/base/MapsMemoryReporter.cpp @@ -116,7 +116,7 @@ class MapsReporter MOZ_FINAL : public nsIMemoryMultiReporter public: MapsReporter(); - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_IMETHOD GetName(nsACString &aName) { @@ -158,7 +158,7 @@ private: nsTHashtable mMozillaLibraries; }; -NS_IMPL_THREADSAFE_ISUPPORTS1(MapsReporter, nsIMemoryMultiReporter) +NS_IMPL_ISUPPORTS1(MapsReporter, nsIMemoryMultiReporter) MapsReporter::MapsReporter() : mSearchedForLibxul(false) diff --git a/xpcom/base/nsConsoleMessage.cpp b/xpcom/base/nsConsoleMessage.cpp index df0c2b3de704..1af435eb4eac 100644 --- a/xpcom/base/nsConsoleMessage.cpp +++ b/xpcom/base/nsConsoleMessage.cpp @@ -11,7 +11,7 @@ #include "nsReadableUtils.h" #include "jsapi.h" -NS_IMPL_THREADSAFE_ISUPPORTS1(nsConsoleMessage, nsIConsoleMessage) +NS_IMPL_ISUPPORTS1(nsConsoleMessage, nsIConsoleMessage) nsConsoleMessage::nsConsoleMessage() : mTimeStamp(0), diff --git a/xpcom/base/nsConsoleMessage.h b/xpcom/base/nsConsoleMessage.h index 95fbd3864def..706f7fd7b5d0 100644 --- a/xpcom/base/nsConsoleMessage.h +++ b/xpcom/base/nsConsoleMessage.h @@ -16,7 +16,7 @@ public: nsConsoleMessage(); nsConsoleMessage(const PRUnichar *message); - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSICONSOLEMESSAGE private: diff --git a/xpcom/base/nsConsoleService.cpp b/xpcom/base/nsConsoleService.cpp index f6438a90ae9c..b072c1247893 100644 --- a/xpcom/base/nsConsoleService.cpp +++ b/xpcom/base/nsConsoleService.cpp @@ -31,8 +31,8 @@ using namespace mozilla; -NS_IMPL_THREADSAFE_ADDREF(nsConsoleService) -NS_IMPL_THREADSAFE_RELEASE(nsConsoleService) +NS_IMPL_ADDREF(nsConsoleService) +NS_IMPL_RELEASE(nsConsoleService) NS_IMPL_CLASSINFO(nsConsoleService, NULL, nsIClassInfo::THREADSAFE | nsIClassInfo::SINGLETON, NS_CONSOLESERVICE_CID) NS_IMPL_QUERY_INTERFACE1_CI(nsConsoleService, nsIConsoleService) NS_IMPL_CI_INTERFACE_GETTER1(nsConsoleService, nsIConsoleService) diff --git a/xpcom/base/nsConsoleService.h b/xpcom/base/nsConsoleService.h index e69d5a02299d..4862bdc41019 100644 --- a/xpcom/base/nsConsoleService.h +++ b/xpcom/base/nsConsoleService.h @@ -25,7 +25,7 @@ public: nsConsoleService(); nsresult Init(); - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSICONSOLESERVICE void SetIsDelivering() { diff --git a/xpcom/base/nsExceptionService.cpp b/xpcom/base/nsExceptionService.cpp index d6654e29d0d0..7c4cf4e2dd94 100644 --- a/xpcom/base/nsExceptionService.cpp +++ b/xpcom/base/nsExceptionService.cpp @@ -42,7 +42,7 @@ public: class nsExceptionManager MOZ_FINAL : public nsIExceptionManager { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIEXCEPTIONMANAGER nsExceptionManager(nsExceptionService *svc); @@ -67,7 +67,7 @@ int32_t nsExceptionManager::totalInstances = 0; // one per thread. // An exception if the destructor, which may be called on // the thread shutting down xpcom -NS_IMPL_THREADSAFE_ISUPPORTS1(nsExceptionManager, nsIExceptionManager) +NS_IMPL_ISUPPORTS1(nsExceptionManager, nsIExceptionManager) nsExceptionManager::nsExceptionManager(nsExceptionService *svc) : mNextThread(nullptr), @@ -122,10 +122,10 @@ nsExceptionManager *nsExceptionService::firstThread = nullptr; int32_t nsExceptionService::totalInstances = 0; #endif -NS_IMPL_THREADSAFE_ISUPPORTS3(nsExceptionService, - nsIExceptionService, - nsIExceptionManager, - nsIObserver) +NS_IMPL_ISUPPORTS3(nsExceptionService, + nsIExceptionService, + nsIExceptionManager, + nsIObserver) nsExceptionService::nsExceptionService() : mProviders(4, true) /* small, thread-safe hashtable */ diff --git a/xpcom/base/nsExceptionService.h b/xpcom/base/nsExceptionService.h index 3e8c11ba485f..ee86f9a42854 100644 --- a/xpcom/base/nsExceptionService.h +++ b/xpcom/base/nsExceptionService.h @@ -21,7 +21,7 @@ class nsExceptionManager; class nsExceptionService MOZ_FINAL : public nsIExceptionService, public nsIObserver { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIEXCEPTIONSERVICE NS_DECL_NSIEXCEPTIONMANAGER NS_DECL_NSIOBSERVER diff --git a/xpcom/base/nsIMemoryReporter.idl b/xpcom/base/nsIMemoryReporter.idl index 6e77741d0f1b..b398bc4e3a43 100644 --- a/xpcom/base/nsIMemoryReporter.idl +++ b/xpcom/base/nsIMemoryReporter.idl @@ -310,7 +310,7 @@ interface nsIMemoryReporterManager : nsISupports #define NS_MEMORY_REPORTER_IMPLEMENT_HELPER(_classname, _path, _kind, _units, _amountFunction, _desc, _ts) \ class MemoryReporter_##_classname MOZ_FINAL : public nsIMemoryReporter { \ public: \ - NS_DECL_ISUPPORTS \ + NS_DECL##_ts##ISUPPORTS \ NS_IMETHOD GetProcess(nsACString &process) { process.Truncate(); return NS_OK; } \ NS_IMETHOD GetPath(nsACString &memoryPath) { memoryPath.AssignLiteral(_path); 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 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 // is that the function used to implement GetAmount is fallible. #define NS_FALLIBLE_MEMORY_REPORTER_IMPLEMENT_HELPER(_classname, _path, _kind, _units, _amountFunction, _desc, _ts) \ class MemoryReporter_##_classname MOZ_FINAL : public nsIMemoryReporter { \ public: \ - NS_DECL_ISUPPORTS \ + NS_DECL##_ts##ISUPPORTS \ NS_IMETHOD GetProcess(nsACString &process) { process.Truncate(); 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; } \ @@ -333,7 +333,7 @@ interface nsIMemoryReporterManager : nsISupports NS_IMETHOD GetAmount(int64_t *amount) { return _amountFunction(amount); } \ 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) \ NS_MEMORY_REPORTER_IMPLEMENT_HELPER(_c, _p, _k, _u, _a, _d, _) @@ -448,7 +448,7 @@ public: virtual ~MemoryReporterBase() {} - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_IMETHOD GetProcess(nsACString& aProcess) { diff --git a/xpcom/base/nsInterfaceRequestorAgg.cpp b/xpcom/base/nsInterfaceRequestorAgg.cpp index a9fe01773846..4408d5659016 100644 --- a/xpcom/base/nsInterfaceRequestorAgg.cpp +++ b/xpcom/base/nsInterfaceRequestorAgg.cpp @@ -11,7 +11,8 @@ class nsInterfaceRequestorAgg MOZ_FINAL : public nsIInterfaceRequestor { public: - NS_DECL_ISUPPORTS + // XXX This needs to support threadsafe refcounting until we fix bug 243591. + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIINTERFACEREQUESTOR nsInterfaceRequestorAgg(nsIInterfaceRequestor *aFirst, @@ -32,8 +33,7 @@ private: nsCOMPtr mConsumerTarget; }; -// XXX This needs to support threadsafe refcounting until we fix bug 243591. -NS_IMPL_THREADSAFE_ISUPPORTS1(nsInterfaceRequestorAgg, nsIInterfaceRequestor) +NS_IMPL_ISUPPORTS1(nsInterfaceRequestorAgg, nsIInterfaceRequestor) NS_IMETHODIMP nsInterfaceRequestorAgg::GetInterface(const nsIID &aIID, void **aResult) diff --git a/xpcom/base/nsMemoryInfoDumper.cpp b/xpcom/base/nsMemoryInfoDumper.cpp index 658a1d963015..7c2a6be0ca64 100644 --- a/xpcom/base/nsMemoryInfoDumper.cpp +++ b/xpcom/base/nsMemoryInfoDumper.cpp @@ -191,7 +191,7 @@ public: virtual void OnFileCanReadWithoutBlocking(int aFd) = 0; virtual void OnFileCanWriteWithoutBlocking(int aFd) {}; - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS /** * 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 { diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index b498c4b28f89..0d4b1f0152be 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -682,7 +682,7 @@ NS_IMPL_ISUPPORTS1(DMDMultiReporter, nsIMemoryMultiReporter) ** nsMemoryReporterManager implementation **/ -NS_IMPL_THREADSAFE_ISUPPORTS1(nsMemoryReporterManager, nsIMemoryReporterManager) +NS_IMPL_ISUPPORTS1(nsMemoryReporterManager, nsIMemoryReporterManager) NS_IMETHODIMP nsMemoryReporterManager::Init() @@ -1199,7 +1199,7 @@ nsMemoryReporterManager::MinimizeMemoryUsage(nsIRunnable* aCallback, // 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 // infrequently enough that the performance cost should be negligible. -NS_IMPL_THREADSAFE_ISUPPORTS1(MemoryReporterBase, nsIMemoryReporter) +NS_IMPL_ISUPPORTS1(MemoryReporterBase, nsIMemoryReporter) nsresult NS_RegisterMemoryReporter (nsIMemoryReporter *reporter) diff --git a/xpcom/base/nsMemoryReporterManager.h b/xpcom/base/nsMemoryReporterManager.h index a581b1ab8358..3b22ce011b65 100644 --- a/xpcom/base/nsMemoryReporterManager.h +++ b/xpcom/base/nsMemoryReporterManager.h @@ -16,7 +16,7 @@ using mozilla::Mutex; class nsMemoryReporterManager : public nsIMemoryReporterManager { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIMEMORYREPORTERMANAGER nsMemoryReporterManager(); diff --git a/xpcom/base/nsUUIDGenerator.cpp b/xpcom/base/nsUUIDGenerator.cpp index 872037285c80..3ca3d3280903 100644 --- a/xpcom/base/nsUUIDGenerator.cpp +++ b/xpcom/base/nsUUIDGenerator.cpp @@ -19,7 +19,7 @@ using namespace mozilla; -NS_IMPL_THREADSAFE_ISUPPORTS1(nsUUIDGenerator, nsIUUIDGenerator) +NS_IMPL_ISUPPORTS1(nsUUIDGenerator, nsIUUIDGenerator) nsUUIDGenerator::nsUUIDGenerator() : mLock("nsUUIDGenerator.mLock") diff --git a/xpcom/base/nsUUIDGenerator.h b/xpcom/base/nsUUIDGenerator.h index b7df6e50c54a..62d059325a51 100644 --- a/xpcom/base/nsUUIDGenerator.h +++ b/xpcom/base/nsUUIDGenerator.h @@ -15,7 +15,7 @@ class nsUUIDGenerator MOZ_FINAL : public nsIUUIDGenerator { public: nsUUIDGenerator(); - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIUUIDGENERATOR diff --git a/xpcom/components/ModuleUtils.h b/xpcom/components/ModuleUtils.h index 5cb99e66a07f..4cc56a5f2b7f 100644 --- a/xpcom/components/ModuleUtils.h +++ b/xpcom/components/ModuleUtils.h @@ -110,7 +110,7 @@ public: { } - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIMODULE private: diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp index fd86a5b7443d..3ed89ff3559f 100644 --- a/xpcom/components/nsComponentManager.cpp +++ b/xpcom/components/nsComponentManager.cpp @@ -834,12 +834,12 @@ nsComponentManagerImpl::~nsComponentManagerImpl() PR_LOG(nsComponentManagerLog, PR_LOG_DEBUG, ("nsComponentManager: Destroyed.")); } -NS_IMPL_THREADSAFE_ISUPPORTS5(nsComponentManagerImpl, - nsIComponentManager, - nsIServiceManager, - nsIComponentRegistrar, - nsISupportsWeakReference, - nsIInterfaceRequestor) +NS_IMPL_ISUPPORTS5(nsComponentManagerImpl, + nsIComponentManager, + nsIServiceManager, + nsIComponentRegistrar, + nsISupportsWeakReference, + nsIInterfaceRequestor) nsresult diff --git a/xpcom/components/nsComponentManager.h b/xpcom/components/nsComponentManager.h index be605ac721ec..f3c27d1c43d7 100644 --- a/xpcom/components/nsComponentManager.h +++ b/xpcom/components/nsComponentManager.h @@ -126,7 +126,7 @@ class nsComponentManagerImpl MOZ_FINAL , public nsIInterfaceRequestor { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSICOMPONENTMANAGER NS_DECL_NSICOMPONENTREGISTRAR diff --git a/xpcom/ds/nsAtomService.cpp b/xpcom/ds/nsAtomService.cpp index 4c7d26162a79..1ecbac3e69ee 100644 --- a/xpcom/ds/nsAtomService.cpp +++ b/xpcom/ds/nsAtomService.cpp @@ -5,7 +5,7 @@ #include "nsAtomService.h" -NS_IMPL_THREADSAFE_ISUPPORTS1(nsAtomService, nsIAtomService) +NS_IMPL_ISUPPORTS1(nsAtomService, nsIAtomService) nsAtomService::nsAtomService() { diff --git a/xpcom/ds/nsAtomService.h b/xpcom/ds/nsAtomService.h index 0b4ad483402d..816409004c88 100644 --- a/xpcom/ds/nsAtomService.h +++ b/xpcom/ds/nsAtomService.h @@ -13,7 +13,7 @@ class nsAtomService MOZ_FINAL : public nsIAtomService { public: nsAtomService(); - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIATOMSERVICE diff --git a/xpcom/ds/nsHashPropertyBag.cpp b/xpcom/ds/nsHashPropertyBag.cpp index ee0c06b340bf..5ce8471bfaaa 100644 --- a/xpcom/ds/nsHashPropertyBag.cpp +++ b/xpcom/ds/nsHashPropertyBag.cpp @@ -36,8 +36,8 @@ NS_NewHashPropertyBag(nsIWritablePropertyBag* *_retval) * nsHashPropertyBag impl */ -NS_IMPL_THREADSAFE_ADDREF(nsHashPropertyBag) -NS_IMPL_THREADSAFE_RELEASE(nsHashPropertyBag) +NS_IMPL_ADDREF(nsHashPropertyBag) +NS_IMPL_RELEASE(nsHashPropertyBag) NS_INTERFACE_MAP_BEGIN(nsHashPropertyBag) NS_INTERFACE_MAP_ENTRY(nsIWritablePropertyBag) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIPropertyBag, nsIWritablePropertyBag) diff --git a/xpcom/ds/nsHashPropertyBag.h b/xpcom/ds/nsHashPropertyBag.h index e91820e44ba7..ef072b9033b9 100644 --- a/xpcom/ds/nsHashPropertyBag.h +++ b/xpcom/ds/nsHashPropertyBag.h @@ -23,7 +23,7 @@ public: nsresult Init(); - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIPROPERTYBAG diff --git a/xpcom/ds/nsObserverService.cpp b/xpcom/ds/nsObserverService.cpp index 572b65228def..cb9cb4d1e31e 100644 --- a/xpcom/ds/nsObserverService.cpp +++ b/xpcom/ds/nsObserverService.cpp @@ -48,7 +48,7 @@ GetObserverServiceLog() // nsObserverService Implementation -NS_IMPL_THREADSAFE_ISUPPORTS2(nsObserverService, nsIObserverService, nsObserverService) +NS_IMPL_ISUPPORTS2(nsObserverService, nsIObserverService, nsObserverService) nsObserverService::nsObserverService() : mShuttingDown(false) diff --git a/xpcom/ds/nsObserverService.h b/xpcom/ds/nsObserverService.h index 53e27f2a8ada..31d8b152226b 100644 --- a/xpcom/ds/nsObserverService.h +++ b/xpcom/ds/nsObserverService.h @@ -21,7 +21,7 @@ public: nsObserverService(); - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIOBSERVERSERVICE void Shutdown(); diff --git a/xpcom/ds/nsPersistentProperties.cpp b/xpcom/ds/nsPersistentProperties.cpp index 094bd144f904..db5e6dcbe43f 100644 --- a/xpcom/ds/nsPersistentProperties.cpp +++ b/xpcom/ds/nsPersistentProperties.cpp @@ -494,7 +494,7 @@ nsPersistentProperties::Create(nsISupports *aOuter, REFNSIID aIID, void **aResul return rv; } -NS_IMPL_THREADSAFE_ISUPPORTS2(nsPersistentProperties, nsIPersistentProperties, nsIProperties) +NS_IMPL_ISUPPORTS2(nsPersistentProperties, nsIPersistentProperties, nsIProperties) NS_IMETHODIMP nsPersistentProperties::Load(nsIInputStream *aIn) diff --git a/xpcom/ds/nsPersistentProperties.h b/xpcom/ds/nsPersistentProperties.h index 83360e967a8e..668d653ed319 100644 --- a/xpcom/ds/nsPersistentProperties.h +++ b/xpcom/ds/nsPersistentProperties.h @@ -22,7 +22,7 @@ public: nsPersistentProperties(); nsresult Init(); - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIPROPERTIES NS_DECL_NSIPERSISTENTPROPERTIES diff --git a/xpcom/ds/nsSupportsArray.cpp b/xpcom/ds/nsSupportsArray.cpp index 950f95272f71..3a174d417e59 100644 --- a/xpcom/ds/nsSupportsArray.cpp +++ b/xpcom/ds/nsSupportsArray.cpp @@ -174,7 +174,7 @@ nsSupportsArray::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult) return it->QueryInterface(aIID, aResult); } -NS_IMPL_THREADSAFE_ISUPPORTS3(nsSupportsArray, nsISupportsArray, nsICollection, nsISerializable) +NS_IMPL_ISUPPORTS3(nsSupportsArray, nsISupportsArray, nsICollection, nsISerializable) NS_IMETHODIMP nsSupportsArray::Read(nsIObjectInputStream *aStream) diff --git a/xpcom/ds/nsSupportsArray.h b/xpcom/ds/nsSupportsArray.h index d3856944117b..6346513604b3 100644 --- a/xpcom/ds/nsSupportsArray.h +++ b/xpcom/ds/nsSupportsArray.h @@ -21,7 +21,7 @@ public: static nsresult Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISERIALIZABLE diff --git a/xpcom/ds/nsSupportsPrimitives.cpp b/xpcom/ds/nsSupportsPrimitives.cpp index 024bef731db3..eca65e9ffcdf 100644 --- a/xpcom/ds/nsSupportsPrimitives.cpp +++ b/xpcom/ds/nsSupportsPrimitives.cpp @@ -146,8 +146,8 @@ NS_IMETHODIMP nsSupportsStringImpl::SetData(const nsAString& aData) /***************************************************************************/ -NS_IMPL_THREADSAFE_ISUPPORTS2(nsSupportsPRBoolImpl, nsISupportsPRBool, - nsISupportsPrimitive) +NS_IMPL_ISUPPORTS2(nsSupportsPRBoolImpl, nsISupportsPRBool, + nsISupportsPrimitive) nsSupportsPRBoolImpl::nsSupportsPRBoolImpl() : mData(false) @@ -683,8 +683,8 @@ NS_IMETHODIMP nsSupportsDoubleImpl::ToString(char **_retval) /***************************************************************************/ -NS_IMPL_THREADSAFE_ISUPPORTS2(nsSupportsVoidImpl, nsISupportsVoid, - nsISupportsPrimitive) +NS_IMPL_ISUPPORTS2(nsSupportsVoidImpl, nsISupportsVoid, + nsISupportsPrimitive) nsSupportsVoidImpl::nsSupportsVoidImpl() : mData(nullptr) @@ -725,9 +725,9 @@ NS_IMETHODIMP nsSupportsVoidImpl::ToString(char **_retval) /***************************************************************************/ -NS_IMPL_THREADSAFE_ISUPPORTS2(nsSupportsInterfacePointerImpl, - nsISupportsInterfacePointer, - nsISupportsPrimitive) +NS_IMPL_ISUPPORTS2(nsSupportsInterfacePointerImpl, + nsISupportsInterfacePointer, + nsISupportsPrimitive) nsSupportsInterfacePointerImpl::nsSupportsInterfacePointerImpl() : mIID(nullptr) diff --git a/xpcom/ds/nsSupportsPrimitives.h b/xpcom/ds/nsSupportsPrimitives.h index b1fbebba7c9d..e9f167692427 100644 --- a/xpcom/ds/nsSupportsPrimitives.h +++ b/xpcom/ds/nsSupportsPrimitives.h @@ -67,7 +67,7 @@ private: class nsSupportsPRBoolImpl MOZ_FINAL : public nsISupportsPRBool { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISUPPORTSPRIMITIVE NS_DECL_NSISUPPORTSPRBOOL @@ -271,7 +271,7 @@ private: class nsSupportsVoidImpl MOZ_FINAL : public nsISupportsVoid { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISUPPORTSPRIMITIVE NS_DECL_NSISUPPORTSVOID @@ -288,7 +288,7 @@ private: class nsSupportsInterfacePointerImpl MOZ_FINAL : public nsISupportsInterfacePointer { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISUPPORTSPRIMITIVE NS_DECL_NSISUPPORTSINTERFACEPOINTER diff --git a/xpcom/glue/GenericFactory.cpp b/xpcom/glue/GenericFactory.cpp index 56db63c4154d..5e11218761f5 100644 --- a/xpcom/glue/GenericFactory.cpp +++ b/xpcom/glue/GenericFactory.cpp @@ -7,7 +7,7 @@ namespace mozilla { -NS_IMPL_THREADSAFE_ISUPPORTS1(GenericFactory, nsIFactory) +NS_IMPL_ISUPPORTS1(GenericFactory, nsIFactory) NS_IMETHODIMP GenericFactory::CreateInstance(nsISupports* aOuter, REFNSIID aIID, diff --git a/xpcom/glue/GenericFactory.h b/xpcom/glue/GenericFactory.h index be0226593998..7c4962c67656 100644 --- a/xpcom/glue/GenericFactory.h +++ b/xpcom/glue/GenericFactory.h @@ -22,7 +22,7 @@ class GenericFactory MOZ_FINAL : public nsIFactory public: typedef Module::ConstructorProcPtr ConstructorProcPtr; - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIFACTORY GenericFactory(ConstructorProcPtr ctor) diff --git a/xpcom/glue/GenericModule.cpp b/xpcom/glue/GenericModule.cpp index 8fa07dce51f7..60fb6419ccb0 100644 --- a/xpcom/glue/GenericModule.cpp +++ b/xpcom/glue/GenericModule.cpp @@ -15,7 +15,7 @@ namespace mozilla { -NS_IMPL_THREADSAFE_ISUPPORTS1(GenericModule, nsIModule) +NS_IMPL_ISUPPORTS1(GenericModule, nsIModule) NS_IMETHODIMP GenericModule::GetClassObject(nsIComponentManager* aCompMgr, diff --git a/xpcom/glue/nsProxyRelease.h b/xpcom/glue/nsProxyRelease.h index 87723761b5f5..e6dae7eb5de4 100644 --- a/xpcom/glue/nsProxyRelease.h +++ b/xpcom/glue/nsProxyRelease.h @@ -142,13 +142,9 @@ public: bool operator==(const nsMainThreadPtrHolder& aOther) const { return mRawPtr == aOther.mRawPtr; } - NS_IMETHOD_(nsrefcnt) Release(); - NS_IMETHOD_(nsrefcnt) AddRef(); + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(nsMainThreadPtrHolder) private: - // This class is threadsafe and reference-counted. - nsAutoRefCnt mRefCnt; - // Our wrapped pointer. T* mRawPtr; @@ -161,11 +157,6 @@ private: nsMainThreadPtrHolder(const nsMainThreadPtrHolder& other); }; -template -NS_IMPL_THREADSAFE_ADDREF(nsMainThreadPtrHolder) -template -NS_IMPL_THREADSAFE_RELEASE(nsMainThreadPtrHolder) - template class nsMainThreadPtrHandle { diff --git a/xpcom/glue/nsThreadUtils.cpp b/xpcom/glue/nsThreadUtils.cpp index 437e45fec4c1..f2deb747d725 100644 --- a/xpcom/glue/nsThreadUtils.cpp +++ b/xpcom/glue/nsThreadUtils.cpp @@ -28,7 +28,7 @@ #ifndef XPCOM_GLUE_AVOID_NSPR -NS_IMPL_THREADSAFE_ISUPPORTS1(nsRunnable, nsIRunnable) +NS_IMPL_ISUPPORTS1(nsRunnable, nsIRunnable) NS_IMETHODIMP nsRunnable::Run() @@ -37,7 +37,7 @@ nsRunnable::Run() return NS_OK; } -NS_IMPL_THREADSAFE_ISUPPORTS2(nsCancelableRunnable, nsICancelableRunnable, +NS_IMPL_ISUPPORTS2(nsCancelableRunnable, nsICancelableRunnable, nsIRunnable) NS_IMETHODIMP @@ -247,14 +247,14 @@ class nsNameThreadRunnable MOZ_FINAL : public nsIRunnable public: nsNameThreadRunnable(const nsACString &name) : mName(name) { } - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIRUNNABLE protected: const nsCString mName; }; -NS_IMPL_THREADSAFE_ISUPPORTS1(nsNameThreadRunnable, nsIRunnable) +NS_IMPL_ISUPPORTS1(nsNameThreadRunnable, nsIRunnable) NS_IMETHODIMP nsNameThreadRunnable::Run() diff --git a/xpcom/glue/nsThreadUtils.h b/xpcom/glue/nsThreadUtils.h index f1b9b91cdb0d..ba837cde239e 100644 --- a/xpcom/glue/nsThreadUtils.h +++ b/xpcom/glue/nsThreadUtils.h @@ -236,7 +236,7 @@ extern NS_COM_GLUE nsIThread *NS_GetCurrentThread(); class NS_COM_GLUE nsRunnable : public nsIRunnable { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIRUNNABLE nsRunnable() { @@ -251,7 +251,7 @@ protected: class NS_COM_GLUE nsCancelableRunnable : public nsICancelableRunnable { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIRUNNABLE NS_DECL_NSICANCELABLERUNNABLE diff --git a/xpcom/io/nsAppFileLocationProvider.cpp b/xpcom/io/nsAppFileLocationProvider.cpp index ba497572a945..b0243c514e7c 100644 --- a/xpcom/io/nsAppFileLocationProvider.cpp +++ b/xpcom/io/nsAppFileLocationProvider.cpp @@ -78,7 +78,7 @@ nsAppFileLocationProvider::nsAppFileLocationProvider() // nsAppFileLocationProvider::nsISupports //***************************************************************************** -NS_IMPL_THREADSAFE_ISUPPORTS2(nsAppFileLocationProvider, nsIDirectoryServiceProvider, nsIDirectoryServiceProvider2) +NS_IMPL_ISUPPORTS2(nsAppFileLocationProvider, nsIDirectoryServiceProvider, nsIDirectoryServiceProvider2) //***************************************************************************** // nsAppFileLocationProvider::nsIDirectoryServiceProvider diff --git a/xpcom/io/nsAppFileLocationProvider.h b/xpcom/io/nsAppFileLocationProvider.h index 8ecf78d53edb..7fb7e313088b 100644 --- a/xpcom/io/nsAppFileLocationProvider.h +++ b/xpcom/io/nsAppFileLocationProvider.h @@ -18,7 +18,7 @@ class nsAppFileLocationProvider MOZ_FINAL : public nsIDirectoryServiceProvider2 public: nsAppFileLocationProvider(); - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIDIRECTORYSERVICEPROVIDER NS_DECL_NSIDIRECTORYSERVICEPROVIDER2 diff --git a/xpcom/io/nsDirectoryService.cpp b/xpcom/io/nsDirectoryService.cpp index f013a4f11c6d..6f8fc9c6af67 100644 --- a/xpcom/io/nsDirectoryService.cpp +++ b/xpcom/io/nsDirectoryService.cpp @@ -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 diff --git a/xpcom/io/nsDirectoryService.h b/xpcom/io/nsDirectoryService.h index ed9408b82c8c..d02abfe1dcc6 100644 --- a/xpcom/io/nsDirectoryService.h +++ b/xpcom/io/nsDirectoryService.h @@ -24,7 +24,7 @@ class nsDirectoryService MOZ_FINAL : public nsIDirectoryService, public: // nsISupports interface - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIPROPERTIES diff --git a/xpcom/io/nsIOUtil.cpp b/xpcom/io/nsIOUtil.cpp index 30bd4fe94e3a..4363355de1a9 100644 --- a/xpcom/io/nsIOUtil.cpp +++ b/xpcom/io/nsIOUtil.cpp @@ -8,7 +8,7 @@ #include "nsIOutputStream.h" #include "nsStreamUtils.h" -NS_IMPL_THREADSAFE_ISUPPORTS1(nsIOUtil, nsIIOUtil) +NS_IMPL_ISUPPORTS1(nsIOUtil, nsIIOUtil) NS_IMETHODIMP nsIOUtil::InputStreamIsBuffered(nsIInputStream* aStream, bool* _retval) diff --git a/xpcom/io/nsIOUtil.h b/xpcom/io/nsIOUtil.h index 3e06ddb88903..16d65f15ac9e 100644 --- a/xpcom/io/nsIOUtil.h +++ b/xpcom/io/nsIOUtil.h @@ -17,7 +17,7 @@ class nsIOUtil MOZ_FINAL : public nsIIOUtil { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIIOUTIL }; diff --git a/xpcom/io/nsInputStreamTee.cpp b/xpcom/io/nsInputStreamTee.cpp index dd68fc6f23e0..7ccf4cf75fd3 100644 --- a/xpcom/io/nsInputStreamTee.cpp +++ b/xpcom/io/nsInputStreamTee.cpp @@ -35,7 +35,7 @@ GetTeeLog() class nsInputStreamTee MOZ_FINAL : public nsIInputStreamTee { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIINPUTSTREAM NS_DECL_NSIINPUTSTREAMTEE @@ -205,9 +205,9 @@ nsInputStreamTee::WriteSegmentFun(nsIInputStream *in, void *closure, const char return tee->TeeSegment(fromSegment, *writeCount); } -NS_IMPL_THREADSAFE_ISUPPORTS2(nsInputStreamTee, - nsIInputStreamTee, - nsIInputStream) +NS_IMPL_ISUPPORTS2(nsInputStreamTee, + nsIInputStreamTee, + nsIInputStream) NS_IMETHODIMP nsInputStreamTee::Close() { diff --git a/xpcom/io/nsLocalFileOS2.cpp b/xpcom/io/nsLocalFileOS2.cpp index 2fbccccb46c4..8dfa6e492ddf 100644 --- a/xpcom/io/nsLocalFileOS2.cpp +++ b/xpcom/io/nsLocalFileOS2.cpp @@ -580,11 +580,11 @@ nsLocalFile::nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* // nsLocalFile::nsISupports //----------------------------------------------------------------------------- -NS_IMPL_THREADSAFE_ISUPPORTS4(nsLocalFile, - nsILocalFile, - nsIFile, - nsILocalFileOS2, - nsIHashable) +NS_IMPL_ISUPPORTS4(nsLocalFile, + nsILocalFile, + nsIFile, + nsILocalFileOS2, + nsIHashable) //----------------------------------------------------------------------------- diff --git a/xpcom/io/nsLocalFileOS2.h b/xpcom/io/nsLocalFileOS2.h index d23fb8d9a335..e53450a7fefc 100644 --- a/xpcom/io/nsLocalFileOS2.h +++ b/xpcom/io/nsLocalFileOS2.h @@ -44,7 +44,7 @@ public: static nsresult nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr); // nsISupports interface - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS // nsIFile interface NS_DECL_NSIFILE diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp index a38f7942ffd7..88066ed3fa7a 100644 --- a/xpcom/io/nsLocalFileUnix.cpp +++ b/xpcom/io/nsLocalFileUnix.cpp @@ -239,16 +239,16 @@ nsLocalFile::nsLocalFile(const nsLocalFile& other) } #ifdef MOZ_WIDGET_COCOA -NS_IMPL_THREADSAFE_ISUPPORTS4(nsLocalFile, - nsILocalFileMac, - nsILocalFile, - nsIFile, - nsIHashable) +NS_IMPL_ISUPPORTS4(nsLocalFile, + nsILocalFileMac, + nsILocalFile, + nsIFile, + nsIHashable) #else -NS_IMPL_THREADSAFE_ISUPPORTS3(nsLocalFile, - nsILocalFile, - nsIFile, - nsIHashable) +NS_IMPL_ISUPPORTS3(nsLocalFile, + nsILocalFile, + nsIFile, + nsIHashable) #endif nsresult diff --git a/xpcom/io/nsLocalFileUnix.h b/xpcom/io/nsLocalFileUnix.h index 7a99b8d28c71..23fff83f81ad 100644 --- a/xpcom/io/nsLocalFileUnix.h +++ b/xpcom/io/nsLocalFileUnix.h @@ -91,7 +91,7 @@ public: static nsresult nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr); - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIFILE NS_DECL_NSILOCALFILE #ifdef MOZ_WIDGET_COCOA diff --git a/xpcom/io/nsLocalFileWin.cpp b/xpcom/io/nsLocalFileWin.cpp index 4601061743fb..a94b0ecd9b38 100644 --- a/xpcom/io/nsLocalFileWin.cpp +++ b/xpcom/io/nsLocalFileWin.cpp @@ -979,11 +979,11 @@ nsLocalFile::nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* // nsLocalFile::nsISupports //----------------------------------------------------------------------------- -NS_IMPL_THREADSAFE_ISUPPORTS4(nsLocalFile, - nsILocalFile, - nsIFile, - nsILocalFileWin, - nsIHashable) +NS_IMPL_ISUPPORTS4(nsLocalFile, + nsILocalFile, + nsIFile, + nsILocalFileWin, + nsIHashable) //----------------------------------------------------------------------------- diff --git a/xpcom/io/nsLocalFileWin.h b/xpcom/io/nsLocalFileWin.h index e60020882f88..740836f26127 100644 --- a/xpcom/io/nsLocalFileWin.h +++ b/xpcom/io/nsLocalFileWin.h @@ -34,7 +34,7 @@ public: static nsresult nsLocalFileConstructor(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr); // nsISupports interface - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS // nsIFile interface NS_DECL_NSIFILE diff --git a/xpcom/io/nsMultiplexInputStream.cpp b/xpcom/io/nsMultiplexInputStream.cpp index 553e56e20cdf..d7a2992c9181 100644 --- a/xpcom/io/nsMultiplexInputStream.cpp +++ b/xpcom/io/nsMultiplexInputStream.cpp @@ -33,7 +33,7 @@ class nsMultiplexInputStream MOZ_FINAL : public nsIMultiplexInputStream, public: nsMultiplexInputStream(); - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIINPUTSTREAM NS_DECL_NSIMULTIPLEXINPUTSTREAM NS_DECL_NSISEEKABLESTREAM @@ -60,8 +60,8 @@ private: nsresult mStatus; }; -NS_IMPL_THREADSAFE_ADDREF(nsMultiplexInputStream) -NS_IMPL_THREADSAFE_RELEASE(nsMultiplexInputStream) +NS_IMPL_ADDREF(nsMultiplexInputStream) +NS_IMPL_RELEASE(nsMultiplexInputStream) NS_IMPL_CLASSINFO(nsMultiplexInputStream, NULL, nsIClassInfo::THREADSAFE, NS_MULTIPLEXINPUTSTREAM_CID) diff --git a/xpcom/io/nsPipe3.cpp b/xpcom/io/nsPipe3.cpp index adc225f98417..3f5da8c98874 100644 --- a/xpcom/io/nsPipe3.cpp +++ b/xpcom/io/nsPipe3.cpp @@ -128,7 +128,7 @@ private: nsPipe *mPipe; // separate refcnt so that we know when to close the consumer - nsrefcnt mReaderRefCnt; + mozilla::ThreadSafeAutoRefCnt mReaderRefCnt; int64_t mLogicalOffset; bool mBlocking; @@ -182,7 +182,7 @@ private: nsPipe *mPipe; // separate refcnt so that we know when to close the producer - nsrefcnt mWriterRefCnt; + mozilla::ThreadSafeAutoRefCnt mWriterRefCnt; int64_t mLogicalOffset; bool mBlocking; @@ -201,7 +201,7 @@ public: friend class nsPipeInputStream; friend class nsPipeOutputStream; - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIPIPE // nsPipe methods: @@ -311,7 +311,7 @@ nsPipe::~nsPipe() { } -NS_IMPL_THREADSAFE_ISUPPORTS1(nsPipe, nsIPipe) +NS_IMPL_ISUPPORTS1(nsPipe, nsIPipe) NS_IMETHODIMP nsPipe::Init(bool nonBlockingIn, @@ -680,14 +680,14 @@ nsPipeInputStream::OnInputException(nsresult reason, nsPipeEvents &events) NS_IMETHODIMP_(nsrefcnt) nsPipeInputStream::AddRef(void) { - NS_AtomicIncrementRefcnt(mReaderRefCnt); + ++mReaderRefCnt; return mPipe->AddRef(); } NS_IMETHODIMP_(nsrefcnt) nsPipeInputStream::Release(void) { - if (NS_AtomicDecrementRefcnt(mReaderRefCnt) == 0) + if (--mReaderRefCnt == 0) Close(); return mPipe->Release(); } @@ -1035,14 +1035,14 @@ nsPipeOutputStream::OnOutputException(nsresult reason, nsPipeEvents &events) NS_IMETHODIMP_(nsrefcnt) nsPipeOutputStream::AddRef() { - NS_AtomicIncrementRefcnt(mWriterRefCnt); + ++mWriterRefCnt; return mPipe->AddRef(); } NS_IMETHODIMP_(nsrefcnt) nsPipeOutputStream::Release() { - if (NS_AtomicDecrementRefcnt(mWriterRefCnt) == 0) + if (--mWriterRefCnt == 0) Close(); return mPipe->Release(); } diff --git a/xpcom/io/nsStorageStream.cpp b/xpcom/io/nsStorageStream.cpp index 107e292c98ec..b71279c27062 100644 --- a/xpcom/io/nsStorageStream.cpp +++ b/xpcom/io/nsStorageStream.cpp @@ -59,9 +59,9 @@ nsStorageStream::~nsStorageStream() delete mSegmentedBuffer; } -NS_IMPL_THREADSAFE_ISUPPORTS2(nsStorageStream, - nsIStorageStream, - nsIOutputStream) +NS_IMPL_ISUPPORTS2(nsStorageStream, + nsIStorageStream, + nsIOutputStream) NS_IMETHODIMP nsStorageStream::Init(uint32_t segmentSize, uint32_t maxSize, @@ -320,7 +320,7 @@ public: NS_ADDREF(mStorageStream); } - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIINPUTSTREAM NS_DECL_NSISEEKABLESTREAM @@ -348,9 +348,9 @@ private: uint32_t SegOffset(uint32_t aPosition) {return aPosition & (mSegmentSize - 1);} }; -NS_IMPL_THREADSAFE_ISUPPORTS2(nsStorageInputStream, - nsIInputStream, - nsISeekableStream) +NS_IMPL_ISUPPORTS2(nsStorageInputStream, + nsIInputStream, + nsISeekableStream) NS_IMETHODIMP nsStorageStream::NewInputStream(int32_t aStartingOffset, nsIInputStream* *aInputStream) diff --git a/xpcom/io/nsStorageStream.h b/xpcom/io/nsStorageStream.h index e50ce3ffc693..c7e3468ec77f 100644 --- a/xpcom/io/nsStorageStream.h +++ b/xpcom/io/nsStorageStream.h @@ -37,7 +37,7 @@ class nsStorageStream MOZ_FINAL : public nsIStorageStream, public: nsStorageStream(); - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSISTORAGESTREAM NS_DECL_NSIOUTPUTSTREAM diff --git a/xpcom/io/nsStreamUtils.cpp b/xpcom/io/nsStreamUtils.cpp index fe79bc0c9104..f5990da903ee 100644 --- a/xpcom/io/nsStreamUtils.cpp +++ b/xpcom/io/nsStreamUtils.cpp @@ -22,7 +22,7 @@ class nsInputStreamReadyEvent MOZ_FINAL : public nsIRunnable , public nsIInputStreamCallback { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS nsInputStreamReadyEvent(nsIInputStreamCallback *callback, nsIEventTarget *target) @@ -91,8 +91,8 @@ private: nsCOMPtr mTarget; }; -NS_IMPL_THREADSAFE_ISUPPORTS2(nsInputStreamReadyEvent, nsIRunnable, - nsIInputStreamCallback) +NS_IMPL_ISUPPORTS2(nsInputStreamReadyEvent, nsIRunnable, + nsIInputStreamCallback) //----------------------------------------------------------------------------- @@ -100,7 +100,7 @@ class nsOutputStreamReadyEvent MOZ_FINAL : public nsIRunnable , public nsIOutputStreamCallback { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS nsOutputStreamReadyEvent(nsIOutputStreamCallback *callback, nsIEventTarget *target) @@ -169,8 +169,8 @@ private: nsCOMPtr mTarget; }; -NS_IMPL_THREADSAFE_ISUPPORTS2(nsOutputStreamReadyEvent, nsIRunnable, - nsIOutputStreamCallback) +NS_IMPL_ISUPPORTS2(nsOutputStreamReadyEvent, nsIRunnable, + nsIOutputStreamCallback) //----------------------------------------------------------------------------- @@ -205,7 +205,7 @@ class nsAStreamCopier : public nsIInputStreamCallback , public nsIRunnable { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS nsAStreamCopier() : mLock("nsAStreamCopier.mLock") @@ -459,10 +459,10 @@ protected: nsresult mCancelStatus; }; -NS_IMPL_THREADSAFE_ISUPPORTS3(nsAStreamCopier, - nsIInputStreamCallback, - nsIOutputStreamCallback, - nsIRunnable) +NS_IMPL_ISUPPORTS3(nsAStreamCopier, + nsIInputStreamCallback, + nsIOutputStreamCallback, + nsIRunnable) class nsStreamCopierIB MOZ_FINAL : public nsAStreamCopier { diff --git a/xpcom/io/nsStringStream.cpp b/xpcom/io/nsStringStream.cpp index 591e130b394f..0fa7120c8251 100644 --- a/xpcom/io/nsStringStream.cpp +++ b/xpcom/io/nsStringStream.cpp @@ -35,7 +35,7 @@ class nsStringInputStream MOZ_FINAL : public nsIStringInputStream , public nsIIPCSerializableInputStream { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIINPUTSTREAM NS_DECL_NSISTRINGINPUTSTREAM NS_DECL_NSISEEKABLESTREAM @@ -78,8 +78,8 @@ private: // This class needs to support threadsafe refcounting since people often // allocate a string stream, and then read it from a background thread. -NS_IMPL_THREADSAFE_ADDREF(nsStringInputStream) -NS_IMPL_THREADSAFE_RELEASE(nsStringInputStream) +NS_IMPL_ADDREF(nsStringInputStream) +NS_IMPL_RELEASE(nsStringInputStream) NS_IMPL_CLASSINFO(nsStringInputStream, NULL, nsIClassInfo::THREADSAFE, NS_STRINGINPUTSTREAM_CID) diff --git a/xpcom/reflect/xptinfo/public/XPTInterfaceInfoManager.h b/xpcom/reflect/xptinfo/public/XPTInterfaceInfoManager.h index 4876e03eab33..74f6dbf45303 100644 --- a/xpcom/reflect/xptinfo/public/XPTInterfaceInfoManager.h +++ b/xpcom/reflect/xptinfo/public/XPTInterfaceInfoManager.h @@ -26,7 +26,7 @@ namespace mozilla { class XPTInterfaceInfoManager MOZ_FINAL : public nsIInterfaceInfoManager { - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIINTERFACEINFOMANAGER public: diff --git a/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp b/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp index e4c4209055c9..9d9ab3a7c4c8 100644 --- a/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp +++ b/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp @@ -595,7 +595,7 @@ xptiInterfaceInfo::~xptiInterfaceInfo() nsrefcnt xptiInterfaceInfo::AddRef(void) { - nsrefcnt cnt = NS_AtomicIncrementRefcnt(mRefCnt); + nsrefcnt cnt = ++mRefCnt; NS_LOG_ADDREF(this, cnt, "xptiInterfaceInfo", sizeof(*this)); return cnt; } @@ -604,7 +604,7 @@ nsrefcnt xptiInterfaceInfo::Release(void) { xptiInterfaceEntry* entry = mEntry; - nsrefcnt cnt = NS_AtomicDecrementRefcnt(mRefCnt); + nsrefcnt cnt = --mRefCnt; NS_LOG_RELEASE(this, cnt, "xptiInterfaceInfo"); if(!cnt) { diff --git a/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp b/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp index 39c5904fc7e7..7ef74dfaaf9f 100644 --- a/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp +++ b/xpcom/reflect/xptinfo/src/xptiInterfaceInfoManager.cpp @@ -19,8 +19,8 @@ using namespace mozilla; -NS_IMPL_THREADSAFE_ISUPPORTS1(XPTInterfaceInfoManager, - nsIInterfaceInfoManager) +NS_IMPL_ISUPPORTS1(XPTInterfaceInfoManager, + nsIInterfaceInfoManager) static XPTInterfaceInfoManager* gInterfaceInfoManager = nullptr; #ifdef DEBUG diff --git a/xpcom/reflect/xptinfo/src/xptiprivate.h b/xpcom/reflect/xptinfo/src/xptiprivate.h index ecd71afbf5f5..5e718c071a9e 100644 --- a/xpcom/reflect/xptinfo/src/xptiprivate.h +++ b/xpcom/reflect/xptinfo/src/xptiprivate.h @@ -291,7 +291,7 @@ private: class xptiInterfaceInfo MOZ_FINAL : public nsIInterfaceInfo { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS // Use delegation to implement (most!) of nsIInterfaceInfo. NS_IMETHOD GetName(char * *aName) { return !mEntry ? NS_ERROR_UNEXPECTED : mEntry->GetName(aName); } diff --git a/xpcom/tests/TestPipes.cpp b/xpcom/tests/TestPipes.cpp index fe3cc89c2f35..48d832b1ecfe 100644 --- a/xpcom/tests/TestPipes.cpp +++ b/xpcom/tests/TestPipes.cpp @@ -106,7 +106,7 @@ WriteAll(nsIOutputStream *os, const char *buf, uint32_t bufLen, uint32_t *lenWri class nsReceiver : public nsIRunnable { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_IMETHOD Run() { nsresult rv; @@ -146,7 +146,7 @@ protected: uint32_t mCount; }; -NS_IMPL_THREADSAFE_ISUPPORTS1(nsReceiver, nsIRunnable) +NS_IMPL_ISUPPORTS1(nsReceiver, nsIRunnable) nsresult TestPipe(nsIInputStream* in, nsIOutputStream* out) @@ -197,7 +197,7 @@ TestPipe(nsIInputStream* in, nsIOutputStream* out) class nsShortReader : public nsIRunnable { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_IMETHOD Run() { nsresult rv; @@ -261,7 +261,7 @@ protected: Monitor* mMon; }; -NS_IMPL_THREADSAFE_ISUPPORTS1(nsShortReader, nsIRunnable) +NS_IMPL_ISUPPORTS1(nsShortReader, nsIRunnable) nsresult TestShortWrites(nsIInputStream* in, nsIOutputStream* out) @@ -316,7 +316,7 @@ TestShortWrites(nsIInputStream* in, nsIOutputStream* out) class nsPump : public nsIRunnable { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_IMETHOD Run() { nsresult rv; @@ -352,8 +352,7 @@ protected: uint32_t mCount; }; -NS_IMPL_THREADSAFE_ISUPPORTS1(nsPump, - nsIRunnable) +NS_IMPL_ISUPPORTS1(nsPump, nsIRunnable) nsresult TestChainedPipes() diff --git a/xpcom/tests/TestRacingServiceManager.cpp b/xpcom/tests/TestRacingServiceManager.cpp index 67562d9de07e..e61eb8c6cabe 100644 --- a/xpcom/tests/TestRacingServiceManager.cpp +++ b/xpcom/tests/TestRacingServiceManager.cpp @@ -87,7 +87,7 @@ private: class Factory MOZ_FINAL : public nsIFactory { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS Factory() : mFirstComponentCreated(false) { } @@ -102,12 +102,12 @@ public: bool mFirstComponentCreated; }; -NS_IMPL_THREADSAFE_ISUPPORTS1(Factory, nsIFactory) +NS_IMPL_ISUPPORTS1(Factory, nsIFactory) class Component1 MOZ_FINAL : public nsISupports { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS Component1() { // 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_THREADSAFE_RELEASE(Component1) +NS_IMPL_ADDREF(Component1) +NS_IMPL_RELEASE(Component1) NS_INTERFACE_MAP_BEGIN(Component1) NS_INTERFACE_MAP_ENTRY(Component1) @@ -127,7 +127,7 @@ NS_INTERFACE_MAP_END class Component2 MOZ_FINAL : public nsISupports { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS Component2() { // 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_THREADSAFE_RELEASE(Component2) +NS_IMPL_ADDREF(Component2) +NS_IMPL_RELEASE(Component2) NS_INTERFACE_MAP_BEGIN(Component2) NS_INTERFACE_MAP_ENTRY(Component2) diff --git a/xpcom/tests/TestThreadPool.cpp b/xpcom/tests/TestThreadPool.cpp index 80dcc22efbb8..f0af86df0699 100644 --- a/xpcom/tests/TestThreadPool.cpp +++ b/xpcom/tests/TestThreadPool.cpp @@ -16,7 +16,7 @@ class Task : public nsIRunnable { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS Task(int i) : mIndex(i) {} @@ -32,7 +32,7 @@ public: private: int mIndex; }; -NS_IMPL_THREADSAFE_ISUPPORTS1(Task, nsIRunnable) +NS_IMPL_ISUPPORTS1(Task, nsIRunnable) static nsresult RunTests() diff --git a/xpcom/tests/TestThreadPoolListener.cpp b/xpcom/tests/TestThreadPoolListener.cpp index 45e561a87339..6e914c824d30 100644 --- a/xpcom/tests/TestThreadPoolListener.cpp +++ b/xpcom/tests/TestThreadPoolListener.cpp @@ -48,11 +48,11 @@ static bool gAllThreadsShutDown = false; class Listener MOZ_FINAL : public nsIThreadPoolListener { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSITHREADPOOLLISTENER }; -NS_IMPL_THREADSAFE_ISUPPORTS1(Listener, nsIThreadPoolListener) +NS_IMPL_ISUPPORTS1(Listener, nsIThreadPoolListener) NS_IMETHODIMP Listener::OnThreadCreated() diff --git a/xpcom/tests/TestThreads.cpp b/xpcom/tests/TestThreads.cpp index 1d8bea6c4307..ea806e15cacd 100644 --- a/xpcom/tests/TestThreads.cpp +++ b/xpcom/tests/TestThreads.cpp @@ -13,7 +13,7 @@ class nsRunner : public nsIRunnable { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_IMETHOD Run() { nsCOMPtr thread; @@ -38,7 +38,7 @@ protected: int mNum; }; -NS_IMPL_THREADSAFE_ISUPPORTS1(nsRunner, nsIRunnable) +NS_IMPL_ISUPPORTS1(nsRunner, nsIRunnable) nsresult TestThreads() @@ -75,7 +75,7 @@ TestThreads() class nsStressRunner : public nsIRunnable { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_IMETHOD Run() { NS_ASSERTION(!mWasRun, "run twice!"); @@ -106,7 +106,7 @@ protected: int32_t nsStressRunner::gNum = 0; -NS_IMPL_THREADSAFE_ISUPPORTS1(nsStressRunner, nsIRunnable) +NS_IMPL_ISUPPORTS1(nsStressRunner, nsIRunnable) static int Stress(int loops, int threads) { diff --git a/xpcom/tests/TestTimers.cpp b/xpcom/tests/TestTimers.cpp index 8b4ac25ce35f..b9ffd1ea79d7 100644 --- a/xpcom/tests/TestTimers.cpp +++ b/xpcom/tests/TestTimers.cpp @@ -72,7 +72,7 @@ private: class TimerCallback MOZ_FINAL : public nsITimerCallback { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS TimerCallback(nsIThread** aThreadPtr, ReentrantMonitor* aReentrantMonitor) : mThreadPtr(aThreadPtr), mReentrantMonitor(aReentrantMonitor) { } @@ -94,7 +94,7 @@ private: ReentrantMonitor* mReentrantMonitor; }; -NS_IMPL_THREADSAFE_ISUPPORTS1(TimerCallback, nsITimerCallback) +NS_IMPL_ISUPPORTS1(TimerCallback, nsITimerCallback) nsresult TestTargetedTimers() diff --git a/xpcom/threads/LazyIdleThread.cpp b/xpcom/threads/LazyIdleThread.cpp index 1ac0cacd42ab..0cf14ad0acd5 100644 --- a/xpcom/threads/LazyIdleThread.cpp +++ b/xpcom/threads/LazyIdleThread.cpp @@ -334,12 +334,12 @@ LazyIdleThread::SelfDestruct() delete this; } -NS_IMPL_THREADSAFE_ADDREF(LazyIdleThread) +NS_IMPL_ADDREF(LazyIdleThread) NS_IMETHODIMP_(nsrefcnt) LazyIdleThread::Release() { - nsrefcnt count = NS_AtomicDecrementRefcnt(mRefCnt); + nsrefcnt count = --mRefCnt; NS_LOG_RELEASE(this, count, "LazyIdleThread"); if (!count) { @@ -363,11 +363,11 @@ LazyIdleThread::Release() return count; } -NS_IMPL_THREADSAFE_QUERY_INTERFACE5(LazyIdleThread, nsIThread, - nsIEventTarget, - nsITimerCallback, - nsIThreadObserver, - nsIObserver) +NS_IMPL_QUERY_INTERFACE5(LazyIdleThread, nsIThread, + nsIEventTarget, + nsITimerCallback, + nsIThreadObserver, + nsIObserver) NS_IMETHODIMP LazyIdleThread::Dispatch(nsIRunnable* aEvent, diff --git a/xpcom/threads/LazyIdleThread.h b/xpcom/threads/LazyIdleThread.h index 1c8cf0aefc18..276a50a8955a 100644 --- a/xpcom/threads/LazyIdleThread.h +++ b/xpcom/threads/LazyIdleThread.h @@ -38,7 +38,7 @@ class LazyIdleThread MOZ_FINAL : public nsIThread, public nsIObserver { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIEVENTTARGET NS_DECL_NSITHREAD NS_DECL_NSITIMERCALLBACK diff --git a/xpcom/threads/TimerThread.cpp b/xpcom/threads/TimerThread.cpp index f8a7cb7f7b2b..9053f8f41184 100644 --- a/xpcom/threads/TimerThread.cpp +++ b/xpcom/threads/TimerThread.cpp @@ -17,7 +17,7 @@ using namespace mozilla; -NS_IMPL_THREADSAFE_ISUPPORTS2(TimerThread, nsIRunnable, nsIObserver) +NS_IMPL_ISUPPORTS2(TimerThread, nsIRunnable, nsIObserver) TimerThread::TimerThread() : mInitInProgress(0), diff --git a/xpcom/threads/TimerThread.h b/xpcom/threads/TimerThread.h index 8cebe6045777..a9699c29f3c1 100644 --- a/xpcom/threads/TimerThread.h +++ b/xpcom/threads/TimerThread.h @@ -30,7 +30,7 @@ public: TimerThread(); NS_HIDDEN_(nsresult) InitLocks(); - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIRUNNABLE NS_DECL_NSIOBSERVER diff --git a/xpcom/threads/nsEnvironment.cpp b/xpcom/threads/nsEnvironment.cpp index 01b20a0bb47d..b619d70c6a33 100644 --- a/xpcom/threads/nsEnvironment.cpp +++ b/xpcom/threads/nsEnvironment.cpp @@ -14,7 +14,7 @@ using namespace mozilla; -NS_IMPL_THREADSAFE_ISUPPORTS1(nsEnvironment, nsIEnvironment) +NS_IMPL_ISUPPORTS1(nsEnvironment, nsIEnvironment) nsresult nsEnvironment::Create(nsISupports *aOuter, REFNSIID aIID, diff --git a/xpcom/threads/nsEnvironment.h b/xpcom/threads/nsEnvironment.h index a74ecbab7dc8..bcc32d11fdd9 100644 --- a/xpcom/threads/nsEnvironment.h +++ b/xpcom/threads/nsEnvironment.h @@ -18,7 +18,7 @@ class nsEnvironment MOZ_FINAL : public nsIEnvironment { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIENVIRONMENT static nsresult Create(nsISupports *aOuter, REFNSIID aIID, diff --git a/xpcom/threads/nsProcess.h b/xpcom/threads/nsProcess.h index 6d02dc59186e..e25bf17f20df 100644 --- a/xpcom/threads/nsProcess.h +++ b/xpcom/threads/nsProcess.h @@ -36,7 +36,7 @@ class nsProcess MOZ_FINAL : public nsIProcess, { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIPROCESS NS_DECL_NSIOBSERVER diff --git a/xpcom/threads/nsProcessCommon.cpp b/xpcom/threads/nsProcessCommon.cpp index 828e0b6e0e62..ed6cb5106e04 100644 --- a/xpcom/threads/nsProcessCommon.cpp +++ b/xpcom/threads/nsProcessCommon.cpp @@ -59,8 +59,8 @@ cpu_type_t pref_cpu_types[2] = { //-------------------------------------------------------------------// // nsIProcess implementation //-------------------------------------------------------------------// -NS_IMPL_THREADSAFE_ISUPPORTS2(nsProcess, nsIProcess, - nsIObserver) +NS_IMPL_ISUPPORTS2(nsProcess, nsIProcess, + nsIObserver) //Constructor nsProcess::nsProcess() diff --git a/xpcom/threads/nsThread.cpp b/xpcom/threads/nsThread.cpp index 19eba00b0c8c..2b1d43b180dd 100644 --- a/xpcom/threads/nsThread.cpp +++ b/xpcom/threads/nsThread.cpp @@ -130,8 +130,8 @@ nsThreadClassInfo::GetClassIDNoAlloc(nsCID *result) //----------------------------------------------------------------------------- -NS_IMPL_THREADSAFE_ADDREF(nsThread) -NS_IMPL_THREADSAFE_RELEASE(nsThread) +NS_IMPL_ADDREF(nsThread) +NS_IMPL_RELEASE(nsThread) NS_INTERFACE_MAP_BEGIN(nsThread) NS_INTERFACE_MAP_ENTRY(nsIThread) NS_INTERFACE_MAP_ENTRY(nsIThreadInternal) diff --git a/xpcom/threads/nsThread.h b/xpcom/threads/nsThread.h index 497b829b6072..0181c5acadea 100644 --- a/xpcom/threads/nsThread.h +++ b/xpcom/threads/nsThread.h @@ -21,7 +21,7 @@ class nsThread MOZ_FINAL : public nsIThreadInternal, public nsISupportsPriority { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIEVENTTARGET NS_DECL_NSITHREAD NS_DECL_NSITHREADINTERNAL diff --git a/xpcom/threads/nsThreadPool.cpp b/xpcom/threads/nsThreadPool.cpp index ee55af47c8b0..281bd83072ae 100644 --- a/xpcom/threads/nsThreadPool.cpp +++ b/xpcom/threads/nsThreadPool.cpp @@ -37,8 +37,8 @@ GetThreadPoolLog() #define DEFAULT_IDLE_THREAD_LIMIT 1 #define DEFAULT_IDLE_THREAD_TIMEOUT PR_SecondsToInterval(60) -NS_IMPL_THREADSAFE_ADDREF(nsThreadPool) -NS_IMPL_THREADSAFE_RELEASE(nsThreadPool) +NS_IMPL_ADDREF(nsThreadPool) +NS_IMPL_RELEASE(nsThreadPool) NS_IMPL_CLASSINFO(nsThreadPool, NULL, nsIClassInfo::THREADSAFE, NS_THREADPOOL_CID) NS_IMPL_QUERY_INTERFACE3_CI(nsThreadPool, nsIThreadPool, nsIEventTarget, diff --git a/xpcom/threads/nsThreadPool.h b/xpcom/threads/nsThreadPool.h index 729b47697854..37f9b61b7b0c 100644 --- a/xpcom/threads/nsThreadPool.h +++ b/xpcom/threads/nsThreadPool.h @@ -20,7 +20,7 @@ class nsThreadPool MOZ_FINAL : public nsIThreadPool, public nsIRunnable { public: - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSIEVENTTARGET NS_DECL_NSITHREADPOOL NS_DECL_NSIRUNNABLE diff --git a/xpcom/threads/nsTimerImpl.cpp b/xpcom/threads/nsTimerImpl.cpp index fd4b39114c29..71ed49b7162c 100644 --- a/xpcom/threads/nsTimerImpl.cpp +++ b/xpcom/threads/nsTimerImpl.cpp @@ -188,15 +188,15 @@ void TimerEventAllocator::Free(void* aPtr) } // anonymous namespace -NS_IMPL_THREADSAFE_QUERY_INTERFACE1(nsTimerImpl, nsITimer) -NS_IMPL_THREADSAFE_ADDREF(nsTimerImpl) +NS_IMPL_QUERY_INTERFACE1(nsTimerImpl, nsITimer) +NS_IMPL_ADDREF(nsTimerImpl) NS_IMETHODIMP_(nsrefcnt) nsTimerImpl::Release(void) { nsrefcnt count; MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release"); - count = NS_AtomicDecrementRefcnt(mRefCnt); + count = --mRefCnt; NS_LOG_RELEASE(this, count, "nsTimerImpl"); if (count == 0) { mRefCnt = 1; /* stabilize */ diff --git a/xpcom/threads/nsTimerImpl.h b/xpcom/threads/nsTimerImpl.h index c318cf106202..470fd8fc5359 100644 --- a/xpcom/threads/nsTimerImpl.h +++ b/xpcom/threads/nsTimerImpl.h @@ -57,7 +57,7 @@ public: nsresult PostTimerEvent(); void SetDelayInternal(uint32_t aDelay); - NS_DECL_ISUPPORTS + NS_DECL_THREADSAFE_ISUPPORTS NS_DECL_NSITIMER int32_t GetGeneration() { return mGeneration; }