Bug 1058388 - Remove NS_COM_GLUE and IMETHOD_VISIBILITY. r=bsmedberg.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 27 Aug 2014 15:47:27 -0700
changeset 223738 b276ce8752758dac03c664093192c796cdecebb9
parent 223737 1910714b56c64101bdd58e518c43e9248c5ed461
child 223739 3dc7616b254461bf9db829702bdea7497f111435
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1058388
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1058388 - Remove NS_COM_GLUE and IMETHOD_VISIBILITY. r=bsmedberg.
ipc/glue/CrossProcessMutex.h
xpcom/base/nscore.h
xpcom/glue/AppData.h
xpcom/glue/BlockingResourceBase.h
xpcom/glue/CondVar.h
xpcom/glue/FileUtils.h
xpcom/glue/MainThreadUtils.h
xpcom/glue/Monitor.h
xpcom/glue/Mutex.h
xpcom/glue/ReentrantMonitor.h
xpcom/glue/nsArrayEnumerator.h
xpcom/glue/nsArrayUtils.h
xpcom/glue/nsCOMArray.h
xpcom/glue/nsCOMPtr.h
xpcom/glue/nsCRTGlue.h
xpcom/glue/nsCategoryCache.h
xpcom/glue/nsComponentManagerUtils.h
xpcom/glue/nsCycleCollectionParticipant.h
xpcom/glue/nsDebug.h
xpcom/glue/nsDeque.h
xpcom/glue/nsEnumeratorUtils.h
xpcom/glue/nsIClassInfoImpl.h
xpcom/glue/nsID.h
xpcom/glue/nsIInterfaceRequestorUtils.h
xpcom/glue/nsINIParser.h
xpcom/glue/nsISupportsImpl.h
xpcom/glue/nsIWeakReferenceUtils.h
xpcom/glue/nsMemory.cpp
xpcom/glue/nsMemory.h
xpcom/glue/nsProxyRelease.h
xpcom/glue/nsQuickSort.h
xpcom/glue/nsServiceManagerUtils.h
xpcom/glue/nsStringAPI.h
xpcom/glue/nsTArray.h
xpcom/glue/nsTHashtable.h
xpcom/glue/nsTObserverArray.h
xpcom/glue/nsTextFormatter.h
xpcom/glue/nsThreadUtils.h
xpcom/glue/nsVersionComparator.h
xpcom/glue/nsVoidArray.h
xpcom/glue/nsWeakReference.cpp
xpcom/glue/nsWeakReference.h
xpcom/glue/pldhash.h
xpcom/glue/unused.h
--- a/ipc/glue/CrossProcessMutex.h
+++ b/ipc/glue/CrossProcessMutex.h
@@ -37,17 +37,17 @@ typedef HANDLE CrossProcessMutexHandle;
 #elif defined(OS_LINUX)
 typedef mozilla::ipc::SharedMemoryBasic::Handle CrossProcessMutexHandle;
 #else
 // Stub for other platforms. We can't use uintptr_t here since different
 // processes could disagree on its size.
 typedef uintptr_t CrossProcessMutexHandle;
 #endif
 
-class NS_COM_GLUE CrossProcessMutex
+class CrossProcessMutex
 {
 public:
   /**
    * CrossProcessMutex
    * @param name A name which can reference this lock (currently unused)
    **/
   explicit CrossProcessMutex(const char* aName);
   /**
--- a/xpcom/base/nscore.h
+++ b/xpcom/base/nscore.h
@@ -52,19 +52,16 @@
 #endif
 
 #define NS_HIDDEN_(type)   NS_VISIBILITY_HIDDEN type
 #define NS_EXTERNAL_VIS_(type) NS_VISIBILITY_DEFAULT type
 
 #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
  * frequently, to reduce the overhead of the function call.  It is still worth
  * using the macro for C++ functions which take no parameters since it allows
  * passing |this| in a register.
  *
  *  - Do not use this on any scriptable interface method since xptcall won't be
@@ -122,17 +119,17 @@
 #define NS_IMPORT_STATIC_MEMBER_(type) type
 
 #else
 
 #define NS_IMPORT NS_EXTERNAL_VIS
 #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)
 #define NS_STDCALL
 #define NS_FROZENCALL
 #define NS_EXPORT_STATIC_MEMBER_(type) NS_EXTERNAL_VIS_(type)
 #define NS_IMPORT_STATIC_MEMBER_(type) NS_EXTERNAL_VIS_(type)
 
@@ -202,32 +199,25 @@
 #define XPCOM_API(type) EXPORT_XPCOM_API(type)
 #elif defined(XPCOM_GLUE)
 #define XPCOM_API(type) GLUE_XPCOM_API(type)
 #else
 #define XPCOM_API(type) IMPORT_XPCOM_API(type)
 #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
      dllexport symbols this is not a problem, but on ELF systems
      internal symbols can accidentally "shine through"; we rename the
      internal classes to avoid symbol conflicts.
    */
 #  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))
 /* Make refcnt logging part of the build. This doesn't mean that
  * actual logging will occur (that requires a separate enable; see
  * nsTraceRefcnt and nsISupportsImpl.h for more information).  */
 #define NS_BUILD_REFCNT_LOGGING
 #endif
--- a/xpcom/glue/AppData.h
+++ b/xpcom/glue/AppData.h
@@ -11,17 +11,17 @@
 #include "nscore.h"
 #include "nsStringGlue.h"
 #include "nsISupportsUtils.h"
 
 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()
   {
     Zero();
     this->size = sizeof(*this);
   }
 
--- a/xpcom/glue/BlockingResourceBase.h
+++ b/xpcom/glue/BlockingResourceBase.h
@@ -41,17 +41,17 @@ namespace mozilla {
 template <class T> class DeadlockDetector;
 #endif
 
 /**
  * BlockingResourceBase
  * 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.
   enum BlockingResourceType { eMutex, eReentrantMonitor, eCondVar };
 
   /**
    * kResourceTypeName
    * Human-readable version of BlockingResourceType enum.
--- a/xpcom/glue/CondVar.h
+++ b/xpcom/glue/CondVar.h
@@ -19,17 +19,17 @@
 namespace mozilla {
 
 
 /**
  * CondVar
  * 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:
   /**
    * CondVar
    *
    * The CALLER owns |aLock|.
    *
    * @param aLock A Mutex to associate with this condition variable.
--- a/xpcom/glue/FileUtils.h
+++ b/xpcom/glue/FileUtils.h
@@ -88,82 +88,82 @@ typedef Scoped<ScopedCloseFileTraits> Sc
  * Fallocate efficiently and continuously allocates files via fallocate-type APIs.
  * This is useful for avoiding fragmentation.
  * On sucess the file be padded with zeros to grow to aLength.
  *
  * @param aFD file descriptor.
  * @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.
  * WARNING: This function should not be used without a telemetry field trial
  *          demonstrating a clear performance improvement!
  *
  * @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.
  * WARNING: This function should not be used without a telemetry field trial
  *          demonstrating a clear performance improvement!
  *
  * @param aFile nsIFile representing path to shared library
  * @param aOffset Offset into the file to begin preloading
  * @param aCount Number of bytes to preload (SIZE_MAX implies file size)
  * @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)
 
 /**
  * Use readahead to preload shared libraries into the file cache before loading.
  * WARNING: This function should not be used without a telemetry field trial
  *          demonstrating a clear performance improvement!
  *
  * @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.
  * WARNING: This function should not be used without a telemetry field trial
  *          demonstrating a clear performance improvement!
  *
  * @param aFilePath path to shared library
  * @param aOffset Offset into the file to begin preloading
  * @param aCount Number of bytes to preload (SIZE_MAX implies file size)
  * @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.
  * When this function exits, the file pointer is guaranteed to be in the same
  * position it was in before this function was called.
  * WARNING: This function should not be used without a telemetry field trial
  *          demonstrating a clear performance improvement!
  *
  * @param aFd file descriptor opened for read access
  * (on Windows, file must be opened with FILE_FLAG_SEQUENTIAL_SCAN)
  * @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.
 Also define it in debug builds, so that unit tests for it can be written
 and run in non-GONK builds. */
 #if (defined(MOZ_WIDGET_GONK) || defined(DEBUG)) && defined(XP_UNIX)
 
 #ifndef ReadSysFile_PRESENT
--- a/xpcom/glue/MainThreadUtils.h
+++ b/xpcom/glue/MainThreadUtils.h
@@ -13,31 +13,31 @@
 class nsIThread;
 
 /**
  * Get a reference to the main thread.
  *
  * @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
 bool NS_IsMainThread();
 #else
 /**
  * Test to see if the current thread is the main thread.
  *
  * @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_
--- a/xpcom/glue/Monitor.h
+++ b/xpcom/glue/Monitor.h
@@ -16,17 +16,17 @@ namespace mozilla {
  * Monitor provides a *non*-reentrant monitor: *not* a Java-style
  * monitor.  If your code needs support for reentrancy, use
  * ReentrantMonitor instead.  (Rarely should reentrancy be needed.)
  *
  * Instead of directly calling Monitor methods, it's safer and simpler
  * to instead use the RAII wrappers MonitorAutoLock and
  * MonitorAutoUnlock.
  */
-class NS_COM_GLUE Monitor
+class Monitor
 {
 public:
   explicit Monitor(const char* aName)
     : mMutex(aName)
     , mCondVar(mMutex, "[Monitor.mCondVar]")
   {
   }
 
@@ -64,17 +64,17 @@ private:
 
 /**
  * Lock the monitor for the lexical scope instances of this class are
  * bound to (except for MonitorAutoUnlock in nested scopes).
  *
  * 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)
     : mMonitor(&aMonitor)
   {
     mMonitor->Lock();
   }
 
@@ -103,17 +103,17 @@ private:
 
 /**
  * Unlock the monitor for the lexical scope instances of this class
  * are bound to (except for MonitorAutoLock in nested scopes).
  *
  * 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)
     : mMonitor(&aMonitor)
   {
     mMonitor->Unlock();
   }
 
--- a/xpcom/glue/Mutex.h
+++ b/xpcom/glue/Mutex.h
@@ -29,17 +29,17 @@
 //
 namespace mozilla {
 
 /**
  * OffTheBooksMutex is identical to Mutex, except that OffTheBooksMutex doesn't
  * 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:
   /**
    * @param aName A name which can reference this lock
    * @returns If failure, nullptr
    *          If success, a valid Mutex* which must be destroyed
    *          by Mutex::DestroyMutex()
    **/
@@ -112,17 +112,17 @@ private:
   friend class CondVar;
 };
 
 /**
  * Mutex
  * 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)
     : OffTheBooksMutex(aName)
   {
     MOZ_COUNT_CTOR(Mutex);
   }
 
@@ -140,17 +140,17 @@ private:
 /**
  * MutexAutoLock
  * Acquires the Mutex when it enters scope, and releases it when it leaves
  * scope.
  *
  * MUCH PREFERRED to bare calls to Mutex.Lock and Unlock.
  */
 template<typename T>
-class NS_COM_GLUE MOZ_STACK_CLASS BaseAutoLock
+class MOZ_STACK_CLASS BaseAutoLock
 {
 public:
   /**
    * Constructor
    * The constructor aquires the given lock.  The destructor
    * releases the lock.
    *
    * @param aLock A valid mozilla::Mutex* returned by
@@ -186,17 +186,17 @@ typedef BaseAutoLock<OffTheBooksMutex> O
 /**
  * MutexAutoUnlock
  * Releases the Mutex when it enters scope, and re-acquires it when it leaves
  * scope.
  *
  * MUCH PREFERRED to bare calls to Mutex.Unlock and Lock.
  */
 template<typename T>
-class NS_COM_GLUE MOZ_STACK_CLASS BaseAutoUnlock
+class MOZ_STACK_CLASS BaseAutoUnlock
 {
 public:
   explicit BaseAutoUnlock(T& aLock MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mLock(&aLock)
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
     NS_ASSERTION(mLock, "null lock");
     mLock->Unlock();
--- a/xpcom/glue/ReentrantMonitor.h
+++ b/xpcom/glue/ReentrantMonitor.h
@@ -29,17 +29,17 @@ namespace mozilla {
 
 
 /**
  * ReentrantMonitor
  * Java-like monitor.
  * 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:
   /**
    * ReentrantMonitor
    * @param aName A name which can reference this monitor
    */
   explicit ReentrantMonitor(const char* aName)
     : BlockingResourceBase(aName, eReentrantMonitor)
@@ -158,17 +158,17 @@ private:
 
 /**
  * ReentrantMonitorAutoEnter
  * Enters the ReentrantMonitor when it enters scope, and exits it when
  * it leaves scope.
  *
  * MUCH PREFERRED to bare calls to ReentrantMonitor.Enter and Exit.
  */
-class NS_COM_GLUE MOZ_STACK_CLASS ReentrantMonitorAutoEnter
+class MOZ_STACK_CLASS ReentrantMonitorAutoEnter
 {
 public:
   /**
    * Constructor
    * The constructor aquires the given lock.  The destructor
    * releases the lock.
    *
    * @param aReentrantMonitor A valid mozilla::ReentrantMonitor*.
--- a/xpcom/glue/nsArrayEnumerator.h
+++ b/xpcom/glue/nsArrayEnumerator.h
@@ -12,21 +12,21 @@
 #include "nscore.h"
 
 class nsISimpleEnumerator;
 class nsIArray;
 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);
 
 // create an enumerator for an existing nsCOMArray<T> implementation
 // The enumerator will hold an owning reference to each ELEMENT in
 // the array. This means that the nsCOMArray<T> can safely go away
 // without its objects going away.
-NS_COM_GLUE nsresult
+nsresult
 NS_NewArrayEnumerator(nsISimpleEnumerator** aResult,
                       const nsCOMArray_base& aArray);
 
 #endif
--- a/xpcom/glue/nsArrayUtils.h
+++ b/xpcom/glue/nsArrayUtils.h
@@ -6,17 +6,17 @@
 
 #ifndef nsArrayUtils_h__
 #define nsArrayUtils_h__
 
 #include "nsCOMPtr.h"
 #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,
                         nsresult* aErrorPtr)
     : mArray(aArray)
     , mIndex(aIndex)
     , mErrorPtr(aErrorPtr)
   {
--- a/xpcom/glue/nsCOMArray.h
+++ b/xpcom/glue/nsCOMArray.h
@@ -13,17 +13,17 @@
 #include "nsCycleCollectionNoteChild.h"
 #include "nsTArray.h"
 #include "nsISupports.h"
 
 // See below for the definition of nsCOMArray<T>
 
 // 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:
   nsCOMArray_base() {}
   explicit nsCOMArray_base(int32_t aCount) : mArray(aCount) {}
   nsCOMArray_base(const nsCOMArray_base& aOther);
   ~nsCOMArray_base();
 
--- a/xpcom/glue/nsCOMPtr.h
+++ b/xpcom/glue/nsCOMPtr.h
@@ -23,17 +23,16 @@
 #include "mozilla/Assertions.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/Move.h"
 #include "mozilla/NullPtr.h"
 #include "mozilla/TypeTraits.h"
 
 #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"
 
 
 /*
  * WARNING: This file defines several macros for internal use only. These
  * macros begin with the prefix |NSCAP_|. Do not use these macros in your own
  * code. They are for internal use only for cross-platform compatibility, and
@@ -284,29 +283,29 @@ public:
 };
 
 /*
  * nsQueryInterface could have been implemented as an nsCOMPtr_helper to avoid
  * adding specialized machinery in nsCOMPtr, but do_QueryInterface is called
  * 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
   nsQueryInterface(nsISupports* aRawPtr) : mRawPtr(aRawPtr) {}
 
   nsresult NS_FASTCALL operator()(const nsIID& aIID, void**) const;
 
 private:
   nsISupports* mRawPtr;
 };
 
-class NS_COM_GLUE nsQueryInterfaceWithError
+class nsQueryInterfaceWithError
 {
 public:
   nsQueryInterfaceWithError(nsISupports* aRawPtr, nsresult* aError)
     : mRawPtr(aRawPtr)
     , mErrorPtr(aError)
   {
   }
 
@@ -345,58 +344,58 @@ do_QueryInterface(already_AddRefed<T>&, 
   // This signature exists solely to _stop_ you from doing the bad thing.
   // Saying |do_QueryInterface()| on a pointer that is not otherwise owned by
   // someone else is an automatic leak. See bug 8221.
 }
 
 
 ////////////////////////////////////////////////////////////////////////////
 // Using servicemanager with COMPtrs
-class NS_COM_GLUE nsGetServiceByCID
+class nsGetServiceByCID
 {
 public:
   explicit nsGetServiceByCID(const nsCID& aCID) : mCID(aCID) {}
 
   nsresult NS_FASTCALL operator()(const nsIID&, void**) const;
 
 private:
   const nsCID& mCID;
 };
 
-class NS_COM_GLUE nsGetServiceByCIDWithError
+class nsGetServiceByCIDWithError
 {
 public:
   nsGetServiceByCIDWithError(const nsCID& aCID, nsresult* aErrorPtr)
     : mCID(aCID)
     , mErrorPtr(aErrorPtr)
   {
   }
 
   nsresult NS_FASTCALL operator()(const nsIID&, void**) const;
 
 private:
   const nsCID& mCID;
   nsresult* mErrorPtr;
 };
 
-class NS_COM_GLUE nsGetServiceByContractID
+class nsGetServiceByContractID
 {
 public:
   explicit nsGetServiceByContractID(const char* aContractID)
     : mContractID(aContractID)
   {
   }
 
   nsresult NS_FASTCALL operator()(const nsIID&, void**) const;
 
 private:
   const char* mContractID;
 };
 
-class NS_COM_GLUE nsGetServiceByContractIDWithError
+class nsGetServiceByContractIDWithError
 {
 public:
   nsGetServiceByContractIDWithError(const char* aContractID, nsresult* aErrorPtr)
     : mContractID(aContractID)
     , mErrorPtr(aErrorPtr)
   {
   }
 
@@ -416,42 +415,42 @@ private:
  *   template<> class Foo<void*> { ... };
  *   template<class T> class Foo<T*> : private Foo<void*> { ... };
  */
 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) {
       NSCAP_RELEASE(this, mRawPtr);
     }
   }
 
-  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:
   NS_MAY_ALIAS_PTR(nsISupports) mRawPtr;
 
   void assign_assuming_AddRef(nsISupports* aNewPtr)
   {
     // |AddRef()|ing the new value (before entering this function) before
--- a/xpcom/glue/nsCRTGlue.h
+++ b/xpcom/glue/nsCRTGlue.h
@@ -12,17 +12,17 @@
 /**
  * Scan a string for the first character that is *not* in a set of
  * delimiters.  If the string is only delimiter characters, the end of the
  * string is returned.
  *
  * @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
  * C standard library, but it does not use static variables to maintain state
  * and is therefore thread and reentrancy-safe.
  *
  * Any leading delimiters in str are skipped. Then the string is scanned
  * until an additional delimiter or end-of-string is found. The final
@@ -30,49 +30,49 @@ NS_COM_GLUE const char* NS_strspnp(const
  *
  * @param aDelims The set of delimiters.
  * @param aStr    The string to search. This is an in-out parameter; it is
  *                reset to the end of the found token + 1, or to the
  *                end-of-string if there are no more tokens.
  * @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];
   static const unsigned char kUpper2Lower[256];
 };
 
 inline char
 NS_ToUpper(char aChar)
@@ -81,29 +81,29 @@ NS_ToUpper(char aChar)
 }
 
 inline char
 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'
 #define TAB '\t'
 
 #define CRSTR "\015"
 #define LFSTR "\012"
 #define CRLF "\015\012"     /* A CR LF equivalent string */
--- a/xpcom/glue/nsCategoryCache.h
+++ b/xpcom/glue/nsCategoryCache.h
@@ -17,17 +17,17 @@
 #include "nsServiceManagerUtils.h"
 
 #include "nsAutoPtr.h"
 #include "nsCOMArray.h"
 #include "nsInterfaceHashtable.h"
 
 #include "nsXPCOM.h"
 
-class NS_COM_GLUE nsCategoryObserver MOZ_FINAL : public nsIObserver
+class nsCategoryObserver MOZ_FINAL : public nsIObserver
 {
   ~nsCategoryObserver();
 
 public:
   explicit nsCategoryObserver(const char* aCategory);
 
   void ListenerDied();
   nsInterfaceHashtable<nsCStringHashKey, nsISupports>& GetHash()
--- a/xpcom/glue/nsComponentManagerUtils.h
+++ b/xpcom/glue/nsComponentManagerUtils.h
@@ -8,32 +8,30 @@
 #define nsComponentManagerUtils_h__
 
 #include "nscore.h"
 #include "nsCOMPtr.h"
 
 #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);
+
+nsresult CallCreateInstance(const char* aContractID, nsISupports* aDelegate,
+                            const nsIID& aIID, void** aResult);
 
-NS_COM_GLUE nsresult CallCreateInstance(const char* aContractID,
-                                        nsISupports* aDelegate,
-                                        const nsIID& aIID, void** aResult);
+nsresult CallGetClassObject(const nsCID& aClass, const nsIID& aIID,
+                            void** aResult);
 
-NS_COM_GLUE 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,
                         nsresult* aErrorPtr)
     : mCID(aCID)
     , mOuter(aOuter)
     , mErrorPtr(aErrorPtr)
   {
@@ -42,17 +40,17 @@ public:
   virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const;
 
 private:
   const nsCID&    mCID;
   nsISupports*    mOuter;
   nsresult*       mErrorPtr;
 };
 
-class NS_COM_GLUE nsCreateInstanceByContractID : public nsCOMPtr_helper
+class nsCreateInstanceByContractID : public nsCOMPtr_helper
 {
 public:
   nsCreateInstanceByContractID(const char* aContractID, nsISupports* aOuter,
                                nsresult* aErrorPtr)
     : mContractID(aContractID)
     , mOuter(aOuter)
     , mErrorPtr(aErrorPtr)
   {
@@ -61,17 +59,17 @@ public:
   virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const;
 
 private:
   const char*   mContractID;
   nsISupports*  mOuter;
   nsresult*     mErrorPtr;
 };
 
-class NS_COM_GLUE nsCreateInstanceFromFactory : public nsCOMPtr_helper
+class nsCreateInstanceFromFactory : public nsCOMPtr_helper
 {
 public:
   nsCreateInstanceFromFactory(nsIFactory* aFactory, nsISupports* aOuter,
                               nsresult* aErrorPtr)
     : mFactory(aFactory)
     , mOuter(aOuter)
     , mErrorPtr(aErrorPtr)
   {
@@ -120,33 +118,33 @@ do_CreateInstance(nsIFactory* aFactory, 
 inline const nsCreateInstanceFromFactory
 do_CreateInstance(nsIFactory* aFactory, nsISupports* aOuter,
                   nsresult* aError = 0)
 {
   return nsCreateInstanceFromFactory(aFactory, aOuter, aError);
 }
 
 
-class NS_COM_GLUE nsGetClassObjectByCID : public nsCOMPtr_helper
+class nsGetClassObjectByCID : public nsCOMPtr_helper
 {
 public:
   nsGetClassObjectByCID(const nsCID& aCID, nsresult* aErrorPtr)
     : mCID(aCID)
     , mErrorPtr(aErrorPtr)
   {
   }
 
   virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const;
 
 private:
   const nsCID&    mCID;
   nsresult*       mErrorPtr;
 };
 
-class NS_COM_GLUE nsGetClassObjectByContractID : public nsCOMPtr_helper
+class nsGetClassObjectByContractID : public nsCOMPtr_helper
 {
 public:
   nsGetClassObjectByContractID(const char* aContractID, nsresult* aErrorPtr)
     : mContractID(aContractID)
     , mErrorPtr(aErrorPtr)
   {
   }
 
--- a/xpcom/glue/nsCycleCollectionParticipant.h
+++ b/xpcom/glue/nsCycleCollectionParticipant.h
@@ -179,18 +179,18 @@ public:
   MOZ_CONSTEXPR explicit nsScriptObjectTracer(bool aSkip)
     : nsCycleCollectionParticipant(aSkip)
   {
   }
 
   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
 {
 public:
   MOZ_CONSTEXPR nsXPCOMCycleCollectionParticipant()
     : nsScriptObjectTracer(false)
   {
--- a/xpcom/glue/nsDebug.h
+++ b/xpcom/glue/nsDebug.h
@@ -397,24 +397,24 @@ typedef void (*StderrCallback)(const cha
  * be linked with a static CRT (-MT) even when it's not. This means that we
  * cannot link to data exports from the CRT, only function exports. So,
  * instead of referencing "stderr" directly, use fdopen.
  */
 #ifdef __cplusplus
 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
 }
 #endif
 
 #endif /* nsDebug_h___ */
--- a/xpcom/glue/nsDeque.h
+++ b/xpcom/glue/nsDeque.h
@@ -56,17 +56,17 @@ public:
  * A deque allows insertion and removal at both ends of
  * the container.
  *
  * The deque stores pointers to items.
  */
 
 class nsDequeIterator;
 
-class NS_COM_GLUE nsDeque
+class nsDeque
 {
   friend class nsDequeIterator;
   typedef mozilla::fallible_t fallible_t;
 public:
   explicit nsDeque(nsDequeFunctor* aDeallocator = nullptr);
   ~nsDeque();
 
   /**
@@ -231,17 +231,17 @@ private:
 
   bool GrowCapacity();
 };
 
 /******************************************************
  * Here comes the nsDequeIterator class...
  ******************************************************/
 
-class NS_COM_GLUE nsDequeIterator
+class nsDequeIterator
 {
 public:
   /**
    * DequeIterator is an object that knows how to iterate
    * (forward and backward) through a Deque. Normally,
    * you don't need to do this, but there are some special
    * cases where it is pretty handy.
    *
--- a/xpcom/glue/nsEnumeratorUtils.h
+++ b/xpcom/glue/nsEnumeratorUtils.h
@@ -7,18 +7,18 @@
 #ifndef nsEnumeratorUtils_h__
 #define nsEnumeratorUtils_h__
 
 #include "nscore.h"
 
 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__ */
--- a/xpcom/glue/nsIClassInfoImpl.h
+++ b/xpcom/glue/nsIClassInfoImpl.h
@@ -79,17 +79,17 @@
  * but in fact keeping a whole instance of the class alive.  See, e.g., bug
  * 658632.
  *
  * Unless you specifically need to have a different nsIClassInfo instance for
  * each instance of your class, you should probably just implement nsIClassInfo
  * as a singleton.
  */
 
-class NS_COM_GLUE GenericClassInfo : public nsIClassInfo
+class GenericClassInfo : public nsIClassInfo
 {
 public:
   struct ClassInfoData
   {
     typedef NS_CALLBACK(GetInterfacesProc)(uint32_t* aCountP,
                                            nsIID*** aArray);
     typedef NS_CALLBACK(GetLanguageHelperProc)(uint32_t aLanguage,
                                                nsISupports** aHelper);
--- a/xpcom/glue/nsID.h
+++ b/xpcom/glue/nsID.h
@@ -49,32 +49,32 @@ struct nsID
       (((uint32_t*)&m0)[2] == ((uint32_t*)&aOther.m0)[2]) &&
       (((uint32_t*)&m0)[3] == ((uint32_t*)&aOther.m0)[3]);
   }
 
   /**
    * 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
   /**
    * nsID string encoder. Returns an allocated string in
    * {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
 
   //@}
 };
 
 /*
  * Class IDs
--- a/xpcom/glue/nsIInterfaceRequestorUtils.h
+++ b/xpcom/glue/nsIInterfaceRequestorUtils.h
@@ -17,17 +17,17 @@ CallGetInterface(T* aSource, Destination
 {
   NS_PRECONDITION(aSource, "null parameter");
   NS_PRECONDITION(aDestination, "null parameter");
 
   return aSource->GetInterface(NS_GET_TEMPLATE_IID(DestinationType),
                                reinterpret_cast<void**>(aDestination));
 }
 
-class NS_COM_GLUE nsGetInterface : public nsCOMPtr_helper
+class nsGetInterface : public nsCOMPtr_helper
 {
 public:
   nsGetInterface(nsISupports* aSource, nsresult* aError)
     : mSource(aSource)
     , mErrorPtr(aError)
   {
   }
 
--- a/xpcom/glue/nsINIParser.h
+++ b/xpcom/glue/nsINIParser.h
@@ -16,17 +16,17 @@
 #include "nscore.h"
 #include "nsClassHashtable.h"
 #include "nsAutoPtr.h"
 
 #include <stdio.h>
 
 class nsIFile;
 
-class NS_COM_GLUE nsINIParser
+class nsINIParser
 {
 public:
   nsINIParser() {}
   ~nsINIParser() {}
 
   /**
    * Initialize the INIParser with a nsIFile. If this method fails, no
    * other methods should be called. This method reads and parses the file,
--- a/xpcom/glue/nsISupportsImpl.h
+++ b/xpcom/glue/nsISupportsImpl.h
@@ -742,17 +742,17 @@ NS_IMETHODIMP_(void) _class::DeleteCycle
  */
 
 struct QITableEntry
 {
   const nsIID* iid;     // null indicates end of the QITableEntry array
   int32_t   offset;
 };
 
-NS_COM_GLUE nsresult NS_FASTCALL
+nsresult NS_FASTCALL
 NS_TableDrivenQI(void* aThis, REFNSIID aIID,
                  void** aInstancePtr, const QITableEntry* aEntries);
 
 /**
  * Implement table-driven queryinterface
  */
 
 #define NS_INTERFACE_TABLE_HEAD(_class)                                       \
--- a/xpcom/glue/nsIWeakReferenceUtils.h
+++ b/xpcom/glue/nsIWeakReferenceUtils.h
@@ -25,17 +25,17 @@ CallQueryReferent(T* aSource, Destinatio
   NS_PRECONDITION(aSource, "null parameter");
   NS_PRECONDITION(aDestination, "null parameter");
 
   return aSource->QueryReferent(NS_GET_TEMPLATE_IID(DestinationType),
                                 reinterpret_cast<void**>(aDestination));
 }
 
 
-class NS_COM_GLUE nsQueryReferent : public nsCOMPtr_helper
+class nsQueryReferent : public nsCOMPtr_helper
 {
 public:
   nsQueryReferent(nsIWeakReference* aWeakPtr, nsresult* aError)
     : mWeakPtr(aWeakPtr)
     , mErrorPtr(aError)
   {
   }
 
@@ -51,18 +51,18 @@ do_QueryReferent(nsIWeakReference* aRawP
 {
   return nsQueryReferent(aRawPtr, aError);
 }
 
 
 /**
  * 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
  * to get a weak reference to an arbitrary object, i.e., the |QueryInterface|, test, and
  * call through to |GetWeakReference|, and put it into your |nsCOMPtr|.
  * It is specifically designed to cooperate with |nsCOMPtr| (or |nsWeakPtr|) like so:
  * |nsWeakPtr myWeakPtr = do_GetWeakReference(aPtr);|.
  */
--- a/xpcom/glue/nsMemory.cpp
+++ b/xpcom/glue/nsMemory.cpp
@@ -10,39 +10,39 @@
 #include "nsXPCOMPrivate.h"
 #include "nsDebug.h"
 #include "nsISupportsUtils.h"
 #include "nsCOMPtr.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsMemory static helper routines
 
-NS_COM_GLUE nsresult
+nsresult
 nsMemory::HeapMinimize(bool aImmediate)
 {
   nsCOMPtr<nsIMemory> mem;
   nsresult rv = NS_GetMemoryManager(getter_AddRefs(mem));
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   return mem->HeapMinimize(aImmediate);
 }
 
-NS_COM_GLUE void*
+void*
 nsMemory::Clone(const void* aPtr, size_t aSize)
 {
   void* newPtr = NS_Alloc(aSize);
   if (newPtr) {
     memcpy(newPtr, aPtr, aSize);
   }
   return newPtr;
 }
 
-NS_COM_GLUE nsIMemory*
+nsIMemory*
 nsMemory::GetGlobalMemoryService()
 {
   nsIMemory* mem;
   nsresult rv = NS_GetMemoryManager(&mem);
   if (NS_FAILED(rv)) {
     return nullptr;
   }
 
--- a/xpcom/glue/nsMemory.h
+++ b/xpcom/glue/nsMemory.h
@@ -43,19 +43,19 @@ public:
     return NS_Realloc(aPtr, aSize);
   }
 
   static NS_HIDDEN_(void) Free(void* aPtr)
   {
     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
 };
 
 /**
  * Macro to free all elements of an XPCOM array of a given size using
  * freeFunc, then frees the array itself using nsMemory::Free().
  *
  * Note that this macro (and its wrappers) can be used to deallocate a
  * partially- or completely-built array while unwinding an error
--- a/xpcom/glue/nsProxyRelease.h
+++ b/xpcom/glue/nsProxyRelease.h
@@ -56,17 +56,17 @@ NS_ProxyRelease(nsIEventTarget* aTarget,
  * @param aDoomed
  *        the doomed object; the object to be released on the target thread.
  * @param aAlwaysProxy
  *        normally, if NS_ProxyRelease is called on the target thread, then the
  *        doomed object will released directly.  however, if this parameter is
  *        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);
 
 /**
  * Class to safely handle main-thread-only pointers off the main thread.
  *
  * Classes like XPCWrappedJS are main-thread-only, which means that it is
  * forbidden to call methods on instances of these classes off the main thread.
--- a/xpcom/glue/nsQuickSort.h
+++ b/xpcom/glue/nsQuickSort.h
@@ -25,17 +25,17 @@ extern "C" {
  *  3. the size of each array element
  *  4. comparison function taking two elements and parameter #5 and
  *     returning an integer:
  *      + less than zero if the first element should be before the second
  *      + 0 if the order of the elements does not matter
  *      + 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
 }
 #endif
 
 #endif /* nsQuickSort_h___ */
--- a/xpcom/glue/nsServiceManagerUtils.h
+++ b/xpcom/glue/nsServiceManagerUtils.h
@@ -54,21 +54,20 @@ protected:
 
 inline const nsGetServiceFromCategory
 do_GetServiceFromCategory(const char* aCategory, const char* aEntry,
                           nsresult* aError = 0)
 {
   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<class DestinationType>
 inline nsresult
 CallGetService(const nsCID& aClass,
                DestinationType** aDestination)
 {
   NS_PRECONDITION(aDestination, "null parameter");
--- a/xpcom/glue/nsStringAPI.h
+++ b/xpcom/glue/nsStringAPI.h
@@ -1158,17 +1158,17 @@ LossyCopyUTF16toASCII(const nsAString& a
 }
 
 inline void
 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
 {
 public:
   typedef NS_ConvertASCIItoUTF16    self_type;
 
   explicit NS_ConvertASCIItoUTF16(const nsACString& aStr)
@@ -1354,17 +1354,17 @@ getter_Copies(nsCString& aString)
   return nsCGetterCopies(aString);
 }
 
 
 /**
 * substrings
 */
 
-class NS_COM_GLUE nsDependentSubstring : public nsStringContainer
+class nsDependentSubstring : public nsStringContainer
 {
 public:
   typedef nsDependentSubstring self_type;
   typedef nsAString            abstract_string_type;
 
   ~nsDependentSubstring() { NS_StringContainerFinish(*this); }
   nsDependentSubstring() { NS_StringContainerInit(*this); }
 
@@ -1387,17 +1387,17 @@ public:
                             NS_STRING_CONTAINER_INIT_DEPEND |
                             NS_STRING_CONTAINER_INIT_SUBSTRING);
   }
 
 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;
   typedef nsACString            abstract_string_type;
 
   ~nsDependentCSubstring() { NS_CStringContainerFinish(*this); }
   nsDependentCSubstring() { NS_CStringContainerInit(*this); }
 
--- a/xpcom/glue/nsTArray.h
+++ b/xpcom/glue/nsTArray.h
@@ -222,17 +222,17 @@ struct nsTArrayInfallibleAllocator : nsT
   static void SizeTooBig(size_t aSize) { NS_ABORT_OOM(aSize); }
 };
 
 #endif
 
 // 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;
 
   uint32_t mLength;
   uint32_t mCapacity : 31;
   uint32_t mIsAutoArray : 1;
 };
 
--- a/xpcom/glue/nsTHashtable.h
+++ b/xpcom/glue/nsTHashtable.h
@@ -14,20 +14,20 @@
 #include "mozilla/MemoryReporting.h"
 #include "mozilla/Move.h"
 #include "mozilla/fallible.h"
 #include "mozilla/PodOperations.h"
 
 #include <new>
 
 // 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);
 
 
 /**
  * a base class for templated hashtables.
  *
  * Clients will rarely need to use this class directly. Check the derived
  * classes first, to see if they will meet your needs.
  *
--- a/xpcom/glue/nsTObserverArray.h
+++ b/xpcom/glue/nsTObserverArray.h
@@ -16,17 +16,17 @@
  * stable even if the array is modified during iteration.
  * The template parameter T is the observer type the array will hold;
  * N is the number of built-in storage slots that come with the array.
  * NOTE: You probably want to use nsTObserverArray, unless you specifically
  * want built-in storage. See below.
  * @see nsTObserverArray, nsTArray
  */
 
-class NS_COM_GLUE nsTObserverArray_base
+class nsTObserverArray_base
 {
 public:
   typedef size_t index_type;
   typedef size_t size_type;
   typedef ptrdiff_t diff_type;
 
 protected:
   class Iterator_base
--- a/xpcom/glue/nsTextFormatter.h
+++ b/xpcom/glue/nsTextFormatter.h
@@ -35,17 +35,17 @@
 #include <stdarg.h>
 #include "nscore.h"
 #include "nsStringGlue.h"
 
 #ifdef XPCOM_GLUE
 #error "nsTextFormatter is not available in the standalone glue due to NSPR dependencies."
 #endif
 
-class NS_COM_GLUE nsTextFormatter
+class nsTextFormatter
 {
 public:
 
   /*
    * sprintf into a fixed size buffer. Guarantees that the buffer is null
    * terminated. Returns the length of the written output, NOT including the
    * null terminator, or (uint32_t)-1 if an error occurs.
    */
--- a/xpcom/glue/nsThreadUtils.h
+++ b/xpcom/glue/nsThreadUtils.h
@@ -21,25 +21,24 @@
 
 //-----------------------------------------------------------------------------
 // These methods are alternatives to the methods on nsIThreadManager, provided
 // for convenience.
 
 /**
  * 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<size_t LEN>
-inline NS_COM_GLUE void
+inline void
 NS_SetThreadName(nsIThread* aThread, const char (&aName)[LEN])
 {
   static_assert(LEN <= 16,
                 "Thread name must be no more than 16 characters");
   NS_SetThreadName(aThread, nsDependentCString(aName));
 }
 
 /**
@@ -50,17 +49,17 @@ NS_SetThreadName(nsIThread* aThread, con
  * @param aInitialEvent
  *   The initial event to run on this thread.  This parameter may be null.
  * @param aStackSize
  *   The size in bytes to reserve for the thread's stack.
  *
  * @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);
 
 /**
  * Creates a named thread, otherwise the same as NS_NewThread
  */
 template<size_t LEN>
@@ -88,41 +87,41 @@ NS_NewNamedThread(const char (&aName)[LE
 }
 
 /**
  * Get a reference to the current thread.
  *
  * @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.
  *
  * @param aEvent
  *   The event to dispatch.
  *
  * @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.
  *
  * @param aEvent
  *   The event to dispatch.
  * @param aDispatchFlags
  *   The flags to pass to the main thread's dispatch method.
  *
  * @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);
 
 #ifndef XPCOM_GLUE_AVOID_NSPR
 /**
  * Process all pending events for the given thread before returning.  This
  * method simply calls ProcessNextEvent on the thread while HasPendingEvents
  * continues to return true and the time spent in NS_ProcessPendingEvents
@@ -132,17 +131,17 @@ NS_DispatchToMainThread(nsIRunnable* aEv
  *   The thread object for which to process pending events.  If null, then
  *   events will be processed for the current thread.
  * @param aTimeout
  *   The maximum number of milliseconds to spend processing pending events.
  *   Events are not pre-empted to honor this timeout.  Rather, the timeout
  *   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
 
 /**
  * Shortcut for nsIThread::HasPendingEvents.
  *
  * It is an error to call this function when the given thread is not the
@@ -151,17 +150,17 @@ NS_ProcessPendingEvents(nsIThread* aThre
  *
  * @param aThread
  *   The current thread or null.
  *
  * @returns
  *   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.
  *
  * It is an error to call this function when the given thread is not the
  * current thread.  This function will simply return false if called
  * from some other thread.
  *
@@ -170,18 +169,18 @@ extern NS_COM_GLUE bool NS_HasPendingEve
  * @param aMayWait
  *   A boolean parameter that if "true" indicates that the method may block
  *   the calling thread to wait for a pending event.
  *
  * @returns
  *   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:
 
 inline already_AddRefed<nsIThread>
 do_GetCurrentThread()
 {
   nsIThread* thread = nullptr;
@@ -199,56 +198,50 @@ do_GetMainThread()
 
 //-----------------------------------------------------------------------------
 
 #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
 
 //-----------------------------------------------------------------------------
 
 #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
   NS_DECL_NSIRUNNABLE
 
   nsRunnable() {}
 
 protected:
   virtual ~nsRunnable() {}
 };
 
 // This class is designed to be subclassed.
-class NS_COM_GLUE nsCancelableRunnable : public nsICancelableRunnable
+class nsCancelableRunnable : public nsICancelableRunnable
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIRUNNABLE
   NS_DECL_NSICANCELABLERUNNABLE
 
   nsCancelableRunnable() {}
 
 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.
 template<class ClassType,
          typename ReturnType = void,
          bool Owning = true>
 class nsRunnableMethod : public nsRunnable
 {
--- a/xpcom/glue/nsVersionComparator.h
+++ b/xpcom/glue/nsVersionComparator.h
@@ -38,24 +38,23 @@
  *
  * On Windows, if your version strings are wide characters, you should use the
  * mozilla::VersionW variant instead.  The semantics of that class is the same
  * as Version.
  */
 
 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)
   {
     versionContent = strdup(aVersionString);
   }
 
   const char* ReadContent() const
   {
@@ -116,17 +115,17 @@ struct NS_COM_GLUE Version
     return CompareVersions(versionContent, aRhs) != 0;
   }
 
 private:
   char* versionContent;
 };
 
 #ifdef XP_WIN
-struct NS_COM_GLUE VersionW
+struct VersionW
 {
   VersionW(const char16_t* aVersionStringW)
   {
     versionContentW =
       reinterpret_cast<char16_t*>(wcsdup(char16ptr_t(aVersionStringW)));
   }
 
   const char16_t* ReadContentW() const
--- a/xpcom/glue/nsVoidArray.h
+++ b/xpcom/glue/nsVoidArray.h
@@ -21,17 +21,17 @@ typedef int (*nsVoidArrayComparatorFunc)
 typedef bool (*nsVoidArrayEnumFunc)(void* aElement, void* aData);
 typedef bool (*nsVoidArrayEnumFuncConst)(const void* aElement, void* aData);
 
 // SizeOfExcludingThis callback function.
 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();
   explicit nsVoidArray(int32_t aCount);  // initial count of aCount elements set to nullptr
   ~nsVoidArray();
 
   nsVoidArray& operator=(const nsVoidArray& aOther);
 
@@ -172,17 +172,17 @@ private:
 // XXX we're really re-implementing the whole nsVoidArray interface here -
 // some form of abstract class would be useful
 
 // I disagree on the abstraction here.  If the point of this class is to be
 // as small as possible, and no one will ever derive from it, as I found
 // 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();
 
   nsSmallVoidArray& operator=(nsSmallVoidArray& aOther);
   void* operator[](int32_t aIndex) const { return ElementAt(aIndex); }
 
   int32_t GetArraySize() const;
--- a/xpcom/glue/nsWeakReference.cpp
+++ b/xpcom/glue/nsWeakReference.cpp
@@ -61,17 +61,17 @@ nsQueryReferent::operator()(const nsIID&
   }
 
   if (mErrorPtr) {
     *mErrorPtr = status;
   }
   return status;
 }
 
-NS_COM_GLUE nsIWeakReference*  // or else |already_AddRefed<nsIWeakReference>|
+nsIWeakReference*  // or else |already_AddRefed<nsIWeakReference>|
 NS_GetWeakReference(nsISupports* aInstancePtr, nsresult* aErrorPtr)
 {
   nsresult status;
 
   nsIWeakReference* result = nullptr;
 
   if (aInstancePtr) {
     nsCOMPtr<nsISupportsWeakReference> factoryPtr =
@@ -85,17 +85,17 @@ NS_GetWeakReference(nsISupports* aInstan
   }
 
   if (aErrorPtr) {
     *aErrorPtr = status;
   }
   return result;
 }
 
-NS_COM_GLUE nsresult
+nsresult
 nsSupportsWeakReference::GetWeakReference(nsIWeakReference** aInstancePtr)
 {
   if (!aInstancePtr) {
     return NS_ERROR_NULL_POINTER;
   }
 
   if (!mProxy) {
     mProxy = new nsWeakReference(this);
--- a/xpcom/glue/nsWeakReference.h
+++ b/xpcom/glue/nsWeakReference.h
@@ -10,22 +10,17 @@
 // nsWeakReference.h
 
 // See mfbt/WeakPtr.h for a more typesafe C++ implementation of weak references
 
 #include "nsIWeakReferenceUtils.h"
 
 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) {}
 
   NS_DECL_NSISUPPORTSWEAKREFERENCE
 
 protected:
   inline ~nsSupportsWeakReference();
@@ -39,18 +34,15 @@ private:
   nsWeakReference* mProxy;
 
 protected:
 
   void ClearWeakReferences();
   bool HasWeakReferences() const { return mProxy != 0; }
 };
 
-#undef  IMETHOD_VISIBILITY
-#define IMETHOD_VISIBILITY
-
 inline
 nsSupportsWeakReference::~nsSupportsWeakReference()
 {
   ClearWeakReferences();
 }
 
 #endif
--- a/xpcom/glue/pldhash.h
+++ b/xpcom/glue/pldhash.h
@@ -380,106 +380,102 @@ struct PLDHashTableOps
 
   /* Optional hooks start here.  If null, these are not called. */
   PLDHashInitEntry    initEntry;
 };
 
 /*
  * 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
 {
   PLDHashEntryHdr hdr;
   const void*     key;
 };
 
-NS_COM_GLUE PLDHashNumber PL_DHashVoidPtrKeyStub(PLDHashTable* aTable,
-                                                 const void* aKey);
+PLDHashNumber PL_DHashVoidPtrKeyStub(PLDHashTable* aTable, const void* aKey);
+
+bool PL_DHashMatchEntryStub(PLDHashTable* aTable,
+                            const PLDHashEntryHdr* aEntry,
+                            const void* aKey);
 
-NS_COM_GLUE bool PL_DHashMatchEntryStub(PLDHashTable* aTable,
-                                        const PLDHashEntryHdr* aEntry,
-                                        const void* aKey);
+bool PL_DHashMatchStringKey(PLDHashTable* aTable,
+                            const PLDHashEntryHdr* aEntry,
+                            const void* aKey);
 
-NS_COM_GLUE 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
  * PL_DHashTableInit, and return its address.  Return null on malloc failure.
  * 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);
 
 /*
  * 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
  * initial capacity will be chosen such that |aLength| elements can be inserted
  * without rehashing. If |aLength| is a power-of-two, this capacity will be
  * |2*length|.
  *
  * 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);
 
 /*
  * 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);
 
 /*
  * Finalize aTable's data, free its entry storage using aTable->ops->freeTable,
  * and leave its members unchanged from their last live values (which leaves
  * 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:
  *
  *  entry = PL_DHashTableOperate(table, key, PL_DHASH_LOOKUP);
  *
  * If PL_DHASH_ENTRY_IS_BUSY(entry) is true, key was found and it identifies
  * entry.  If PL_DHASH_ENTRY_IS_FREE(entry) is true, key was not found.
@@ -501,51 +497,50 @@ NS_COM_GLUE void PL_DHashTableFinish(PLD
  * To remove an entry identified by key from table, call:
  *
  *  (void) PL_DHashTableOperate(table, key, PL_DHASH_REMOVE);
  *
  * If key's entry is found, it is cleared (via table->ops->clearEntry) and
  * 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);
 
 /*
  * Remove an entry already accessed via LOOKUP or ADD.
  *
  * NB: this is a "raw" or low-level routine, intended to be used only where
  * the inefficiency of a full PL_DHashTableOperate (which rehashes in order
  * to find the entry given its key) is not tolerable.  This function does not
  * 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);
 
 /**
  * Measure the size of the table's entry storage, and if
  * |aSizeOfEntryExcludingThis| is non-nullptr, measure the size of things
  * 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);
 
 /**
  * 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);
 
 #ifdef DEBUG
 /**
  * Mark a table as immutable for the remainder of its lifetime.  This
  * changes the implementation from ASSERTing one set of invariants to
@@ -555,17 +550,17 @@ NS_COM_GLUE size_t PL_DHashTableSizeOfIn
  * asserts that the table is not mutated from its own callbacks.  It
  * assumes the caller protects the table from being accessed on multiple
  * threads simultaneously.
  *
  * When the table is marked as immutable, the re-entry assertions will
  * 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___ */
--- a/xpcom/glue/unused.h
+++ b/xpcom/glue/unused.h
@@ -10,21 +10,21 @@
 #include "nscore.h"
 
 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<typename T>
 inline void
 operator<<(const unused_t& /*unused*/, const T& /*unused*/)
 {
 }
 
 }