From f57e56e18711f121486b4409a074f7655734ecff Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 27 Aug 2014 15:47:27 -0700 Subject: [PATCH] Bug 1058388 - Remove NS_COM_GLUE and IMETHOD_VISIBILITY. r=bsmedberg. --HG-- extra : rebase_source : 250ec1323d4097101a8e0331a2bf7fab59f72b1d --- ipc/glue/CrossProcessMutex.h | 2 +- xpcom/base/nscore.h | 12 +---- xpcom/glue/AppData.h | 2 +- xpcom/glue/BlockingResourceBase.h | 2 +- xpcom/glue/CondVar.h | 2 +- xpcom/glue/FileUtils.h | 22 ++++---- xpcom/glue/MainThreadUtils.h | 6 +-- xpcom/glue/Monitor.h | 6 +-- xpcom/glue/Mutex.h | 8 +-- xpcom/glue/ReentrantMonitor.h | 4 +- xpcom/glue/nsArrayEnumerator.h | 4 +- xpcom/glue/nsArrayUtils.h | 2 +- xpcom/glue/nsCOMArray.h | 2 +- xpcom/glue/nsCOMPtr.h | 33 ++++++------ xpcom/glue/nsCRTGlue.h | 36 ++++++------- xpcom/glue/nsCategoryCache.h | 2 +- xpcom/glue/nsComponentManagerUtils.h | 28 +++++------ xpcom/glue/nsCycleCollectionParticipant.h | 4 +- xpcom/glue/nsDebug.h | 8 +-- xpcom/glue/nsDeque.h | 4 +- xpcom/glue/nsEnumeratorUtils.h | 12 ++--- xpcom/glue/nsIClassInfoImpl.h | 2 +- xpcom/glue/nsID.h | 6 +-- xpcom/glue/nsIInterfaceRequestorUtils.h | 2 +- xpcom/glue/nsINIParser.h | 2 +- xpcom/glue/nsISupportsImpl.h | 2 +- xpcom/glue/nsIWeakReferenceUtils.h | 6 +-- xpcom/glue/nsMemory.cpp | 6 +-- xpcom/glue/nsMemory.h | 6 +-- xpcom/glue/nsProxyRelease.h | 2 +- xpcom/glue/nsQuickSort.h | 6 +-- xpcom/glue/nsServiceManagerUtils.h | 7 ++- xpcom/glue/nsStringAPI.h | 6 +-- xpcom/glue/nsTArray.h | 2 +- xpcom/glue/nsTHashtable.h | 8 +-- xpcom/glue/nsTObserverArray.h | 2 +- xpcom/glue/nsTextFormatter.h | 2 +- xpcom/glue/nsThreadUtils.h | 33 +++++------- xpcom/glue/nsVersionComparator.h | 9 ++-- xpcom/glue/nsVoidArray.h | 4 +- xpcom/glue/nsWeakReference.cpp | 4 +- xpcom/glue/nsWeakReference.h | 10 +--- xpcom/glue/pldhash.h | 61 +++++++++++------------ xpcom/glue/unused.h | 4 +- 44 files changed, 179 insertions(+), 214 deletions(-) diff --git a/ipc/glue/CrossProcessMutex.h b/ipc/glue/CrossProcessMutex.h index dfaf38e1e26e..58092ab39370 100644 --- a/ipc/glue/CrossProcessMutex.h +++ b/ipc/glue/CrossProcessMutex.h @@ -42,7 +42,7 @@ typedef mozilla::ipc::SharedMemoryBasic::Handle CrossProcessMutexHandle; typedef uintptr_t CrossProcessMutexHandle; #endif -class NS_COM_GLUE CrossProcessMutex +class CrossProcessMutex { public: /** diff --git a/xpcom/base/nscore.h b/xpcom/base/nscore.h index 31c924ca0a7e..7716c577d8fd 100644 --- a/xpcom/base/nscore.h +++ b/xpcom/base/nscore.h @@ -57,9 +57,6 @@ #define NS_HIDDEN NS_VISIBILITY_HIDDEN #define NS_EXTERNAL_VIS NS_VISIBILITY_DEFAULT -#undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY - /** * Mark a function as using a potentially non-standard function calling * convention. This can be used on functions that are called very @@ -127,7 +124,7 @@ #define NS_IMPORT_(type) NS_EXTERNAL_VIS_(type) #define NS_EXPORT NS_EXTERNAL_VIS #define NS_EXPORT_(type) NS_EXTERNAL_VIS_(type) -#define NS_IMETHOD_(type) virtual IMETHOD_VISIBILITY type +#define NS_IMETHOD_(type) virtual type #define NS_IMETHODIMP_(type) type #define NS_METHOD_(type) type #define NS_CALLBACK_(_type, _name) _type (* _name) @@ -207,7 +204,6 @@ #endif #ifdef MOZILLA_INTERNAL_API -# define NS_COM_GLUE /* The frozen string API has different definitions of nsAC?String classes than the internal API. On systems that explicitly declare @@ -217,12 +213,6 @@ */ # define nsAString nsAString_internal # define nsACString nsACString_internal -#else -# ifdef HAVE_VISIBILITY_ATTRIBUTE -# define NS_COM_GLUE NS_VISIBILITY_HIDDEN -# else -# define NS_COM_GLUE -# endif #endif #if (defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING)) diff --git a/xpcom/glue/AppData.h b/xpcom/glue/AppData.h index d721f208d276..0134df32ca14 100644 --- a/xpcom/glue/AppData.h +++ b/xpcom/glue/AppData.h @@ -16,7 +16,7 @@ namespace mozilla { // Like nsXREAppData, but releases all strong refs/allocated memory // in the destructor. -class NS_COM_GLUE ScopedAppData : public nsXREAppData +class ScopedAppData : public nsXREAppData { public: ScopedAppData() diff --git a/xpcom/glue/BlockingResourceBase.h b/xpcom/glue/BlockingResourceBase.h index 7d1e8e126839..88b73f4d308f 100644 --- a/xpcom/glue/BlockingResourceBase.h +++ b/xpcom/glue/BlockingResourceBase.h @@ -46,7 +46,7 @@ template class DeadlockDetector; * Base class of resources that might block clients trying to acquire them. * Does debugging and deadlock detection in DEBUG builds. **/ -class NS_COM_GLUE BlockingResourceBase +class BlockingResourceBase { public: // Needs to be kept in sync with kResourceTypeNames. diff --git a/xpcom/glue/CondVar.h b/xpcom/glue/CondVar.h index 66f3980090b8..5d05464ecad3 100644 --- a/xpcom/glue/CondVar.h +++ b/xpcom/glue/CondVar.h @@ -24,7 +24,7 @@ namespace mozilla { * Vanilla condition variable. Please don't use this unless you have a * compelling reason --- Monitor provides a simpler API. */ -class NS_COM_GLUE CondVar : BlockingResourceBase +class CondVar : BlockingResourceBase { public: /** diff --git a/xpcom/glue/FileUtils.h b/xpcom/glue/FileUtils.h index 857148edb344..c5a93a5d678e 100644 --- a/xpcom/glue/FileUtils.h +++ b/xpcom/glue/FileUtils.h @@ -93,7 +93,7 @@ typedef Scoped ScopedCloseFile; * @param aLength length of file to grow to. * @return true on success. */ -NS_COM_GLUE bool fallocate(PRFileDesc* aFD, int64_t aLength); +bool fallocate(PRFileDesc* aFD, int64_t aLength); /** * Use readahead to preload shared libraries into the file cache before loading. @@ -102,7 +102,7 @@ NS_COM_GLUE bool fallocate(PRFileDesc* aFD, int64_t aLength); * * @param aFile nsIFile representing path to shared library */ -NS_COM_GLUE void ReadAheadLib(nsIFile* aFile); +void ReadAheadLib(nsIFile* aFile); /** * Use readahead to preload a file into the file cache before reading. @@ -115,9 +115,9 @@ NS_COM_GLUE void ReadAheadLib(nsIFile* aFile); * @param aOutFd Pointer to file descriptor. If specified, ReadAheadFile will * return its internal, opened file descriptor instead of closing it. */ -NS_COM_GLUE void ReadAheadFile(nsIFile* aFile, const size_t aOffset = 0, - const size_t aCount = SIZE_MAX, - filedesc_t* aOutFd = nullptr); +void ReadAheadFile(nsIFile* aFile, const size_t aOffset = 0, + const size_t aCount = SIZE_MAX, + filedesc_t* aOutFd = nullptr); #endif // !defined(XPCOM_GLUE) @@ -128,7 +128,7 @@ NS_COM_GLUE void ReadAheadFile(nsIFile* aFile, const size_t aOffset = 0, * * @param aFilePath path to shared library */ -NS_COM_GLUE void ReadAheadLib(pathstr_t aFilePath); +void ReadAheadLib(pathstr_t aFilePath); /** * Use readahead to preload a file into the file cache before loading. @@ -141,9 +141,9 @@ NS_COM_GLUE void ReadAheadLib(pathstr_t aFilePath); * @param aOutFd Pointer to file descriptor. If specified, ReadAheadFile will * return its internal, opened file descriptor instead of closing it. */ -NS_COM_GLUE void ReadAheadFile(pathstr_t aFilePath, const size_t aOffset = 0, - const size_t aCount = SIZE_MAX, - filedesc_t* aOutFd = nullptr); +void ReadAheadFile(pathstr_t aFilePath, const size_t aOffset = 0, + const size_t aCount = SIZE_MAX, + filedesc_t* aOutFd = nullptr); /** * Use readahead to preload a file into the file cache before reading. @@ -157,8 +157,8 @@ NS_COM_GLUE void ReadAheadFile(pathstr_t aFilePath, const size_t aOffset = 0, * @param aOffset Offset into the file to begin preloading * @param aCount Number of bytes to preload (SIZE_MAX implies file size) */ -NS_COM_GLUE void ReadAhead(filedesc_t aFd, const size_t aOffset = 0, - const size_t aCount = SIZE_MAX); +void ReadAhead(filedesc_t aFd, const size_t aOffset = 0, + const size_t aCount = SIZE_MAX); /* Define ReadSysFile() only on GONK to avoid unnecessary lubxul bloat. diff --git a/xpcom/glue/MainThreadUtils.h b/xpcom/glue/MainThreadUtils.h index 26ad68ec078b..b6b05ec50fa8 100644 --- a/xpcom/glue/MainThreadUtils.h +++ b/xpcom/glue/MainThreadUtils.h @@ -18,14 +18,14 @@ class nsIThread; * @param aResult * The resulting nsIThread object. */ -extern NS_COM_GLUE NS_METHOD NS_GetMainThread(nsIThread** aResult); +extern NS_METHOD NS_GetMainThread(nsIThread** aResult); #ifdef MOZILLA_INTERNAL_API // Fast access to the current thread. Do not release the returned pointer! If // you want to use this pointer from some other thread, then you will need to // AddRef it. Otherwise, you should only consider this pointer valid from code // running on the current thread. -extern NS_COM_GLUE nsIThread* NS_GetCurrentThread(); +extern nsIThread* NS_GetCurrentThread(); #endif #ifdef MOZILLA_INTERNAL_API @@ -37,7 +37,7 @@ bool NS_IsMainThread(); * @returns true if the current thread is the main thread, and false * otherwise. */ -extern NS_COM_GLUE bool NS_IsMainThread(); +extern bool NS_IsMainThread(); #endif #endif // MainThreadUtils_h_ diff --git a/xpcom/glue/Monitor.h b/xpcom/glue/Monitor.h index dec7d2be65a1..62e20f58342f 100644 --- a/xpcom/glue/Monitor.h +++ b/xpcom/glue/Monitor.h @@ -21,7 +21,7 @@ namespace mozilla { * to instead use the RAII wrappers MonitorAutoLock and * MonitorAutoUnlock. */ -class NS_COM_GLUE Monitor +class Monitor { public: explicit Monitor(const char* aName) @@ -69,7 +69,7 @@ private: * The monitor must be unlocked when instances of this class are * created. */ -class NS_COM_GLUE MOZ_STACK_CLASS MonitorAutoLock +class MOZ_STACK_CLASS MonitorAutoLock { public: explicit MonitorAutoLock(Monitor& aMonitor) @@ -108,7 +108,7 @@ private: * The monitor must be locked by the current thread when instances of * this class are created. */ -class NS_COM_GLUE MOZ_STACK_CLASS MonitorAutoUnlock +class MOZ_STACK_CLASS MonitorAutoUnlock { public: explicit MonitorAutoUnlock(Monitor& aMonitor) diff --git a/xpcom/glue/Mutex.h b/xpcom/glue/Mutex.h index d2ee5f620009..7544b7b5c3d1 100644 --- a/xpcom/glue/Mutex.h +++ b/xpcom/glue/Mutex.h @@ -34,7 +34,7 @@ namespace mozilla { * include leak checking. Sometimes you want to intentionally "leak" a mutex * until shutdown; in these cases, OffTheBooksMutex is for you. */ -class NS_COM_GLUE OffTheBooksMutex : BlockingResourceBase +class OffTheBooksMutex : BlockingResourceBase { public: /** @@ -117,7 +117,7 @@ private: * When possible, use MutexAutoLock/MutexAutoUnlock to lock/unlock this * mutex within a scope, instead of calling Lock/Unlock directly. */ -class NS_COM_GLUE Mutex : public OffTheBooksMutex +class Mutex : public OffTheBooksMutex { public: explicit Mutex(const char* aName) @@ -145,7 +145,7 @@ private: * MUCH PREFERRED to bare calls to Mutex.Lock and Unlock. */ template -class NS_COM_GLUE MOZ_STACK_CLASS BaseAutoLock +class MOZ_STACK_CLASS BaseAutoLock { public: /** @@ -191,7 +191,7 @@ typedef BaseAutoLock OffTheBooksMutexAutoLock; * MUCH PREFERRED to bare calls to Mutex.Unlock and Lock. */ template -class NS_COM_GLUE MOZ_STACK_CLASS BaseAutoUnlock +class MOZ_STACK_CLASS BaseAutoUnlock { public: explicit BaseAutoUnlock(T& aLock MOZ_GUARD_OBJECT_NOTIFIER_PARAM) diff --git a/xpcom/glue/ReentrantMonitor.h b/xpcom/glue/ReentrantMonitor.h index 883946151599..e3e9bbaeb7bf 100644 --- a/xpcom/glue/ReentrantMonitor.h +++ b/xpcom/glue/ReentrantMonitor.h @@ -34,7 +34,7 @@ namespace mozilla { * When possible, use ReentrantMonitorAutoEnter to hold this monitor within a * scope, instead of calling Enter/Exit directly. **/ -class NS_COM_GLUE ReentrantMonitor : BlockingResourceBase +class ReentrantMonitor : BlockingResourceBase { public: /** @@ -163,7 +163,7 @@ private: * * MUCH PREFERRED to bare calls to ReentrantMonitor.Enter and Exit. */ -class NS_COM_GLUE MOZ_STACK_CLASS ReentrantMonitorAutoEnter +class MOZ_STACK_CLASS ReentrantMonitorAutoEnter { public: /** diff --git a/xpcom/glue/nsArrayEnumerator.h b/xpcom/glue/nsArrayEnumerator.h index 3094d6d8d05f..341ae86edab4 100644 --- a/xpcom/glue/nsArrayEnumerator.h +++ b/xpcom/glue/nsArrayEnumerator.h @@ -17,7 +17,7 @@ class nsCOMArray_base; // Create an enumerator for an existing nsIArray implementation // The enumerator holds an owning reference to the array. -NS_COM_GLUE nsresult +nsresult NS_NewArrayEnumerator(nsISimpleEnumerator** aResult, nsIArray* aArray); @@ -25,7 +25,7 @@ NS_NewArrayEnumerator(nsISimpleEnumerator** aResult, // The enumerator will hold an owning reference to each ELEMENT in // the array. This means that the nsCOMArray can safely go away // without its objects going away. -NS_COM_GLUE nsresult +nsresult NS_NewArrayEnumerator(nsISimpleEnumerator** aResult, const nsCOMArray_base& aArray); diff --git a/xpcom/glue/nsArrayUtils.h b/xpcom/glue/nsArrayUtils.h index d0b177577044..215e807b7030 100644 --- a/xpcom/glue/nsArrayUtils.h +++ b/xpcom/glue/nsArrayUtils.h @@ -11,7 +11,7 @@ #include "nsIArray.h" // helper class for do_QueryElementAt -class NS_COM_GLUE nsQueryArrayElementAt : public nsCOMPtr_helper +class nsQueryArrayElementAt : public nsCOMPtr_helper { public: nsQueryArrayElementAt(nsIArray* aArray, uint32_t aIndex, diff --git a/xpcom/glue/nsCOMArray.h b/xpcom/glue/nsCOMArray.h index e746f2a7a020..05b4f3ecfe36 100644 --- a/xpcom/glue/nsCOMArray.h +++ b/xpcom/glue/nsCOMArray.h @@ -18,7 +18,7 @@ // a class that's nsISupports-specific, so that we can contain the // work of this class in the XPCOM dll -class NS_COM_GLUE nsCOMArray_base +class nsCOMArray_base { friend class nsArrayBase; protected: diff --git a/xpcom/glue/nsCOMPtr.h b/xpcom/glue/nsCOMPtr.h index 9f51dab5ba2a..724a22ca876b 100644 --- a/xpcom/glue/nsCOMPtr.h +++ b/xpcom/glue/nsCOMPtr.h @@ -28,7 +28,6 @@ #include "nsDebug.h" // for |NS_ABORT_IF_FALSE|, |NS_ASSERTION| #include "nsISupportsUtils.h" // for |nsresult|, |NS_ADDREF|, |NS_GET_TEMPLATE_IID| et al -#include "nscore.h" // for |NS_COM_GLUE| #include "nsCycleCollectionNoteChild.h" @@ -289,7 +288,7 @@ public: * often enough that the codesize savings are big enough to warrant the * specialcasing. */ -class NS_COM_GLUE MOZ_STACK_CLASS nsQueryInterface MOZ_FINAL +class MOZ_STACK_CLASS nsQueryInterface MOZ_FINAL { public: explicit @@ -301,7 +300,7 @@ private: nsISupports* mRawPtr; }; -class NS_COM_GLUE nsQueryInterfaceWithError +class nsQueryInterfaceWithError { public: nsQueryInterfaceWithError(nsISupports* aRawPtr, nsresult* aError) @@ -350,7 +349,7 @@ do_QueryInterface(already_AddRefed&, nsresult*) //////////////////////////////////////////////////////////////////////////// // Using servicemanager with COMPtrs -class NS_COM_GLUE nsGetServiceByCID +class nsGetServiceByCID { public: explicit nsGetServiceByCID(const nsCID& aCID) : mCID(aCID) {} @@ -361,7 +360,7 @@ private: const nsCID& mCID; }; -class NS_COM_GLUE nsGetServiceByCIDWithError +class nsGetServiceByCIDWithError { public: nsGetServiceByCIDWithError(const nsCID& aCID, nsresult* aErrorPtr) @@ -377,7 +376,7 @@ private: nsresult* mErrorPtr; }; -class NS_COM_GLUE nsGetServiceByContractID +class nsGetServiceByContractID { public: explicit nsGetServiceByContractID(const char* aContractID) @@ -391,7 +390,7 @@ private: const char* mContractID; }; -class NS_COM_GLUE nsGetServiceByContractIDWithError +class nsGetServiceByContractIDWithError { public: nsGetServiceByContractIDWithError(const char* aContractID, nsresult* aErrorPtr) @@ -421,7 +420,7 @@ class nsCOMPtr_base public: explicit nsCOMPtr_base(nsISupports* aRawPtr = 0) : mRawPtr(aRawPtr) {} - NS_COM_GLUE NS_CONSTRUCTOR_FASTCALL ~nsCOMPtr_base() + NS_CONSTRUCTOR_FASTCALL ~nsCOMPtr_base() { NSCAP_LOG_RELEASE(this, mRawPtr); if (mRawPtr) { @@ -429,24 +428,24 @@ public: } } - NS_COM_GLUE void NS_FASTCALL + void NS_FASTCALL assign_with_AddRef(nsISupports*); - NS_COM_GLUE void NS_FASTCALL + void NS_FASTCALL assign_from_qi(const nsQueryInterface, const nsIID&); - NS_COM_GLUE void NS_FASTCALL + void NS_FASTCALL assign_from_qi_with_error(const nsQueryInterfaceWithError&, const nsIID&); - NS_COM_GLUE void NS_FASTCALL + void NS_FASTCALL assign_from_gs_cid(const nsGetServiceByCID, const nsIID&); - NS_COM_GLUE void NS_FASTCALL + void NS_FASTCALL assign_from_gs_cid_with_error(const nsGetServiceByCIDWithError&, const nsIID&); - NS_COM_GLUE void NS_FASTCALL + void NS_FASTCALL assign_from_gs_contractid(const nsGetServiceByContractID, const nsIID&); - NS_COM_GLUE void NS_FASTCALL + void NS_FASTCALL assign_from_gs_contractid_with_error(const nsGetServiceByContractIDWithError&, const nsIID&); - NS_COM_GLUE void NS_FASTCALL + void NS_FASTCALL assign_from_helper(const nsCOMPtr_helper&, const nsIID&); - NS_COM_GLUE void** NS_FASTCALL + void** NS_FASTCALL begin_assignment(); protected: diff --git a/xpcom/glue/nsCRTGlue.h b/xpcom/glue/nsCRTGlue.h index 067727e8ece7..1c10611a0e11 100644 --- a/xpcom/glue/nsCRTGlue.h +++ b/xpcom/glue/nsCRTGlue.h @@ -17,7 +17,7 @@ * @param aDelims The set of delimiters (null-terminated) * @param aStr The string to search (null-terminated) */ -NS_COM_GLUE const char* NS_strspnp(const char* aDelims, const char* aStr); +const char* NS_strspnp(const char* aDelims, const char* aStr); /** * Tokenize a string. This function is similar to the strtok function in the @@ -35,39 +35,39 @@ NS_COM_GLUE const char* NS_strspnp(const char* aDelims, const char* aStr); * @return The token. If no token is found (the string is only * delimiter characters), nullptr is returned. */ -NS_COM_GLUE char* NS_strtok(const char* aDelims, char** aStr); +char* NS_strtok(const char* aDelims, char** aStr); /** * "strlen" for char16_t strings */ -NS_COM_GLUE uint32_t NS_strlen(const char16_t* aString); +uint32_t NS_strlen(const char16_t* aString); /** * "strcmp" for char16_t strings */ -NS_COM_GLUE int NS_strcmp(const char16_t* aStrA, const char16_t* aStrB); +int NS_strcmp(const char16_t* aStrA, const char16_t* aStrB); /** * "strdup" for char16_t strings, uses the NS_Alloc allocator. */ -NS_COM_GLUE char16_t* NS_strdup(const char16_t* aString); +char16_t* NS_strdup(const char16_t* aString); /** * "strdup", but using the NS_Alloc allocator. */ -NS_COM_GLUE char* NS_strdup(const char* aString); +char* NS_strdup(const char* aString); /** * strndup for char16_t strings... this function will ensure that the * new string is null-terminated. Uses the NS_Alloc allocator. */ -NS_COM_GLUE char16_t* NS_strndup(const char16_t* aString, uint32_t aLen); +char16_t* NS_strndup(const char16_t* aString, uint32_t aLen); // The following case-conversion methods only deal in the ascii repertoire // A-Z and a-z // semi-private data declarations... don't use these directly. -class NS_COM_GLUE nsLowerUpperUtils +class nsLowerUpperUtils { public: static const unsigned char kLower2Upper[256]; @@ -86,19 +86,19 @@ NS_ToLower(char aChar) return (char)nsLowerUpperUtils::kUpper2Lower[(unsigned char)aChar]; } -NS_COM_GLUE bool NS_IsUpper(char aChar); -NS_COM_GLUE bool NS_IsLower(char aChar); +bool NS_IsUpper(char aChar); +bool NS_IsLower(char aChar); -NS_COM_GLUE bool NS_IsAscii(char16_t aChar); -NS_COM_GLUE bool NS_IsAscii(const char16_t* aString); -NS_COM_GLUE bool NS_IsAsciiAlpha(char16_t aChar); -NS_COM_GLUE bool NS_IsAsciiDigit(char16_t aChar); -NS_COM_GLUE bool NS_IsAsciiWhitespace(char16_t aChar); -NS_COM_GLUE bool NS_IsAscii(const char* aString); -NS_COM_GLUE bool NS_IsAscii(const char* aString, uint32_t aLength); +bool NS_IsAscii(char16_t aChar); +bool NS_IsAscii(const char16_t* aString); +bool NS_IsAsciiAlpha(char16_t aChar); +bool NS_IsAsciiDigit(char16_t aChar); +bool NS_IsAsciiWhitespace(char16_t aChar); +bool NS_IsAscii(const char* aString); +bool NS_IsAscii(const char* aString, uint32_t aLength); #ifndef XPCOM_GLUE_AVOID_NSPR -NS_COM_GLUE void NS_MakeRandomString(char* aBuf, int32_t aBufLen); +void NS_MakeRandomString(char* aBuf, int32_t aBufLen); #endif #define FF '\f' diff --git a/xpcom/glue/nsCategoryCache.h b/xpcom/glue/nsCategoryCache.h index 8f9cd5a1eb87..b9d3029c8f96 100644 --- a/xpcom/glue/nsCategoryCache.h +++ b/xpcom/glue/nsCategoryCache.h @@ -22,7 +22,7 @@ #include "nsXPCOM.h" -class NS_COM_GLUE nsCategoryObserver MOZ_FINAL : public nsIObserver +class nsCategoryObserver MOZ_FINAL : public nsIObserver { ~nsCategoryObserver(); diff --git a/xpcom/glue/nsComponentManagerUtils.h b/xpcom/glue/nsComponentManagerUtils.h index 596163255269..cb097e9bcdf8 100644 --- a/xpcom/glue/nsComponentManagerUtils.h +++ b/xpcom/glue/nsComponentManagerUtils.h @@ -13,22 +13,20 @@ #include "nsIFactory.h" -NS_COM_GLUE nsresult CallCreateInstance(const nsCID& aClass, - nsISupports* aDelegate, - const nsIID& aIID, void** aResult); +nsresult CallCreateInstance(const nsCID& aClass, nsISupports* aDelegate, + const nsIID& aIID, void** aResult); -NS_COM_GLUE nsresult CallCreateInstance(const char* aContractID, - nsISupports* aDelegate, - const nsIID& aIID, void** aResult); +nsresult CallCreateInstance(const char* aContractID, nsISupports* aDelegate, + const nsIID& aIID, void** aResult); -NS_COM_GLUE nsresult CallGetClassObject(const nsCID& aClass, const nsIID& aIID, - void** aResult); +nsresult CallGetClassObject(const nsCID& aClass, const nsIID& aIID, + void** aResult); -NS_COM_GLUE nsresult CallGetClassObject(const char* aContractID, - const nsIID& aIID, void** aResult); +nsresult CallGetClassObject(const char* aContractID, const nsIID& aIID, + void** aResult); -class NS_COM_GLUE nsCreateInstanceByCID : public nsCOMPtr_helper +class nsCreateInstanceByCID : public nsCOMPtr_helper { public: nsCreateInstanceByCID(const nsCID& aCID, nsISupports* aOuter, @@ -47,7 +45,7 @@ private: nsresult* mErrorPtr; }; -class NS_COM_GLUE nsCreateInstanceByContractID : public nsCOMPtr_helper +class nsCreateInstanceByContractID : public nsCOMPtr_helper { public: nsCreateInstanceByContractID(const char* aContractID, nsISupports* aOuter, @@ -66,7 +64,7 @@ private: nsresult* mErrorPtr; }; -class NS_COM_GLUE nsCreateInstanceFromFactory : public nsCOMPtr_helper +class nsCreateInstanceFromFactory : public nsCOMPtr_helper { public: nsCreateInstanceFromFactory(nsIFactory* aFactory, nsISupports* aOuter, @@ -125,7 +123,7 @@ do_CreateInstance(nsIFactory* aFactory, nsISupports* aOuter, } -class NS_COM_GLUE nsGetClassObjectByCID : public nsCOMPtr_helper +class nsGetClassObjectByCID : public nsCOMPtr_helper { public: nsGetClassObjectByCID(const nsCID& aCID, nsresult* aErrorPtr) @@ -141,7 +139,7 @@ private: nsresult* mErrorPtr; }; -class NS_COM_GLUE nsGetClassObjectByContractID : public nsCOMPtr_helper +class nsGetClassObjectByContractID : public nsCOMPtr_helper { public: nsGetClassObjectByContractID(const char* aContractID, nsresult* aErrorPtr) diff --git a/xpcom/glue/nsCycleCollectionParticipant.h b/xpcom/glue/nsCycleCollectionParticipant.h index 3b8212a24d64..82065082606a 100644 --- a/xpcom/glue/nsCycleCollectionParticipant.h +++ b/xpcom/glue/nsCycleCollectionParticipant.h @@ -184,8 +184,8 @@ public: NS_IMETHOD_(void) Trace(void* aPtr, const TraceCallbacks& aCb, void* aClosure) = 0; - static void NS_COM_GLUE NoteJSChild(void* aScriptThing, const char* aName, - void* aClosure); + static void NoteJSChild(void* aScriptThing, const char* aName, + void* aClosure); }; class NS_NO_VTABLE nsXPCOMCycleCollectionParticipant : public nsScriptObjectTracer diff --git a/xpcom/glue/nsDebug.h b/xpcom/glue/nsDebug.h index f2d02fc37a75..d95563924213 100644 --- a/xpcom/glue/nsDebug.h +++ b/xpcom/glue/nsDebug.h @@ -402,16 +402,16 @@ typedef void (*StderrCallback)(const char* aFmt, va_list aArgs); extern "C" { #endif -NS_COM_GLUE void printf_stderr(const char* aFmt, ...); +void printf_stderr(const char* aFmt, ...); -NS_COM_GLUE void vprintf_stderr(const char* aFmt, va_list aArgs); +void vprintf_stderr(const char* aFmt, va_list aArgs); // fprintf with special handling for stderr to print to the console -NS_COM_GLUE void fprintf_stderr(FILE* aFile, const char* aFmt, ...); +void fprintf_stderr(FILE* aFile, const char* aFmt, ...); // used by the profiler to log stderr in the profiler for more // advanced performance debugging and display/layers visualization. -NS_COM_GLUE void set_stderr_callback(StderrCallback aCallback); +void set_stderr_callback(StderrCallback aCallback); #ifdef __cplusplus } diff --git a/xpcom/glue/nsDeque.h b/xpcom/glue/nsDeque.h index 857d9bb2bd0c..bb65217e689b 100644 --- a/xpcom/glue/nsDeque.h +++ b/xpcom/glue/nsDeque.h @@ -61,7 +61,7 @@ public: class nsDequeIterator; -class NS_COM_GLUE nsDeque +class nsDeque { friend class nsDequeIterator; typedef mozilla::fallible_t fallible_t; @@ -236,7 +236,7 @@ private: * Here comes the nsDequeIterator class... ******************************************************/ -class NS_COM_GLUE nsDequeIterator +class nsDequeIterator { public: /** diff --git a/xpcom/glue/nsEnumeratorUtils.h b/xpcom/glue/nsEnumeratorUtils.h index 997eac0c4a78..f7a0db099e13 100644 --- a/xpcom/glue/nsEnumeratorUtils.h +++ b/xpcom/glue/nsEnumeratorUtils.h @@ -12,13 +12,13 @@ class nsISupports; class nsISimpleEnumerator; -NS_COM_GLUE nsresult NS_NewEmptyEnumerator(nsISimpleEnumerator** aResult); +nsresult NS_NewEmptyEnumerator(nsISimpleEnumerator** aResult); -NS_COM_GLUE nsresult NS_NewSingletonEnumerator(nsISimpleEnumerator** aResult, - nsISupports* aSingleton); +nsresult NS_NewSingletonEnumerator(nsISimpleEnumerator** aResult, + nsISupports* aSingleton); -NS_COM_GLUE nsresult NS_NewUnionEnumerator(nsISimpleEnumerator** aResult, - nsISimpleEnumerator* aFirstEnumerator, - nsISimpleEnumerator* aSecondEnumerator); +nsresult NS_NewUnionEnumerator(nsISimpleEnumerator** aResult, + nsISimpleEnumerator* aFirstEnumerator, + nsISimpleEnumerator* aSecondEnumerator); #endif /* nsEnumeratorUtils_h__ */ diff --git a/xpcom/glue/nsIClassInfoImpl.h b/xpcom/glue/nsIClassInfoImpl.h index cd6dcbbb46aa..d22818bc4ba7 100644 --- a/xpcom/glue/nsIClassInfoImpl.h +++ b/xpcom/glue/nsIClassInfoImpl.h @@ -84,7 +84,7 @@ * as a singleton. */ -class NS_COM_GLUE GenericClassInfo : public nsIClassInfo +class GenericClassInfo : public nsIClassInfo { public: struct ClassInfoData diff --git a/xpcom/glue/nsID.h b/xpcom/glue/nsID.h index 00f22fff7717..f92a8ed64120 100644 --- a/xpcom/glue/nsID.h +++ b/xpcom/glue/nsID.h @@ -54,7 +54,7 @@ struct nsID * nsID Parsing method. Turns a {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} * string into an nsID */ - NS_COM_GLUE bool Parse(const char* aIDStr); + bool Parse(const char* aIDStr); #ifndef XPCOM_GLUE_AVOID_NSPR /** @@ -62,14 +62,14 @@ struct nsID * {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} format. Caller should free string. * YOU SHOULD ONLY USE THIS IF YOU CANNOT USE ToProvidedString() BELOW. */ - NS_COM_GLUE char* ToString() const; + char* ToString() const; /** * nsID string encoder. Builds a string in * {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} format, into a char[NSID_LENGTH] * buffer provided by the caller (for instance, on the stack). */ - NS_COM_GLUE void ToProvidedString(char (&aDest)[NSID_LENGTH]) const; + void ToProvidedString(char (&aDest)[NSID_LENGTH]) const; #endif // XPCOM_GLUE_AVOID_NSPR diff --git a/xpcom/glue/nsIInterfaceRequestorUtils.h b/xpcom/glue/nsIInterfaceRequestorUtils.h index 5e0c9dcc12d9..e4bafc2c2968 100644 --- a/xpcom/glue/nsIInterfaceRequestorUtils.h +++ b/xpcom/glue/nsIInterfaceRequestorUtils.h @@ -22,7 +22,7 @@ CallGetInterface(T* aSource, DestinationType** aDestination) reinterpret_cast(aDestination)); } -class NS_COM_GLUE nsGetInterface : public nsCOMPtr_helper +class nsGetInterface : public nsCOMPtr_helper { public: nsGetInterface(nsISupports* aSource, nsresult* aError) diff --git a/xpcom/glue/nsINIParser.h b/xpcom/glue/nsINIParser.h index 428b801ca94e..ef3e56b73411 100644 --- a/xpcom/glue/nsINIParser.h +++ b/xpcom/glue/nsINIParser.h @@ -21,7 +21,7 @@ class nsIFile; -class NS_COM_GLUE nsINIParser +class nsINIParser { public: nsINIParser() {} diff --git a/xpcom/glue/nsISupportsImpl.h b/xpcom/glue/nsISupportsImpl.h index 5529325c42c9..14c91ccc720e 100644 --- a/xpcom/glue/nsISupportsImpl.h +++ b/xpcom/glue/nsISupportsImpl.h @@ -747,7 +747,7 @@ struct QITableEntry int32_t offset; }; -NS_COM_GLUE nsresult NS_FASTCALL +nsresult NS_FASTCALL NS_TableDrivenQI(void* aThis, REFNSIID aIID, void** aInstancePtr, const QITableEntry* aEntries); diff --git a/xpcom/glue/nsIWeakReferenceUtils.h b/xpcom/glue/nsIWeakReferenceUtils.h index a2b1fa42366d..684a7af40cb1 100644 --- a/xpcom/glue/nsIWeakReferenceUtils.h +++ b/xpcom/glue/nsIWeakReferenceUtils.h @@ -30,7 +30,7 @@ CallQueryReferent(T* aSource, DestinationType** aDestination) } -class NS_COM_GLUE nsQueryReferent : public nsCOMPtr_helper +class nsQueryReferent : public nsCOMPtr_helper { public: nsQueryReferent(nsIWeakReference* aWeakPtr, nsresult* aError) @@ -56,8 +56,8 @@ do_QueryReferent(nsIWeakReference* aRawPtr, nsresult* aError = 0) /** * Deprecated, use |do_GetWeakReference| instead. */ -extern NS_COM_GLUE nsIWeakReference* NS_GetWeakReference(nsISupports*, - nsresult* aResult = 0); +extern nsIWeakReference* NS_GetWeakReference(nsISupports*, + nsresult* aResult = 0); /** * |do_GetWeakReference| is a convenience function that bundles up all the work needed diff --git a/xpcom/glue/nsMemory.cpp b/xpcom/glue/nsMemory.cpp index a35d54d7bae8..3bf7c1f0feba 100644 --- a/xpcom/glue/nsMemory.cpp +++ b/xpcom/glue/nsMemory.cpp @@ -15,7 +15,7 @@ //////////////////////////////////////////////////////////////////////////////// // nsMemory static helper routines -NS_COM_GLUE nsresult +nsresult nsMemory::HeapMinimize(bool aImmediate) { nsCOMPtr mem; @@ -27,7 +27,7 @@ nsMemory::HeapMinimize(bool aImmediate) return mem->HeapMinimize(aImmediate); } -NS_COM_GLUE void* +void* nsMemory::Clone(const void* aPtr, size_t aSize) { void* newPtr = NS_Alloc(aSize); @@ -37,7 +37,7 @@ nsMemory::Clone(const void* aPtr, size_t aSize) return newPtr; } -NS_COM_GLUE nsIMemory* +nsIMemory* nsMemory::GetGlobalMemoryService() { nsIMemory* mem; diff --git a/xpcom/glue/nsMemory.h b/xpcom/glue/nsMemory.h index ec78a8c3a156..bfbc8f74297c 100644 --- a/xpcom/glue/nsMemory.h +++ b/xpcom/glue/nsMemory.h @@ -48,9 +48,9 @@ public: NS_Free(aPtr); } - static NS_COM_GLUE nsresult HeapMinimize(bool aImmediate); - static NS_COM_GLUE void* Clone(const void* aPtr, size_t aSize); - static NS_COM_GLUE nsIMemory* GetGlobalMemoryService(); // AddRefs + static nsresult HeapMinimize(bool aImmediate); + static void* Clone(const void* aPtr, size_t aSize); + static nsIMemory* GetGlobalMemoryService(); // AddRefs }; /** diff --git a/xpcom/glue/nsProxyRelease.h b/xpcom/glue/nsProxyRelease.h index a365e1ae4a7f..9298730fbe17 100644 --- a/xpcom/glue/nsProxyRelease.h +++ b/xpcom/glue/nsProxyRelease.h @@ -61,7 +61,7 @@ NS_ProxyRelease(nsIEventTarget* aTarget, nsRefPtr& aDoomed, * true, then an event will always be posted to the target thread for * asynchronous release. */ -NS_COM_GLUE nsresult +nsresult NS_ProxyRelease(nsIEventTarget* aTarget, nsISupports* aDoomed, bool aAlwaysProxy = false); diff --git a/xpcom/glue/nsQuickSort.h b/xpcom/glue/nsQuickSort.h index 7179dc21186f..e8d8ed8709ba 100644 --- a/xpcom/glue/nsQuickSort.h +++ b/xpcom/glue/nsQuickSort.h @@ -30,9 +30,9 @@ extern "C" { * + greater than zero if the second element should be before the first * 5. extra data to pass to comparison function */ -NS_COM_GLUE void NS_QuickSort(void*, unsigned int, unsigned int, - int (*)(const void*, const void*, void*), - void*); +void NS_QuickSort(void*, unsigned int, unsigned int, + int (*)(const void*, const void*, void*), + void*); #ifdef __cplusplus } diff --git a/xpcom/glue/nsServiceManagerUtils.h b/xpcom/glue/nsServiceManagerUtils.h index f1343312825b..09cd26d3140c 100644 --- a/xpcom/glue/nsServiceManagerUtils.h +++ b/xpcom/glue/nsServiceManagerUtils.h @@ -59,11 +59,10 @@ do_GetServiceFromCategory(const char* aCategory, const char* aEntry, return nsGetServiceFromCategory(aCategory, aEntry, aError); } -NS_COM_GLUE nsresult CallGetService(const nsCID& aClass, const nsIID& aIID, - void** aResult); +nsresult CallGetService(const nsCID& aClass, const nsIID& aIID, void** aResult); -NS_COM_GLUE nsresult CallGetService(const char* aContractID, const nsIID& aIID, - void** aResult); +nsresult CallGetService(const char* aContractID, const nsIID& aIID, + void** aResult); // type-safe shortcuts for calling |GetService| template diff --git a/xpcom/glue/nsStringAPI.h b/xpcom/glue/nsStringAPI.h index 8dec8bcb95c6..dcff6bee56a7 100644 --- a/xpcom/glue/nsStringAPI.h +++ b/xpcom/glue/nsStringAPI.h @@ -1163,7 +1163,7 @@ CopyASCIItoUTF16(const nsACString& aSource, nsAString& aDest) NS_CStringToUTF16(aSource, NS_CSTRING_ENCODING_ASCII, aDest); } -NS_COM_GLUE char* +char* ToNewUTF8String(const nsAString& aSource); class NS_ConvertASCIItoUTF16 : public nsString @@ -1359,7 +1359,7 @@ getter_Copies(nsCString& aString) * substrings */ -class NS_COM_GLUE nsDependentSubstring : public nsStringContainer +class nsDependentSubstring : public nsStringContainer { public: typedef nsDependentSubstring self_type; @@ -1392,7 +1392,7 @@ private: self_type& operator=(const self_type& aString) MOZ_DELETE; }; -class NS_COM_GLUE nsDependentCSubstring : public nsCStringContainer +class nsDependentCSubstring : public nsCStringContainer { public: typedef nsDependentCSubstring self_type; diff --git a/xpcom/glue/nsTArray.h b/xpcom/glue/nsTArray.h index d978d206a8c2..96ee1e4b1193 100644 --- a/xpcom/glue/nsTArray.h +++ b/xpcom/glue/nsTArray.h @@ -227,7 +227,7 @@ struct nsTArrayInfallibleAllocator : nsTArrayInfallibleAllocatorBase // nsTArray_base stores elements into the space allocated beyond // sizeof(*this). This is done to minimize the size of the nsTArray // object when it is empty. -struct NS_COM_GLUE nsTArrayHeader +struct nsTArrayHeader { static nsTArrayHeader sEmptyHdr; diff --git a/xpcom/glue/nsTHashtable.h b/xpcom/glue/nsTHashtable.h index 2adad882778b..ab9cc1b7a90d 100644 --- a/xpcom/glue/nsTHashtable.h +++ b/xpcom/glue/nsTHashtable.h @@ -19,10 +19,10 @@ #include // helper function for nsTHashtable::Clear() -NS_COM_GLUE PLDHashOperator PL_DHashStubEnumRemove(PLDHashTable* aTable, - PLDHashEntryHdr* aEntry, - uint32_t aOrdinal, - void* aUserArg); +PLDHashOperator PL_DHashStubEnumRemove(PLDHashTable* aTable, + PLDHashEntryHdr* aEntry, + uint32_t aOrdinal, + void* aUserArg); /** diff --git a/xpcom/glue/nsTObserverArray.h b/xpcom/glue/nsTObserverArray.h index 04cff1f3356f..f3d6f078b42d 100644 --- a/xpcom/glue/nsTObserverArray.h +++ b/xpcom/glue/nsTObserverArray.h @@ -21,7 +21,7 @@ * @see nsTObserverArray, nsTArray */ -class NS_COM_GLUE nsTObserverArray_base +class nsTObserverArray_base { public: typedef size_t index_type; diff --git a/xpcom/glue/nsTextFormatter.h b/xpcom/glue/nsTextFormatter.h index 0179f32fa29a..c8fb3deec494 100644 --- a/xpcom/glue/nsTextFormatter.h +++ b/xpcom/glue/nsTextFormatter.h @@ -40,7 +40,7 @@ #error "nsTextFormatter is not available in the standalone glue due to NSPR dependencies." #endif -class NS_COM_GLUE nsTextFormatter +class nsTextFormatter { public: diff --git a/xpcom/glue/nsThreadUtils.h b/xpcom/glue/nsThreadUtils.h index bf2c97189427..47c7eaee4fe6 100644 --- a/xpcom/glue/nsThreadUtils.h +++ b/xpcom/glue/nsThreadUtils.h @@ -26,15 +26,14 @@ /** * Set name of the target thread. This operation is asynchronous. */ -extern NS_COM_GLUE void NS_SetThreadName(nsIThread* aThread, - const nsACString& aName); +extern void NS_SetThreadName(nsIThread* aThread, const nsACString& aName); /** * Static length version of the above function checking length of the * name at compile time. */ template -inline NS_COM_GLUE void +inline void NS_SetThreadName(nsIThread* aThread, const char (&aName)[LEN]) { static_assert(LEN <= 16, @@ -55,7 +54,7 @@ NS_SetThreadName(nsIThread* aThread, const char (&aName)[LEN]) * @returns NS_ERROR_INVALID_ARG * Indicates that the given name is not unique. */ -extern NS_COM_GLUE NS_METHOD +extern NS_METHOD NS_NewThread(nsIThread** aResult, nsIRunnable* aInitialEvent = nullptr, uint32_t aStackSize = nsIThreadManager::DEFAULT_STACK_SIZE); @@ -93,7 +92,7 @@ NS_NewNamedThread(const char (&aName)[LEN], * @param aResult * The resulting nsIThread object. */ -extern NS_COM_GLUE NS_METHOD NS_GetCurrentThread(nsIThread** aResult); +extern NS_METHOD NS_GetCurrentThread(nsIThread** aResult); /** * Dispatch the given event to the current thread. @@ -104,7 +103,7 @@ extern NS_COM_GLUE NS_METHOD NS_GetCurrentThread(nsIThread** aResult); * @returns NS_ERROR_INVALID_ARG * If event is null. */ -extern NS_COM_GLUE NS_METHOD NS_DispatchToCurrentThread(nsIRunnable* aEvent); +extern NS_METHOD NS_DispatchToCurrentThread(nsIRunnable* aEvent); /** * Dispatch the given event to the main thread. @@ -117,7 +116,7 @@ extern NS_COM_GLUE NS_METHOD NS_DispatchToCurrentThread(nsIRunnable* aEvent); * @returns NS_ERROR_INVALID_ARG * If event is null. */ -extern NS_COM_GLUE NS_METHOD +extern NS_METHOD NS_DispatchToMainThread(nsIRunnable* aEvent, uint32_t aDispatchFlags = NS_DISPATCH_NORMAL); @@ -137,7 +136,7 @@ NS_DispatchToMainThread(nsIRunnable* aEvent, * value is simply used to determine whether or not to process another event. * Pass PR_INTERVAL_NO_TIMEOUT to specify no timeout. */ -extern NS_COM_GLUE NS_METHOD +extern NS_METHOD NS_ProcessPendingEvents(nsIThread* aThread, PRIntervalTime aTimeout = PR_INTERVAL_NO_TIMEOUT); #endif @@ -156,7 +155,7 @@ NS_ProcessPendingEvents(nsIThread* aThread, * A boolean value that if "true" indicates that there are pending events * in the current thread's event queue. */ -extern NS_COM_GLUE bool NS_HasPendingEvents(nsIThread* aThread = nullptr); +extern bool NS_HasPendingEvents(nsIThread* aThread = nullptr); /** * Shortcut for nsIThread::ProcessNextEvent. @@ -175,8 +174,8 @@ extern NS_COM_GLUE bool NS_HasPendingEvents(nsIThread* aThread = nullptr); * A boolean value that if "true" indicates that an event from the current * thread's event queue was processed. */ -extern NS_COM_GLUE bool NS_ProcessNextEvent(nsIThread* aThread = nullptr, - bool aMayWait = true); +extern bool NS_ProcessNextEvent(nsIThread* aThread = nullptr, + bool aMayWait = true); //----------------------------------------------------------------------------- // Helpers that work with nsCOMPtr: @@ -204,18 +203,15 @@ do_GetMainThread() // you want to use this pointer from some other thread, then you will need to // AddRef it. Otherwise, you should only consider this pointer valid from code // running on the current thread. -extern NS_COM_GLUE nsIThread* NS_GetCurrentThread(); +extern nsIThread* NS_GetCurrentThread(); #endif //----------------------------------------------------------------------------- #ifndef XPCOM_GLUE_AVOID_NSPR -#undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY NS_COM_GLUE - // This class is designed to be subclassed. -class NS_COM_GLUE nsRunnable : public nsIRunnable +class nsRunnable : public nsIRunnable { public: NS_DECL_THREADSAFE_ISUPPORTS @@ -228,7 +224,7 @@ protected: }; // This class is designed to be subclassed. -class NS_COM_GLUE nsCancelableRunnable : public nsICancelableRunnable +class nsCancelableRunnable : public nsICancelableRunnable { public: NS_DECL_THREADSAFE_ISUPPORTS @@ -241,9 +237,6 @@ protected: virtual ~nsCancelableRunnable() {} }; -#undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY - // An event that can be used to call a method on a class. The class type must // support reference counting. This event supports Revoke for use // with nsRevocableEventPtr. diff --git a/xpcom/glue/nsVersionComparator.h b/xpcom/glue/nsVersionComparator.h index 08a1db18e46a..0dbf8532b0b6 100644 --- a/xpcom/glue/nsVersionComparator.h +++ b/xpcom/glue/nsVersionComparator.h @@ -43,14 +43,13 @@ namespace mozilla { -int32_t NS_COM_GLUE CompareVersions(const char* aStrA, const char* aStrB); +int32_t CompareVersions(const char* aStrA, const char* aStrB); #ifdef XP_WIN -int32_t NS_COM_GLUE CompareVersions(const char16_t* aStrA, - const char16_t* aStrB); +int32_t CompareVersions(const char16_t* aStrA, const char16_t* aStrB); #endif -struct NS_COM_GLUE Version +struct Version { explicit Version(const char* aVersionString) { @@ -121,7 +120,7 @@ private: }; #ifdef XP_WIN -struct NS_COM_GLUE VersionW +struct VersionW { VersionW(const char16_t* aVersionStringW) { diff --git a/xpcom/glue/nsVoidArray.h b/xpcom/glue/nsVoidArray.h index 012a55e380c6..314ad57f2742 100644 --- a/xpcom/glue/nsVoidArray.h +++ b/xpcom/glue/nsVoidArray.h @@ -26,7 +26,7 @@ typedef size_t (*nsVoidArraySizeOfElementIncludingThisFunc)( const void* aElement, mozilla::MallocSizeOf aMallocSizeOf, void* aData); /// A basic zero-based array of void*'s that manages its own memory -class NS_COM_GLUE nsVoidArray +class nsVoidArray { public: nsVoidArray(); @@ -177,7 +177,7 @@ private: // today, there should not be any virtualness to it to avoid the vtable // ptr overhead. -class NS_COM_GLUE nsSmallVoidArray : private nsVoidArray +class nsSmallVoidArray : private nsVoidArray { public: ~nsSmallVoidArray(); diff --git a/xpcom/glue/nsWeakReference.cpp b/xpcom/glue/nsWeakReference.cpp index f4a0e1ea7cf7..480b8eebd746 100644 --- a/xpcom/glue/nsWeakReference.cpp +++ b/xpcom/glue/nsWeakReference.cpp @@ -66,7 +66,7 @@ nsQueryReferent::operator()(const nsIID& aIID, void** aAnswer) const return status; } -NS_COM_GLUE nsIWeakReference* // or else |already_AddRefed| +nsIWeakReference* // or else |already_AddRefed| NS_GetWeakReference(nsISupports* aInstancePtr, nsresult* aErrorPtr) { nsresult status; @@ -90,7 +90,7 @@ NS_GetWeakReference(nsISupports* aInstancePtr, nsresult* aErrorPtr) return result; } -NS_COM_GLUE nsresult +nsresult nsSupportsWeakReference::GetWeakReference(nsIWeakReference** aInstancePtr) { if (!aInstancePtr) { diff --git a/xpcom/glue/nsWeakReference.h b/xpcom/glue/nsWeakReference.h index bd96caa6f569..3519a2cb5e3e 100644 --- a/xpcom/glue/nsWeakReference.h +++ b/xpcom/glue/nsWeakReference.h @@ -15,12 +15,7 @@ class nsWeakReference; -// Set IMETHOD_VISIBILITY to empty so that the class-level NS_COM declaration -// controls member method visibility. -#undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY NS_COM_GLUE - -class NS_COM_GLUE nsSupportsWeakReference : public nsISupportsWeakReference +class nsSupportsWeakReference : public nsISupportsWeakReference { public: nsSupportsWeakReference() : mProxy(0) {} @@ -44,9 +39,6 @@ protected: bool HasWeakReferences() const { return mProxy != 0; } }; -#undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY - inline nsSupportsWeakReference::~nsSupportsWeakReference() { diff --git a/xpcom/glue/pldhash.h b/xpcom/glue/pldhash.h index 30a4ad491958..9c5f4867af83 100644 --- a/xpcom/glue/pldhash.h +++ b/xpcom/glue/pldhash.h @@ -385,12 +385,11 @@ struct PLDHashTableOps /* * Default implementations for the above ops. */ -NS_COM_GLUE void* PL_DHashAllocTable(PLDHashTable* aTable, uint32_t aNBytes); +void* PL_DHashAllocTable(PLDHashTable* aTable, uint32_t aNBytes); -NS_COM_GLUE void PL_DHashFreeTable(PLDHashTable* aTable, void* aPtr); +void PL_DHashFreeTable(PLDHashTable* aTable, void* aPtr); -NS_COM_GLUE PLDHashNumber PL_DHashStringKey(PLDHashTable* aTable, - const void* aKey); +PLDHashNumber PL_DHashStringKey(PLDHashTable* aTable, const void* aKey); /* A minimal entry contains a keyHash header and a void key pointer. */ struct PLDHashEntryStub @@ -399,36 +398,33 @@ struct PLDHashEntryStub const void* key; }; -NS_COM_GLUE PLDHashNumber PL_DHashVoidPtrKeyStub(PLDHashTable* aTable, - const void* aKey); +PLDHashNumber PL_DHashVoidPtrKeyStub(PLDHashTable* aTable, const void* aKey); -NS_COM_GLUE bool PL_DHashMatchEntryStub(PLDHashTable* aTable, - const PLDHashEntryHdr* aEntry, - const void* aKey); +bool PL_DHashMatchEntryStub(PLDHashTable* aTable, + const PLDHashEntryHdr* aEntry, + const void* aKey); -NS_COM_GLUE bool PL_DHashMatchStringKey(PLDHashTable* aTable, - const PLDHashEntryHdr* aEntry, - const void* aKey); +bool PL_DHashMatchStringKey(PLDHashTable* aTable, + const PLDHashEntryHdr* aEntry, + const void* aKey); -NS_COM_GLUE void +void PL_DHashMoveEntryStub(PLDHashTable* aTable, const PLDHashEntryHdr* aFrom, PLDHashEntryHdr* aTo); -NS_COM_GLUE void PL_DHashClearEntryStub(PLDHashTable* aTable, - PLDHashEntryHdr* aEntry); +void PL_DHashClearEntryStub(PLDHashTable* aTable, PLDHashEntryHdr* aEntry); -NS_COM_GLUE void PL_DHashFreeStringKey(PLDHashTable* aTable, - PLDHashEntryHdr* aEntry); +void PL_DHashFreeStringKey(PLDHashTable* aTable, PLDHashEntryHdr* aEntry); -NS_COM_GLUE void PL_DHashFinalizeStub(PLDHashTable* aTable); +void PL_DHashFinalizeStub(PLDHashTable* aTable); /* * If you use PLDHashEntryStub or a subclass of it as your entry struct, and * if your entries move via memcpy and clear via memset(0), you can use these * stub operations. */ -NS_COM_GLUE const PLDHashTableOps* PL_DHashGetStubOps(void); +const PLDHashTableOps* PL_DHashGetStubOps(void); /* * Dynamically allocate a new PLDHashTable using malloc, initialize it using @@ -436,7 +432,7 @@ NS_COM_GLUE const PLDHashTableOps* PL_DHashGetStubOps(void); * Note that the entry storage at aTable->mEntryStore will be allocated using * the aOps->allocTable callback. */ -NS_COM_GLUE PLDHashTable* PL_NewDHashTable( +PLDHashTable* PL_NewDHashTable( const PLDHashTableOps* aOps, void* aData, uint32_t aEntrySize, uint32_t aLength = PL_DHASH_DEFAULT_INITIAL_LENGTH); @@ -444,7 +440,7 @@ NS_COM_GLUE PLDHashTable* PL_NewDHashTable( * Finalize aTable's data, free its entry storage (via aTable->ops->freeTable), * and return the memory starting at aTable to the malloc heap. */ -NS_COM_GLUE void PL_DHashTableDestroy(PLDHashTable* aTable); +void PL_DHashTableDestroy(PLDHashTable* aTable); /* * Initialize aTable with aOps, aData, aEntrySize, and aCapacity. The table's @@ -455,7 +451,7 @@ NS_COM_GLUE void PL_DHashTableDestroy(PLDHashTable* aTable); * This function will crash if it can't allocate enough memory, or if * |aEntrySize| and/or |aLength| are too large. */ -NS_COM_GLUE void PL_DHashTableInit( +void PL_DHashTableInit( PLDHashTable* aTable, const PLDHashTableOps* aOps, void* aData, uint32_t aEntrySize, uint32_t aLength = PL_DHASH_DEFAULT_INITIAL_LENGTH); @@ -463,7 +459,7 @@ NS_COM_GLUE void PL_DHashTableInit( * Initialize aTable. This is the same as PL_DHashTableInit, except that it * returns a boolean indicating success, rather than crashing on failure. */ -MOZ_WARN_UNUSED_RESULT NS_COM_GLUE bool PL_DHashTableInit( +MOZ_WARN_UNUSED_RESULT bool PL_DHashTableInit( PLDHashTable* aTable, const PLDHashTableOps* aOps, void* aData, uint32_t aEntrySize, const mozilla::fallible_t&, uint32_t aLength = PL_DHASH_DEFAULT_INITIAL_LENGTH); @@ -474,7 +470,7 @@ MOZ_WARN_UNUSED_RESULT NS_COM_GLUE bool PL_DHashTableInit( * pointers dangling). If you want to burn cycles clearing aTable, it's up to * your code to call memset. */ -NS_COM_GLUE void PL_DHashTableFinish(PLDHashTable* aTable); +void PL_DHashTableFinish(PLDHashTable* aTable); /* * To lookup a key in table, call: @@ -506,7 +502,7 @@ NS_COM_GLUE void PL_DHashTableFinish(PLDHashTable* aTable); * the entry is marked so that PL_DHASH_ENTRY_IS_FREE(entry). This operation * returns null unconditionally; you should ignore its return value. */ -NS_COM_GLUE PLDHashEntryHdr* PL_DHASH_FASTCALL +PLDHashEntryHdr* PL_DHASH_FASTCALL PL_DHashTableOperate(PLDHashTable* aTable, const void* aKey, PLDHashOperator aOp); @@ -519,10 +515,9 @@ PL_DHashTableOperate(PLDHashTable* aTable, const void* aKey, * shrink the table if it is underloaded. It does not update mStats #ifdef * PL_DHASHMETER, either. */ -NS_COM_GLUE void PL_DHashTableRawRemove(PLDHashTable* aTable, - PLDHashEntryHdr* aEntry); +void PL_DHashTableRawRemove(PLDHashTable* aTable, PLDHashEntryHdr* aEntry); -NS_COM_GLUE uint32_t +uint32_t PL_DHashTableEnumerate(PLDHashTable* aTable, PLDHashEnumerator aEtor, void* aArg); @@ -532,7 +527,7 @@ PL_DHashTableEnumerate(PLDHashTable* aTable, PLDHashEnumerator aEtor, * pointed to by entries. Doesn't measure |ops| because it's often shared * between tables, nor |data| because it's opaque. */ -NS_COM_GLUE size_t PL_DHashTableSizeOfExcludingThis( +size_t PL_DHashTableSizeOfExcludingThis( const PLDHashTable* aTable, PLDHashSizeOfEntryExcludingThisFun aSizeOfEntryExcludingThis, mozilla::MallocSizeOf aMallocSizeOf, void* aArg = nullptr); @@ -540,7 +535,7 @@ NS_COM_GLUE size_t PL_DHashTableSizeOfExcludingThis( /** * Like PL_DHashTableSizeOfExcludingThis, but includes sizeof(*this). */ -NS_COM_GLUE size_t PL_DHashTableSizeOfIncludingThis( +size_t PL_DHashTableSizeOfIncludingThis( const PLDHashTable* aTable, PLDHashSizeOfEntryExcludingThisFun aSizeOfEntryExcludingThis, mozilla::MallocSizeOf aMallocSizeOf, void* aArg = nullptr); @@ -560,12 +555,12 @@ NS_COM_GLUE size_t PL_DHashTableSizeOfIncludingThis( * no longer trigger erroneously due to multi-threaded access. Instead, * mutations will cause assertions. */ -NS_COM_GLUE void PL_DHashMarkTableImmutable(PLDHashTable* aTable); +void PL_DHashMarkTableImmutable(PLDHashTable* aTable); #endif #ifdef PL_DHASHMETER -NS_COM_GLUE void PL_DHashTableDumpMeter(PLDHashTable* aTable, - PLDHashEnumerator aDump, FILE* aFp); +void PL_DHashTableDumpMeter(PLDHashTable* aTable, + PLDHashEnumerator aDump, FILE* aFp); #endif #endif /* pldhash_h___ */ diff --git a/xpcom/glue/unused.h b/xpcom/glue/unused.h index c751a7aa4d98..52ac4a37ee7e 100644 --- a/xpcom/glue/unused.h +++ b/xpcom/glue/unused.h @@ -15,11 +15,11 @@ namespace mozilla { // Suppress GCC warnings about unused return values with // unused << SomeFuncDeclaredWarnUnusedReturnValue(); // -struct NS_COM_GLUE unused_t +struct unused_t { }; -extern const unused_t NS_COM_GLUE unused; +extern const unused_t unused; template inline void