Bug 884061 - Part 4: Remove nsAtomicRefcnt.h, r=jlebar
authorJoshua Cranmer <Pidgeot18@gmail.com>
Thu, 11 Jul 2013 15:21:45 -0500
changeset 139612 c4d279b1012830a324c0d35243132927049fb089
parent 139611 83c90466810a5c5f6f657c36c37a1d96243f4567
child 139613 6ed9c8fc4844e623ca265a8efbd65e95efe96d33
push id31415
push userPidgeot18@gmail.com
push dateTue, 23 Jul 2013 13:48:21 +0000
treeherdermozilla-inbound@c4d279b10128 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlebar
bugs884061
milestone25.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 884061 - Part 4: Remove nsAtomicRefcnt.h, r=jlebar
caps/src/nsNullPrincipal.cpp
caps/src/nsPrincipal.cpp
caps/src/nsSystemPrincipal.cpp
dom/indexedDB/FileInfo.h
dom/indexedDB/IndexedDatabaseManager.cpp
dom/plugins/base/nsNPAPIPlugin.cpp
dom/quota/QuotaManager.cpp
embedding/components/printingui/src/win/nsPrintProgress.cpp
gfx/2d/QuartzSupport.h
gfx/layers/ImageContainer.h
gfx/thebes/gfxTypes.h
image/src/DiscardTracker.cpp
image/src/DiscardTracker.h
intl/uconv/src/nsScriptableUConv.cpp
ipc/chromium/src/base/message_loop.cc
js/xpconnect/src/XPCWrappedJS.cpp
js/xpconnect/src/XPCWrappedNativeProto.cpp
netwerk/base/src/nsLoadGroup.cpp
netwerk/base/src/nsSocketTransport2.cpp
netwerk/dns/nsHostResolver.h
netwerk/protocol/http/nsHttpTransaction.cpp
netwerk/protocol/websocket/WebSocketChannel.cpp
toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
widget/cocoa/nsAppShell.mm
widget/xpwidgets/nsBaseAppShell.cpp
xpcom/base/Makefile.in
xpcom/base/moz.build
xpcom/base/nsAtomicRefcnt.h
xpcom/base/nsExceptionService.cpp
xpcom/base/nsMemoryInfoDumper.cpp
xpcom/ds/nsHashtable.cpp
xpcom/glue/nsISupportsImpl.h
xpcom/io/nsPipe3.cpp
xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp
xpcom/tests/TestRacingServiceManager.cpp
xpcom/threads/nsThread.cpp
xpcom/threads/nsTimerImpl.cpp
--- a/caps/src/nsNullPrincipal.cpp
+++ b/caps/src/nsNullPrincipal.cpp
@@ -17,16 +17,17 @@
 #include "nsIUUIDGenerator.h"
 #include "nsID.h"
 #include "nsNetUtil.h"
 #include "nsIClassInfoImpl.h"
 #include "nsNetCID.h"
 #include "nsError.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsScriptSecurityManager.h"
+#include "pratom.h"
 
 using namespace mozilla;
 
 NS_IMPL_CLASSINFO(nsNullPrincipal, nullptr, nsIClassInfo::MAIN_THREAD_ONLY,
                   NS_NULLPRINCIPAL_CID)
 NS_IMPL_QUERY_INTERFACE2_CI(nsNullPrincipal,
                             nsIPrincipal,
                             nsISerializable)
--- a/caps/src/nsPrincipal.cpp
+++ b/caps/src/nsPrincipal.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozIThirdPartyUtil.h"
 #include "nscore.h"
 #include "nsScriptSecurityManager.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "plstr.h"
+#include "pratom.h"
 #include "nsCRT.h"
 #include "nsIURI.h"
 #include "nsIFileURL.h"
 #include "nsIProtocolHandler.h"
 #include "nsNetUtil.h"
 #include "nsJSPrincipals.h"
 #include "nsVoidArray.h"
 #include "nsIObjectInputStream.h"
--- a/caps/src/nsSystemPrincipal.cpp
+++ b/caps/src/nsSystemPrincipal.cpp
@@ -12,16 +12,17 @@
 #include "nsIURL.h"
 #include "nsCOMPtr.h"
 #include "nsXPIDLString.h"
 #include "nsReadableUtils.h"
 #include "nsCRT.h"
 #include "nsString.h"
 #include "nsIClassInfoImpl.h"
 #include "nsIScriptSecurityManager.h"
+#include "pratom.h"
 
 NS_IMPL_CLASSINFO(nsSystemPrincipal, nullptr,
                   nsIClassInfo::SINGLETON | nsIClassInfo::MAIN_THREAD_ONLY,
                   NS_SYSTEMPRINCIPAL_CID)
 NS_IMPL_QUERY_INTERFACE2_CI(nsSystemPrincipal,
                             nsIPrincipal,
                             nsISerializable)
 NS_IMPL_CI_INTERFACE_GETTER2(nsSystemPrincipal,
--- a/dom/indexedDB/FileInfo.h
+++ b/dom/indexedDB/FileInfo.h
@@ -4,17 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_indexeddb_fileinfo_h__
 #define mozilla_dom_indexeddb_fileinfo_h__
 
 #include "IndexedDatabase.h"
 
-#include "nsAtomicRefcnt.h"
 #include "nsThreadUtils.h"
 
 #include "FileManager.h"
 #include "IndexedDatabaseManager.h"
 
 BEGIN_INDEXEDDB_NAMESPACE
 
 class FileInfo
--- a/dom/indexedDB/IndexedDatabaseManager.cpp
+++ b/dom/indexedDB/IndexedDatabaseManager.cpp
@@ -19,16 +19,17 @@
 #include "mozilla/dom/quota/QuotaManager.h"
 #include "mozilla/dom/quota/Utilities.h"
 #include "mozilla/dom/TabContext.h"
 #include "mozilla/Services.h"
 #include "mozilla/storage.h"
 #include "nsContentUtils.h"
 #include "nsEventDispatcher.h"
 #include "nsThreadUtils.h"
+#include "pratom.h"
 
 #include "IDBEvents.h"
 #include "IDBFactory.h"
 #include "IDBKeyRange.h"
 #include "IDBRequest.h"
 
 // The two possible values for the data argument when receiving the disk space
 // observer notification.
--- a/dom/plugins/base/nsNPAPIPlugin.cpp
+++ b/dom/plugins/base/nsNPAPIPlugin.cpp
@@ -3,16 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "base/basictypes.h"
 
 /* This must occur *after* layers/PLayerTransaction.h to avoid typedefs conflicts. */
 #include "mozilla/Util.h"
 
+#include "pratom.h"
 #include "prmem.h"
 #include "prenv.h"
 #include "prclist.h"
 
 #include "jsfriendapi.h"
 
 #include "nsPluginHost.h"
 #include "nsNPAPIPlugin.h"
--- a/dom/quota/QuotaManager.cpp
+++ b/dom/quota/QuotaManager.cpp
@@ -31,16 +31,17 @@
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsComponentManagerUtils.h"
 #include "nsContentUtils.h"
 #include "nsCRTGlue.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsScriptSecurityManager.h"
 #include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
+#include "pratom.h"
 #include "xpcpublic.h"
 
 #include "AcquireListener.h"
 #include "CheckQuotaHelper.h"
 #include "OriginOrPatternString.h"
 #include "QuotaObject.h"
 #include "StorageMatcher.h"
 #include "UsageRunnable.h"
--- a/embedding/components/printingui/src/win/nsPrintProgress.cpp
+++ b/embedding/components/printingui/src/win/nsPrintProgress.cpp
@@ -6,17 +6,16 @@
 #include "nsPrintProgress.h"
 
 #include "nsIBaseWindow.h"
 #include "nsISupportsArray.h"
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIComponentManager.h"
 #include "nsIServiceManager.h"
-#include "nsAtomicRefcnt.h"
 
 #if 0
 NS_IMPL_ADDREF(nsPrintProgress)
 NS_IMPL_RELEASE(nsPrintProgress)
 #else
 NS_IMETHODIMP_(nsrefcnt) nsPrintProgress::AddRef(void)
 {
   NS_PRECONDITION(int32_t(mRefCnt) >= 0, "illegal refcnt");
--- a/gfx/2d/QuartzSupport.h
+++ b/gfx/2d/QuartzSupport.h
@@ -8,16 +8,17 @@
 #define nsCoreAnimationSupport_h__
 #ifdef XP_MACOSX
 
 #import <OpenGL/OpenGL.h>
 #import "ApplicationServices/ApplicationServices.h"
 #include "gfxTypes.h"
 #include "mozilla/RefPtr.h"
 #include "mozilla/gfx/MacIOSurface.h"
+#include "nsError.h"
 
 // Get the system color space.
 CGColorSpaceRef CreateSystemColorSpace();
 
 // Manages a CARenderer
 struct _CGLPBufferObject;
 struct _CGLContextObject;
 
--- a/gfx/layers/ImageContainer.h
+++ b/gfx/layers/ImageContainer.h
@@ -8,16 +8,17 @@
 
 #include "mozilla/Mutex.h"
 #include "mozilla/ReentrantMonitor.h"
 #include "gfxASurface.h" // for gfxImageFormat
 #include "mozilla/layers/LayersTypes.h" // for LayersBackend
 #include "mozilla/TimeStamp.h"
 #include "ImageTypes.h"
 #include "nsTArray.h"
+#include "pratom.h"
 
 #ifdef XP_WIN
 struct ID3D10Texture2D;
 struct ID3D10Device;
 struct ID3D10ShaderResourceView;
 #endif
 
 typedef void* HANDLE;
--- a/gfx/thebes/gfxTypes.h
+++ b/gfx/thebes/gfxTypes.h
@@ -1,18 +1,16 @@
 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef GFX_TYPES_H
 #define GFX_TYPES_H
 
-#include "nsAtomicRefcnt.h"
-
 /**
  * Currently needs to be 'double' for Cairo compatibility. Could
  * become 'float', perhaps, in some configurations.
  */
 typedef double gfxFloat;
 
 /**
  * Priority of a line break opportunity.
--- a/image/src/DiscardTracker.cpp
+++ b/image/src/DiscardTracker.cpp
@@ -3,16 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsComponentManagerUtils.h"
 #include "nsITimer.h"
 #include "RasterImage.h"
 #include "DiscardTracker.h"
 #include "mozilla/Preferences.h"
+#include "pratom.h"
 
 namespace mozilla {
 namespace image {
 
 static const char* sDiscardTimeoutPref = "image.mem.min_discard_timeout_ms";
 
 /* static */ LinkedList<DiscardTracker::Node> DiscardTracker::sDiscardableImages;
 /* static */ nsCOMPtr<nsITimer> DiscardTracker::sTimer;
--- a/image/src/DiscardTracker.h
+++ b/image/src/DiscardTracker.h
@@ -3,16 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_imagelib_DiscardTracker_h_
 #define mozilla_imagelib_DiscardTracker_h_
 
 #include "mozilla/LinkedList.h"
 #include "mozilla/TimeStamp.h"
+#include "prlock.h"
 
 class nsITimer;
 
 namespace mozilla {
 namespace image {
 
 class RasterImage;
 
--- a/intl/uconv/src/nsScriptableUConv.cpp
+++ b/intl/uconv/src/nsScriptableUConv.cpp
@@ -1,24 +1,24 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "nsAtomicRefcnt.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsIServiceManager.h"
 #include "nsICharsetConverterManager.h"
 #include "nsIScriptableUConv.h"
 #include "nsScriptableUConv.h"
 #include "nsIStringStream.h"
 #include "nsCRT.h"
 #include "nsComponentManagerUtils.h"
 #include "nsCharsetAlias.h"
+#include "pratom.h"
 
 static int32_t          gInstanceCount = 0;
 
 /* Implementation file */
 NS_IMPL_ISUPPORTS1(nsScriptableUnicodeConverter, nsIScriptableUnicodeConverter)
 
 nsScriptableUnicodeConverter::nsScriptableUnicodeConverter()
 : mIsInternal(false)
--- a/ipc/chromium/src/base/message_loop.cc
+++ b/ipc/chromium/src/base/message_loop.cc
@@ -27,16 +27,17 @@
 #include "base/message_pump_qt.h"
 #endif
 #endif
 #ifdef ANDROID
 #include "base/message_pump_android.h"
 #endif
 
 #include "MessagePump.h"
+#include "pratom.h"
 
 using base::Time;
 using base::TimeDelta;
 using base::TimeTicks;
 
 // A lazily created thread local storage for quick access to a thread's message
 // loop, if one exists.  This should be safe and free of static constructors.
 static base::LazyInstance<base::ThreadLocalPointer<MessageLoop> > lazy_tls_ptr(
--- a/js/xpconnect/src/XPCWrappedJS.cpp
+++ b/js/xpconnect/src/XPCWrappedJS.cpp
@@ -3,17 +3,16 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Class that wraps JS objects to appear as XPCOM objects. */
 
 #include "xpcprivate.h"
 #include "nsCxPusher.h"
-#include "nsAtomicRefcnt.h"
 #include "nsContentUtils.h"
 #include "nsProxyRelease.h"
 #include "nsThreadUtils.h"
 #include "nsTextFormatter.h"
 #include "nsCycleCollectorUtils.h"
 
 using namespace mozilla;
 
--- a/js/xpconnect/src/XPCWrappedNativeProto.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeProto.cpp
@@ -3,16 +3,17 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Shared proto object for XPCWrappedNative. */
 
 #include "xpcprivate.h"
 #include "nsCxPusher.h"
+#include "pratom.h"
 
 using namespace mozilla;
 
 #if defined(DEBUG_xpc_hacker) || defined(DEBUG)
 int32_t XPCWrappedNativeProto::gDEBUG_LiveProtoCount = 0;
 #endif
 
 XPCWrappedNativeProto::XPCWrappedNativeProto(XPCWrappedNativeScope* Scope,
--- a/netwerk/base/src/nsLoadGroup.cpp
+++ b/netwerk/base/src/nsLoadGroup.cpp
@@ -9,16 +9,17 @@
 #include "nsLoadGroup.h"
 
 #include "nsArrayEnumerator.h"
 #include "nsCOMArray.h"
 #include "nsEnumeratorUtils.h"
 #include "nsIServiceManager.h"
 #include "nsCOMPtr.h"
 #include "nsIURI.h"
+#include "pratom.h"
 #include "prlog.h"
 #include "nsCRT.h"
 #include "netCore.h"
 #include "nsXPIDLString.h"
 #include "nsReadableUtils.h"
 #include "nsString.h"
 #include "nsTArray.h"
 #include "nsIHttpChannelInternal.h"
--- a/netwerk/base/src/nsSocketTransport2.cpp
+++ b/netwerk/base/src/nsSocketTransport2.cpp
@@ -5,17 +5,16 @@
 
 #ifdef MOZ_LOGGING
 #define FORCE_PR_LOG
 #endif
 
 #include "nsSocketTransport2.h"
 
 #include "mozilla/Attributes.h"
-#include "nsAtomicRefcnt.h"
 #include "nsIOService.h"
 #include "nsStreamUtils.h"
 #include "nsNetSegmentUtils.h"
 #include "nsNetAddr.h"
 #include "nsTransportUtils.h"
 #include "nsProxyInfo.h"
 #include "nsNetCID.h"
 #include "nsNetUtil.h"
--- a/netwerk/dns/nsHostResolver.h
+++ b/netwerk/dns/nsHostResolver.h
@@ -2,17 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsHostResolver_h__
 #define nsHostResolver_h__
 
 #include "nscore.h"
-#include "nsAtomicRefcnt.h"
 #include "prclist.h"
 #include "prnetdb.h"
 #include "pldhash.h"
 #include "mozilla/CondVar.h"
 #include "mozilla/Mutex.h"
 #include "nsISupportsImpl.h"
 #include "nsIDNSListener.h"
 #include "nsString.h"
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -15,17 +15,16 @@
 #include "nsHttpConnection.h"
 #include "nsHttpRequestHead.h"
 #include "nsHttpResponseHead.h"
 #include "nsHttpChunkedDecoder.h"
 #include "nsTransportUtils.h"
 #include "nsNetUtil.h"
 #include "nsProxyRelease.h"
 #include "nsIOService.h"
-#include "nsAtomicRefcnt.h"
 
 #include "nsISeekableStream.h"
 #include "nsISocketTransport.h"
 #include "nsMultiplexInputStream.h"
 #include "nsStringStream.h"
 #include "mozilla/VisualEventTracer.h"
 
 #include "nsComponentManagerUtils.h" // do_CreateInstance
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -35,16 +35,17 @@
 #include "nsAlgorithm.h"
 #include "nsProxyRelease.h"
 #include "nsNetUtil.h"
 #include "mozilla/Attributes.h"
 #include "TimeStamp.h"
 #include "mozilla/Telemetry.h"
 
 #include "plbase64.h"
+#include "pratom.h"
 #include "prmem.h"
 #include "prnetdb.h"
 #include "prbit.h"
 #include "zlib.h"
 #include <algorithm>
 
 // rather than slurp up all of nsIWebSocket.idl, which lives outside necko, just
 // dupe one constant we need from it
--- a/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
@@ -29,16 +29,17 @@
 #include "nsNetCID.h"
 #include "nsThreadUtils.h"
 #include "nsXPCOMStrings.h"
 #include "nsProxyRelease.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Telemetry.h"
+#include "pratom.h"
 #include "prlog.h"
 #include "prprf.h"
 #include "prnetdb.h"
 #include "Entries.h"
 #include "mozilla/Attributes.h"
 #include "nsIPrincipal.h"
 #include "Classifier.h"
 #include "ProtocolParser.h"
--- a/widget/cocoa/nsAppShell.mm
+++ b/widget/cocoa/nsAppShell.mm
@@ -28,16 +28,17 @@
 #include "nsObjCExceptions.h"
 #include "nsCocoaFeatures.h"
 #include "nsCocoaUtils.h"
 #include "nsChildView.h"
 #include "nsToolkit.h"
 #include "TextInputHandler.h"
 #include "mozilla/HangMonitor.h"
 #include "GeckoProfiler.h"
+#include "pratom.h"
 
 #include "npapi.h"
 
 using namespace mozilla::widget;
 
 // defined in nsCocoaWindow.mm
 extern int32_t             gXULModalLevel;
 
--- a/widget/xpwidgets/nsBaseAppShell.cpp
+++ b/widget/xpwidgets/nsBaseAppShell.cpp
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "base/message_loop.h"
 
 #include "nsBaseAppShell.h"
 #include "nsThreadUtils.h"
 #include "nsIObserverService.h"
 #include "nsServiceManagerUtils.h"
+#include "pratom.h"
 #include "mozilla/Services.h"
 
 // When processing the next thread event, the appshell may process native
 // events (if not in performance mode), which can result in suppressing the
 // next thread event for at most this many ticks:
 #define THREAD_EVENT_STARVATION_LIMIT PR_MillisecondsToInterval(20)
 
 NS_IMPL_ISUPPORTS3(nsBaseAppShell, nsIAppShell, nsIThreadObserver, nsIObserver)
--- a/xpcom/base/Makefile.in
+++ b/xpcom/base/Makefile.in
@@ -30,17 +30,16 @@ endif #if OS_ARCH == WINNT
 DISABLED_SDK_HEADERS     = \
 		nsAutoPtr.h \
 		nsError.h \
 		ErrorList.h \
 		ErrorListCxxDefines.h \
 		ErrorListCDefines.h \
 		nsISupportsBase.h \
 		nscore.h \
-		nsAtomicRefcnt.h \
 		nsCycleCollector.h \
 		nsObjCExceptions.h \
 
 ifeq ($(OS_ARCH),WINNT)
 DISABLED_SDK_HEADERS += \
 		nsWindowsHelpers.h \
 		$(NULL)
 endif
--- a/xpcom/base/moz.build
+++ b/xpcom/base/moz.build
@@ -40,17 +40,16 @@ XPIDL_MODULE = 'xpcom_base'
 
 MODULE = 'xpcom'
 
 EXPORTS += [
     'ErrorList.h',
     'ErrorListCDefines.h',
     'ErrorListCxxDefines.h',
     'nsAgg.h',
-    'nsAtomicRefcnt.h',
     'nsAutoPtr.h',
     'nsAutoRef.h',
     'nsCom.h',
     'nsCycleCollector.h',
     'nsDebugImpl.h',
     'nsError.h',
     'nsGZFileWriter.h',
     'nsIAllocator.h',
deleted file mode 100644
--- a/xpcom/base/nsAtomicRefcnt.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsAtomicRefcnt_h__
-#define nsAtomicRefcnt_h__
-
-#include "nscore.h"
-#include "pratom.h"
-
-class nsAutoRefCnt;
-
-// This header defines functions for modifying refcounts which wrap the
-// PR_ATOMIC_* macros.
-
-#if defined(XP_WIN)
-
-#if PR_BYTES_PER_LONG == 4
-typedef volatile long nsAtomicRefcnt;
-#else
-#error "Windows should have 4 bytes per long."
-#endif
-
-#else /* !defined(XP_WIN) */
-
-typedef int32_t  nsAtomicRefcnt;
-
-#endif
-
-inline int32_t
-NS_AtomicIncrementRefcnt(int32_t &refcnt)
-{
-  return PR_ATOMIC_INCREMENT(&refcnt);
-}
-
-inline nsrefcnt
-NS_AtomicIncrementRefcnt(nsrefcnt &refcnt)
-{
-  return (nsrefcnt) PR_ATOMIC_INCREMENT((nsAtomicRefcnt*)&refcnt);
-}
-
-inline nsrefcnt
-NS_AtomicIncrementRefcnt(nsAutoRefCnt &refcnt)
-{
-  // This cast is safe since nsAtomicRefCnt contains just one member, its refcount.
-  return (nsrefcnt) PR_ATOMIC_INCREMENT((nsAtomicRefcnt*)&refcnt);
-}
-
-inline nsrefcnt
-NS_AtomicDecrementRefcnt(nsrefcnt &refcnt)
-{
-  return (nsrefcnt) PR_ATOMIC_DECREMENT((nsAtomicRefcnt*)&refcnt);
-}
-
-inline nsrefcnt
-NS_AtomicDecrementRefcnt(nsAutoRefCnt &refcnt)
-{
-  return (nsrefcnt) PR_ATOMIC_DECREMENT((nsAtomicRefcnt*)&refcnt);
-}
-
-inline int32_t
-NS_AtomicDecrementRefcnt(int32_t &refcnt)
-{
-  return PR_ATOMIC_DECREMENT(&refcnt);
-}
-
-#endif
--- a/xpcom/base/nsExceptionService.cpp
+++ b/xpcom/base/nsExceptionService.cpp
@@ -5,16 +5,17 @@
 
 #include "mozilla/Attributes.h"
 #include "mozilla/DebugOnly.h"
 
 #include "nsISupports.h"
 #include "nsExceptionService.h"
 #include "nsIServiceManager.h"
 #include "nsCOMPtr.h"
+#include "pratom.h"
 #include "prthread.h"
 #include "mozilla/Services.h"
 
 using namespace mozilla;
 
 static const unsigned BAD_TLS_INDEX = (unsigned) -1;
 
 #define CHECK_SERVICE_USE_OK() if (!sLock) return NS_ERROR_NOT_INITIALIZED
--- a/xpcom/base/nsMemoryInfoDumper.cpp
+++ b/xpcom/base/nsMemoryInfoDumper.cpp
@@ -14,16 +14,17 @@
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/ContentChild.h"
 #include "nsIConsoleService.h"
 #include "nsICycleCollectorListener.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsGZFileWriter.h"
 #include "nsJSEnvironment.h"
 #include "nsPrintfCString.h"
+#include "pratom.h"
 
 #ifdef XP_WIN
 #include <process.h>
 #define getpid _getpid
 #else
 #include <unistd.h>
 #endif
 
--- a/xpcom/ds/nsHashtable.cpp
+++ b/xpcom/ds/nsHashtable.cpp
@@ -10,16 +10,17 @@
  * Modifications to Mozilla code or documentation
  * identified per MPL Section 3.3
  *
  * Date         Modified by     Description of modification
  * 04/20/2000   IBM Corp.       Added PR_CALLBACK for Optlink use in OS2
  */
 
 #include <string.h>
+#include "pratom.h"
 #include "prlog.h"
 #include "nsHashtable.h"
 #include "nsReadableUtils.h"
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 #include "nsCRT.h"
 #include "mozilla/HashFunctions.h"
 
--- a/xpcom/glue/nsISupportsImpl.h
+++ b/xpcom/glue/nsISupportsImpl.h
@@ -17,17 +17,16 @@
 
 #ifndef nsISupportsUtils_h__
 #include "nsISupportsUtils.h"
 #endif
 
 
 #if !defined(XPCOM_GLUE_AVOID_NSPR)
 #include "prthread.h" /* needed for thread-safety checks */
-#include "nsAtomicRefcnt.h" /* for NS_Atomic{Increment,Decrement}Refcnt */
 #ifdef DEBUG
 #include "nsCycleCollectorUtils.h" /* for NS_IsCycleCollectorThread */
 #endif // DEBUG
 #endif // !XPCOM_GLUE_AVOID_NSPR
 
 #include "nsDebug.h"
 #include "nsTraceRefcnt.h"
 #ifndef XPCOM_GLUE
@@ -230,29 +229,16 @@ class ThreadSafeAutoRefCnt {
     nsrefcnt operator++(int) MOZ_DELETE;
     nsrefcnt operator--(int) MOZ_DELETE;
     // In theory, RelaseAcquire consistency (but no weaker) is sufficient for
     // the counter. Making it weaker could speed up builds on ARM (but not x86),
     // but could break pre-existing code that assumes sequential consistency.
     Atomic<nsrefcnt> mValue;
 };
 }
-
-// Temporary declarations until NS_IMPL_THREADSAFE_ADDREF/RELEASE are deleted.
-inline nsrefcnt
-NS_AtomicIncrementRefcnt(mozilla::ThreadSafeAutoRefCnt &refcnt)
-{
-  return ++refcnt;
-}
-
-inline nsrefcnt
-NS_AtomicDecrementRefcnt(mozilla::ThreadSafeAutoRefCnt &refcnt)
-{
-  return --refcnt;
-}
 #endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
 /**
  * Declare the reference count variable and the implementations of the
  * AddRef and QueryInterface methods.
  */
@@ -974,29 +960,16 @@ NS_IMETHODIMP _class::QueryInterface(REF
 #define NS_IMPL_QUERY_INTERFACE11(_class, _i1, _i2, _i3, _i4, _i5, _i6,       \
                                   _i7, _i8, _i9, _i10, _i11)                  \
   NS_INTERFACE_TABLE_HEAD(_class)                                             \
   NS_INTERFACE_TABLE11(_class, _i1, _i2, _i3, _i4, _i5, _i6, _i7, _i8,        \
                        _i9, _i10, _i11)                                       \
   NS_INTERFACE_TABLE_TAIL
 
 
-#define NS_IMPL_THREADSAFE_QUERY_INTERFACE0  NS_IMPL_QUERY_INTERFACE0
-#define NS_IMPL_THREADSAFE_QUERY_INTERFACE1  NS_IMPL_QUERY_INTERFACE1
-#define NS_IMPL_THREADSAFE_QUERY_INTERFACE2  NS_IMPL_QUERY_INTERFACE2
-#define NS_IMPL_THREADSAFE_QUERY_INTERFACE3  NS_IMPL_QUERY_INTERFACE3
-#define NS_IMPL_THREADSAFE_QUERY_INTERFACE4  NS_IMPL_QUERY_INTERFACE4
-#define NS_IMPL_THREADSAFE_QUERY_INTERFACE5  NS_IMPL_QUERY_INTERFACE5
-#define NS_IMPL_THREADSAFE_QUERY_INTERFACE6  NS_IMPL_QUERY_INTERFACE6
-#define NS_IMPL_THREADSAFE_QUERY_INTERFACE7  NS_IMPL_QUERY_INTERFACE7
-#define NS_IMPL_THREADSAFE_QUERY_INTERFACE8  NS_IMPL_QUERY_INTERFACE8
-#define NS_IMPL_THREADSAFE_QUERY_INTERFACE9  NS_IMPL_QUERY_INTERFACE9
-#define NS_IMPL_THREADSAFE_QUERY_INTERFACE10  NS_IMPL_QUERY_INTERFACE10
-#define NS_IMPL_THREADSAFE_QUERY_INTERFACE11  NS_IMPL_QUERY_INTERFACE11
-
 /**
  * Declare that you're going to inherit from something that already
  * implements nsISupports, but also implements an additional interface, thus
  * causing an ambiguity. In this case you don't need another mRefCnt, you
  * just need to forward the definitions to the appropriate superclass. E.g.
  *
  * class Bar : public Foo, public nsIBar {  // both provide nsISupports
  * public:
@@ -1381,139 +1354,16 @@ NS_IMETHODIMP_(nsrefcnt) Class::Release(
 ///////////////////////////////////////////////////////////////////////////////
 /**
  *
  * Threadsafe implementations of the ISupports convenience macros.
  *
  * @note  These are not available when linking against the standalone glue,
  *        because the implementation requires PR_ symbols.
  */
-
-#if !defined(XPCOM_GLUE_AVOID_NSPR)
-
-/**
- * Use this macro to implement the AddRef method for a given <i>_class</i>
- * @param _class The name of the class implementing the method
- */
-
-#define NS_IMPL_THREADSAFE_ADDREF(_class)                                     \
-NS_IMETHODIMP_(nsrefcnt) _class::AddRef(void)                                 \
-{                                                                             \
-  MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");                        \
-  nsrefcnt count = NS_AtomicIncrementRefcnt(mRefCnt);                         \
-  NS_LOG_ADDREF(this, count, #_class, sizeof(*this));                         \
-  return (nsrefcnt) count;                                                    \
-}
-
-/**
- * Use this macro to implement the Release method for a given <i>_class</i>
- * @param _class The name of the class implementing the method
- *
- * Note that we don't need to use an atomic operation to stabilize the refcnt.
- * If the refcnt is released to 0, only the current thread has a reference to
- * the object; we thus don't have to use an atomic set to inform other threads
- * that we've changed the refcnt.
- */
-
-#define NS_IMPL_THREADSAFE_RELEASE(_class)                                    \
-NS_IMETHODIMP_(nsrefcnt) _class::Release(void)                                \
-{                                                                             \
-  MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");                            \
-  nsrefcnt count = NS_AtomicDecrementRefcnt(mRefCnt);                         \
-  NS_LOG_RELEASE(this, count, #_class);                                       \
-  if (0 == count) {                                                           \
-    mRefCnt = 1; /* stabilize */                                              \
-    /* enable this to find non-threadsafe destructors: */                     \
-    /* NS_ASSERT_OWNINGTHREAD(_class); */                                     \
-    delete (this);                                                            \
-    return 0;                                                                 \
-  }                                                                           \
-  return count;                                                               \
-}
-
-#else // XPCOM_GLUE_AVOID_NSPR
-
-#define NS_IMPL_THREADSAFE_ADDREF(_class)                                     \
-  THREADSAFE_ISUPPORTS_NOT_AVAILABLE_IN_STANDALONE_GLUE;
-
-#define NS_IMPL_THREADSAFE_RELEASE(_class)                                    \
-  THREADSAFE_ISUPPORTS_NOT_AVAILABLE_IN_STANDALONE_GLUE;
-
-#endif
-
-#define NS_IMPL_THREADSAFE_ISUPPORTS0(_class)                                 \
-  NS_IMPL_THREADSAFE_ADDREF(_class)                                           \
-  NS_IMPL_THREADSAFE_RELEASE(_class)                                          \
-  NS_IMPL_THREADSAFE_QUERY_INTERFACE0(_class)
-
-#define NS_IMPL_THREADSAFE_ISUPPORTS1(_class, _interface)                     \
-  NS_IMPL_THREADSAFE_ADDREF(_class)                                           \
-  NS_IMPL_THREADSAFE_RELEASE(_class)                                          \
-  NS_IMPL_THREADSAFE_QUERY_INTERFACE1(_class, _interface)
-
-#define NS_IMPL_THREADSAFE_ISUPPORTS2(_class, _i1, _i2)                       \
-  NS_IMPL_THREADSAFE_ADDREF(_class)                                           \
-  NS_IMPL_THREADSAFE_RELEASE(_class)                                          \
-  NS_IMPL_THREADSAFE_QUERY_INTERFACE2(_class, _i1, _i2)
-
-#define NS_IMPL_THREADSAFE_ISUPPORTS3(_class, _i1, _i2, _i3)                  \
-  NS_IMPL_THREADSAFE_ADDREF(_class)                                           \
-  NS_IMPL_THREADSAFE_RELEASE(_class)                                          \
-  NS_IMPL_THREADSAFE_QUERY_INTERFACE3(_class, _i1, _i2, _i3)
-
-#define NS_IMPL_THREADSAFE_ISUPPORTS4(_class, _i1, _i2, _i3, _i4)             \
-  NS_IMPL_THREADSAFE_ADDREF(_class)                                           \
-  NS_IMPL_THREADSAFE_RELEASE(_class)                                          \
-  NS_IMPL_THREADSAFE_QUERY_INTERFACE4(_class, _i1, _i2, _i3, _i4)
-
-#define NS_IMPL_THREADSAFE_ISUPPORTS5(_class, _i1, _i2, _i3, _i4, _i5)        \
-  NS_IMPL_THREADSAFE_ADDREF(_class)                                           \
-  NS_IMPL_THREADSAFE_RELEASE(_class)                                          \
-  NS_IMPL_THREADSAFE_QUERY_INTERFACE5(_class, _i1, _i2, _i3, _i4, _i5)
-
-#define NS_IMPL_THREADSAFE_ISUPPORTS6(_class, _i1, _i2, _i3, _i4, _i5, _i6)   \
-  NS_IMPL_THREADSAFE_ADDREF(_class)                                           \
-  NS_IMPL_THREADSAFE_RELEASE(_class)                                          \
-  NS_IMPL_THREADSAFE_QUERY_INTERFACE6(_class, _i1, _i2, _i3, _i4, _i5, _i6)
-
-#define NS_IMPL_THREADSAFE_ISUPPORTS7(_class, _i1, _i2, _i3, _i4, _i5, _i6,   \
-                                      _i7)                                    \
-  NS_IMPL_THREADSAFE_ADDREF(_class)                                           \
-  NS_IMPL_THREADSAFE_RELEASE(_class)                                          \
-  NS_IMPL_THREADSAFE_QUERY_INTERFACE7(_class, _i1, _i2, _i3, _i4, _i5, _i6,   \
-                                      _i7)
-
-#define NS_IMPL_THREADSAFE_ISUPPORTS8(_class, _i1, _i2, _i3, _i4, _i5, _i6,   \
-                                      _i7, _i8)                               \
-  NS_IMPL_THREADSAFE_ADDREF(_class)                                           \
-  NS_IMPL_THREADSAFE_RELEASE(_class)                                          \
-  NS_IMPL_THREADSAFE_QUERY_INTERFACE8(_class, _i1, _i2, _i3, _i4, _i5, _i6,   \
-                                      _i7, _i8)
-
-#define NS_IMPL_THREADSAFE_ISUPPORTS9(_class, _i1, _i2, _i3, _i4, _i5, _i6,   \
-                                      _i7, _i8, _i9)                          \
-  NS_IMPL_THREADSAFE_ADDREF(_class)                                           \
-  NS_IMPL_THREADSAFE_RELEASE(_class)                                          \
-  NS_IMPL_THREADSAFE_QUERY_INTERFACE9(_class, _i1, _i2, _i3, _i4, _i5, _i6,   \
-                                      _i7, _i8, _i9)
-
-#define NS_IMPL_THREADSAFE_ISUPPORTS10(_class, _i1, _i2, _i3, _i4, _i5, _i6,  \
-                                       _i7, _i8, _i9, _i10)                   \
-  NS_IMPL_THREADSAFE_ADDREF(_class)                                           \
-  NS_IMPL_THREADSAFE_RELEASE(_class)                                          \
-  NS_IMPL_THREADSAFE_QUERY_INTERFACE10(_class, _i1, _i2, _i3, _i4, _i5, _i6,  \
-                                       _i7, _i8, _i9, _i10)
-
-#define NS_IMPL_THREADSAFE_ISUPPORTS11(_class, _i1, _i2, _i3, _i4, _i5, _i6,  \
-                                       _i7, _i8, _i9, _i10, _i11)             \
-  NS_IMPL_THREADSAFE_ADDREF(_class)                                           \
-  NS_IMPL_THREADSAFE_RELEASE(_class)                                          \
-  NS_IMPL_THREADSAFE_QUERY_INTERFACE11(_class, _i1, _i2, _i3, _i4, _i5, _i6,  \
-                                       _i7, _i8, _i9, _i10, _i11)
-
 #define NS_INTERFACE_MAP_END_THREADSAFE NS_IMPL_QUERY_TAIL_GUTS
 
 /**
  * Macro to generate nsIClassInfo methods for classes which do not have
  * corresponding nsIFactory implementations.
  */
 #define NS_IMPL_THREADSAFE_CI(_class)                                         \
 NS_IMETHODIMP                                                                 \
--- a/xpcom/io/nsPipe3.cpp
+++ b/xpcom/io/nsPipe3.cpp
@@ -9,17 +9,16 @@
 #include "nsISeekableStream.h"
 #include "nsIProgrammingLanguage.h"
 #include "nsSegmentedBuffer.h"
 #include "nsStreamUtils.h"
 #include "nsCOMPtr.h"
 #include "nsCRT.h"
 #include "prlog.h"
 #include "nsIClassInfoImpl.h"
-#include "nsAtomicRefcnt.h"
 #include "nsAlgorithm.h"
 
 using namespace mozilla;
 
 #if defined(PR_LOGGING)
 //
 // set NSPR_LOG_MODULES=nsPipe:5
 //
--- a/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/src/xptiInterfaceInfo.cpp
@@ -2,17 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Implementation of xptiInterfaceEntry and xptiInterfaceInfo. */
 
 #include "xptiprivate.h"
 #include "mozilla/XPTInterfaceInfoManager.h"
-#include "nsAtomicRefcnt.h"
 
 using namespace mozilla;
 
 /***************************************************************************/
 // Debug Instrumentation...
 
 #ifdef SHOW_INFO_COUNT_STATS
 static int DEBUG_TotalInfos = 0;
--- a/xpcom/tests/TestRacingServiceManager.cpp
+++ b/xpcom/tests/TestRacingServiceManager.cpp
@@ -9,16 +9,17 @@
 #include "mozilla/Module.h"
 #include "nsXULAppAPI.h"
 #include "nsIThread.h"
 #include "nsIComponentRegistrar.h"
 
 #include "nsAutoPtr.h"
 #include "nsThreadUtils.h"
 #include "nsXPCOMCIDInternal.h"
+#include "pratom.h"
 #include "prmon.h"
 #include "mozilla/Attributes.h"
 
 #include "mozilla/ReentrantMonitor.h"
 using namespace mozilla;
 
 #ifdef DEBUG
 #define TEST_ASSERTION(_test, _msg) \
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -7,16 +7,17 @@
 #include "mozilla/ReentrantMonitor.h"
 #include "nsMemoryPressure.h"
 #include "nsThread.h"
 #include "nsThreadManager.h"
 #include "nsIClassInfoImpl.h"
 #include "nsIProgrammingLanguage.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
+#include "pratom.h"
 #include "prlog.h"
 #include "nsIObserverService.h"
 #include "mozilla/HangMonitor.h"
 #include "mozilla/Services.h"
 #include "nsXPCOMPrivate.h"
 
 #define HAVE_UALARM _BSD_SOURCE || (_XOPEN_SOURCE >= 500 ||                 \
                       _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) &&           \
--- a/xpcom/threads/nsTimerImpl.cpp
+++ b/xpcom/threads/nsTimerImpl.cpp
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsTimerImpl.h"
 #include "TimerThread.h"
 #include "nsAutoPtr.h"
 #include "nsThreadManager.h"
 #include "nsThreadUtils.h"
 #include "plarena.h"
+#include "pratom.h"
 #include "GeckoProfiler.h"
 
 using mozilla::TimeDuration;
 using mozilla::TimeStamp;
 
 static int32_t          gGenerator = 0;
 static TimerThread*     gThread = nullptr;