Fix for bug 839529 (Remove various CC participants that don't do anything). r=smaug.
authorPeter Van der Beken <peterv@propagandism.org>
Thu, 07 Feb 2013 10:19:08 +0000
changeset 122135 159954333c5ebe635ad1c463253f81f1f190a913
parent 122134 9b4182f33b7f93d2089280a3e523c3f48a039e66
child 122136 f98f9cf410fe30d5bb382209071bea488af7d602
push id24319
push userryanvm@gmail.com
push dateSat, 16 Feb 2013 23:49:46 +0000
treeherdermozilla-central@c4de6de47382 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs839529
milestone21.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
Fix for bug 839529 (Remove various CC participants that don't do anything). r=smaug.
content/base/src/nsDOMFile.cpp
content/media/DOMMediaStream.cpp
content/media/DOMMediaStream.h
dom/base/nsScreen.cpp
dom/bluetooth/BluetoothManager.cpp
dom/bluetooth/BluetoothManager.h
dom/camera/DOMCameraCapabilities.cpp
dom/camera/DOMCameraCapabilities.h
dom/camera/FallbackCameraCapabilities.cpp
dom/fm/FMRadio.cpp
dom/fm/FMRadio.h
dom/network/src/Connection.cpp
dom/network/src/Connection.h
dom/sms/src/SmsManager.cpp
dom/sms/src/SmsManager.h
dom/voicemail/Voicemail.cpp
dom/voicemail/Voicemail.h
editor/libeditor/base/EditTxn.cpp
extensions/spellcheck/src/mozGenericWordUtils.cpp
extensions/spellcheck/src/mozGenericWordUtils.h
extensions/spellcheck/src/mozInlineSpellChecker.cpp
extensions/spellcheck/src/mozSpellChecker.cpp
extensions/spellcheck/src/mozSpellI18NManager.cpp
extensions/spellcheck/src/mozSpellI18NManager.h
rdf/datasource/src/nsFileSystemDataSource.cpp
rdf/datasource/src/nsFileSystemDataSource.h
xpcom/glue/nsCycleCollectionParticipant.h
--- a/content/base/src/nsDOMFile.cpp
+++ b/content/base/src/nsDOMFile.cpp
@@ -448,17 +448,20 @@ NS_INTERFACE_MAP_END
 
 // Threadsafe when GetMutable() == false
 NS_IMPL_THREADSAFE_ADDREF(nsDOMFile)
 NS_IMPL_THREADSAFE_RELEASE(nsDOMFile)
 
 ////////////////////////////////////////////////////////////////////////////
 // nsDOMFileCC implementation
 
-NS_IMPL_CYCLE_COLLECTION_0(nsDOMFileCC)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_0(nsDOMFileCC)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMFileCC)
+  // We don't have anything to traverse, but some of our subclasses do.
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMFileCC)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMFile)
   NS_INTERFACE_MAP_ENTRY(nsIDOMBlob)
   NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIDOMFile, mIsFile)
   NS_INTERFACE_MAP_ENTRY(nsIXHRSendable)
   NS_INTERFACE_MAP_ENTRY(nsIMutable)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO_CONDITIONAL(File, mIsFile)
--- a/content/media/DOMMediaStream.cpp
+++ b/content/media/DOMMediaStream.cpp
@@ -17,23 +17,18 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMediaStream)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMMediaStream)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMMediaStream)
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(DOMMediaStream, mWindow)
 
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMLocalMediaStream)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMLocalMediaStream)
-NS_INTERFACE_MAP_END_INHERITING(DOMMediaStream)
-
-NS_IMPL_ADDREF_INHERITED(DOMLocalMediaStream, DOMMediaStream)
-NS_IMPL_RELEASE_INHERITED(DOMLocalMediaStream, DOMMediaStream)
-NS_IMPL_CYCLE_COLLECTION_INHERITED_0(DOMLocalMediaStream, DOMMediaStream)
+NS_IMPL_ISUPPORTS_INHERITED1(DOMLocalMediaStream, DOMMediaStream,
+                             nsIDOMLocalMediaStream)
 
 DOMMediaStream::~DOMMediaStream()
 {
   if (mStream) {
     mStream->Destroy();
   }
 }
 
--- a/content/media/DOMMediaStream.h
+++ b/content/media/DOMMediaStream.h
@@ -113,17 +113,16 @@ protected:
 class DOMLocalMediaStream : public DOMMediaStream,
                             public nsIDOMLocalMediaStream
 {
 public:
   DOMLocalMediaStream() {}
   virtual ~DOMLocalMediaStream();
 
   NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DOMLocalMediaStream, DOMMediaStream)
 
   virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope, bool* aTriedToWrap);
 
   virtual void Stop();
 
   /**
    * Create an nsDOMLocalMediaStream whose underlying stream is a SourceMediaStream.
    */
--- a/dom/base/nsScreen.cpp
+++ b/dom/base/nsScreen.cpp
@@ -85,20 +85,18 @@ nsScreen::~nsScreen()
 {
   Reset();
   hal::UnregisterScreenConfigurationObserver(this);
 }
 
 
 DOMCI_DATA(Screen, nsScreen)
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED_0(nsScreen, nsDOMEventTargetHelper)
-
 // QueryInterface implementation for nsScreen
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsScreen)
+NS_INTERFACE_MAP_BEGIN(nsScreen)
   NS_INTERFACE_MAP_ENTRY(nsIDOMScreen)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(Screen)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
 
 NS_IMPL_ADDREF_INHERITED(nsScreen, nsDOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(nsScreen, nsDOMEventTargetHelper)
 
 NS_IMPL_EVENT_HANDLER(nsScreen, mozorientationchange)
--- a/dom/bluetooth/BluetoothManager.cpp
+++ b/dom/bluetooth/BluetoothManager.cpp
@@ -20,19 +20,17 @@
 #include "mozilla/dom/bluetooth/BluetoothTypes.h"
 
 using namespace mozilla;
 
 USING_BLUETOOTH_NAMESPACE
 
 DOMCI_DATA(BluetoothManager, BluetoothManager)
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED_0(BluetoothManager, nsDOMEventTargetHelper)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(BluetoothManager)
+NS_INTERFACE_MAP_BEGIN(BluetoothManager)
   NS_INTERFACE_MAP_ENTRY(nsIDOMBluetoothManager)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(BluetoothManager)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
 
 NS_IMPL_ADDREF_INHERITED(BluetoothManager, nsDOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(BluetoothManager, nsDOMEventTargetHelper)
 
 class GetAdapterTask : public BluetoothReplyRunnable
--- a/dom/bluetooth/BluetoothManager.h
+++ b/dom/bluetooth/BluetoothManager.h
@@ -23,19 +23,16 @@ class BluetoothManager : public nsDOMEve
                        , public BluetoothPropertyContainer
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMBLUETOOTHMANAGER
 
   NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::)
 
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(BluetoothManager,
-                                           nsDOMEventTargetHelper)
-
   static already_AddRefed<BluetoothManager>
   Create(nsPIDOMWindow* aWindow);
   void Notify(const BluetoothSignal& aData);
   virtual void SetPropertyByValue(const BluetoothNamedValue& aValue);
 private:
   BluetoothManager(nsPIDOMWindow* aWindow);
   ~BluetoothManager();
 };
--- a/dom/camera/DOMCameraCapabilities.cpp
+++ b/dom/camera/DOMCameraCapabilities.cpp
@@ -12,26 +12,24 @@
 #include "DOMCameraCapabilities.h"
 #include "CameraCommon.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 DOMCI_DATA(CameraCapabilities, nsICameraCapabilities)
 
-NS_IMPL_CYCLE_COLLECTION_0(DOMCameraCapabilities)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMCameraCapabilities)
+NS_INTERFACE_MAP_BEGIN(DOMCameraCapabilities)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_INTERFACE_MAP_ENTRY(nsICameraCapabilities)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CameraCapabilities)
 NS_INTERFACE_MAP_END
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMCameraCapabilities)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMCameraCapabilities)
+NS_IMPL_ADDREF(DOMCameraCapabilities)
+NS_IMPL_RELEASE(DOMCameraCapabilities)
 
 static nsresult
 ParseZoomRatioItemAndAdd(JSContext* aCx, JSObject* aArray, uint32_t aIndex, const char* aStart, char** aEnd)
 {
   if (!*aEnd) {
     // make 'aEnd' follow the same semantics as strchr().
     aEnd = nullptr;
   }
--- a/dom/camera/DOMCameraCapabilities.h
+++ b/dom/camera/DOMCameraCapabilities.h
@@ -1,29 +1,27 @@
 /* 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 DOM_CAMERA_DOMCAMERACAPABILITIES_H
 #define DOM_CAMERA_DOMCAMERACAPABILITIES_H
 
-#include "nsCycleCollectionParticipant.h"
 #include "ICameraControl.h"
 #include "nsAutoPtr.h"
 #include "CameraCommon.h"
 
 namespace mozilla {
 
 typedef nsresult (*ParseItemAndAddFunc)(JSContext* aCx, JSObject* aArray, uint32_t aIndex, const char* aStart, char** aEnd);
 
 class DOMCameraCapabilities MOZ_FINAL : public nsICameraCapabilities
 {
 public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_CLASS(DOMCameraCapabilities)
+  NS_DECL_ISUPPORTS
   NS_DECL_NSICAMERACAPABILITIES
 
   DOMCameraCapabilities(ICameraControl* aCamera)
     : mCamera(aCamera)
   {
     DOM_CAMERA_LOGT("%s:%d : this=%p\n", __func__, __LINE__, this);
   }
 
--- a/dom/camera/FallbackCameraCapabilities.cpp
+++ b/dom/camera/FallbackCameraCapabilities.cpp
@@ -6,26 +6,24 @@
 #include "DOMCameraControl.h"
 #include "DOMCameraCapabilities.h"
 #include "CameraCommon.h"
 
 using namespace mozilla;
 
 DOMCI_DATA(CameraCapabilities, nsICameraCapabilities)
 
-NS_IMPL_CYCLE_COLLECTION_0(DOMCameraCapabilities)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMCameraCapabilities)
+NS_INTERFACE_MAP_BEGIN(DOMCameraCapabilities)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_INTERFACE_MAP_ENTRY(nsICameraCapabilities)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CameraCapabilities)
 NS_INTERFACE_MAP_END
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMCameraCapabilities)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMCameraCapabilities)
+NS_IMPL_ADDREF(DOMCameraCapabilities)
+NS_IMPL_RELEASE(DOMCameraCapabilities)
 
 /* [implicit_jscontext] readonly attribute jsval previewSizes; */
 NS_IMETHODIMP
 DOMCameraCapabilities::GetPreviewSizes(JSContext* cx, JS::Value* aPreviewSizes)
 {
     return NS_ERROR_NOT_IMPLEMENTED;
 }
 
--- a/dom/fm/FMRadio.cpp
+++ b/dom/fm/FMRadio.cpp
@@ -59,23 +59,17 @@ FMRadio::~FMRadio()
   UnregisterFMRadioObserver(this);
   if (!mHasInternalAntenna) {
     UnregisterSwitchObserver(SWITCH_HEADPHONES, this);
   }
 }
 
 DOMCI_DATA(FMRadio, FMRadio)
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED_0(FMRadio, nsDOMEventTargetHelper)
-
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(FMRadio,
-                                               nsDOMEventTargetHelper)
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(FMRadio)
+NS_INTERFACE_MAP_BEGIN(FMRadio)
   NS_INTERFACE_MAP_ENTRY(nsIFMRadio)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(FMRadio)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
 
 NS_IMPL_EVENT_HANDLER(FMRadio, seekcomplete)
 NS_IMPL_EVENT_HANDLER(FMRadio, disabled)
 NS_IMPL_EVENT_HANDLER(FMRadio, enabled)
 NS_IMPL_EVENT_HANDLER(FMRadio, antennastatechange)
--- a/dom/fm/FMRadio.h
+++ b/dom/fm/FMRadio.h
@@ -25,24 +25,21 @@ namespace fm {
 /* Header file */
 class FMRadio : public nsDOMEventTargetHelper
               , public nsIFMRadio
               , public hal::FMRadioObserver
               , public hal::SwitchObserver
               , public nsIAudioChannelAgentCallback
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIFMRADIO
   NS_DECL_NSIAUDIOCHANNELAGENTCALLBACK
 
   NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::)
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(
-                                                   FMRadio,
-                                                   nsDOMEventTargetHelper)
   FMRadio();
   virtual void Notify(const hal::FMRadioOperationInformation& info);
   virtual void Notify(const hal::SwitchEvent& aEvent);
 
 private:
   ~FMRadio();
 
   hal::SwitchState mHeadphoneState;
--- a/dom/network/src/Connection.cpp
+++ b/dom/network/src/Connection.cpp
@@ -21,19 +21,17 @@ DOMCI_DATA(MozConnection, mozilla::dom::
 
 namespace mozilla {
 namespace dom {
 namespace network {
 
 const char* Connection::sMeteredPrefName     = "dom.network.metered";
 const bool  Connection::sMeteredDefaultValue = false;
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED_0(Connection, nsDOMEventTargetHelper)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(Connection)
+NS_INTERFACE_MAP_BEGIN(Connection)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMozConnection)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozConnection)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
 
 NS_IMPL_ADDREF_INHERITED(Connection, nsDOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(Connection, nsDOMEventTargetHelper)
 
 NS_IMPL_EVENT_HANDLER(Connection, change)
--- a/dom/network/src/Connection.h
+++ b/dom/network/src/Connection.h
@@ -21,32 +21,29 @@ class NetworkInformation;
 namespace dom {
 namespace network {
 
 class Connection : public nsDOMEventTargetHelper
                  , public nsIDOMMozConnection
                  , public NetworkObserver
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMMOZCONNECTION
 
   NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::)
 
   Connection();
 
   void Init(nsPIDOMWindow *aWindow);
   void Shutdown();
 
   // For IObserver
   void Notify(const hal::NetworkInformation& aNetworkInfo);
 
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(Connection,
-                                           nsDOMEventTargetHelper)
-
 private:
   /**
    * Update the connection information stored in the object using a
    * NetworkInformation object.
    */
   void UpdateFromNetworkInfo(const hal::NetworkInformation& aNetworkInfo);
 
   /**
--- a/dom/sms/src/SmsManager.cpp
+++ b/dom/sms/src/SmsManager.cpp
@@ -29,19 +29,17 @@
 #define DELIVERY_ERROR_EVENT_NAME   NS_LITERAL_STRING("deliveryerror")
 
 DOMCI_DATA(MozSmsManager, mozilla::dom::sms::SmsManager)
 
 namespace mozilla {
 namespace dom {
 namespace sms {
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED_0(SmsManager, nsDOMEventTargetHelper)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(SmsManager)
+NS_INTERFACE_MAP_BEGIN(SmsManager)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMozSmsManager)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozSmsManager)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
 
 NS_IMPL_ADDREF_INHERITED(SmsManager, nsDOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(SmsManager, nsDOMEventTargetHelper)
 
--- a/dom/sms/src/SmsManager.h
+++ b/dom/sms/src/SmsManager.h
@@ -16,25 +16,22 @@ namespace mozilla {
 namespace dom {
 namespace sms {
 
 class SmsManager : public nsDOMEventTargetHelper
                  , public nsIDOMMozSmsManager
                  , public nsIObserver
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIOBSERVER
   NS_DECL_NSIDOMMOZSMSMANAGER
 
   NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::)
 
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(SmsManager,
-                                           nsDOMEventTargetHelper)
-
   static already_AddRefed<SmsManager>
   CreateInstanceIfAllowed(nsPIDOMWindow *aWindow);
 
   void Init(nsPIDOMWindow *aWindow);
   void Shutdown();
 
 private:
   /**
--- a/dom/voicemail/Voicemail.cpp
+++ b/dom/voicemail/Voicemail.cpp
@@ -15,19 +15,17 @@
 #include "nsServiceManagerUtils.h"
 #include "GeneratedEvents.h"
 
 DOMCI_DATA(MozVoicemail, mozilla::dom::Voicemail)
 
 namespace mozilla {
 namespace dom {
 
-NS_IMPL_CYCLE_COLLECTION_INHERITED_0(Voicemail, nsDOMEventTargetHelper)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(Voicemail)
+NS_INTERFACE_MAP_BEGIN(Voicemail)
   NS_INTERFACE_MAP_ENTRY(nsIDOMMozVoicemail)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozVoicemail)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
 
 NS_IMPL_ADDREF_INHERITED(Voicemail, nsDOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(Voicemail, nsDOMEventTargetHelper)
 
 NS_IMPL_ISUPPORTS1(Voicemail::RILVoicemailCallback, nsIRILVoicemailCallback)
--- a/dom/voicemail/Voicemail.h
+++ b/dom/voicemail/Voicemail.h
@@ -24,18 +24,16 @@ class Voicemail : public nsDOMEventTarge
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMMOZVOICEMAIL
   NS_DECL_NSIRILVOICEMAILCALLBACK
 
   NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::)
 
-  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(Voicemail, nsDOMEventTargetHelper)
-
   Voicemail(nsPIDOMWindow* aWindow, nsIRILContentHelper* aRIL);
   virtual ~Voicemail();
 
 private:
   nsCOMPtr<nsIRILContentHelper> mRIL;
   nsCOMPtr<nsIRILVoicemailCallback> mRILVoicemailCallback;
 
   class RILVoicemailCallback : public nsIRILVoicemailCallback
--- a/editor/libeditor/base/EditTxn.cpp
+++ b/editor/libeditor/base/EditTxn.cpp
@@ -2,17 +2,20 @@
 /* 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 "EditTxn.h"
 #include "nsError.h"
 #include "nsISupportsBase.h"
 
-NS_IMPL_CYCLE_COLLECTION_0(EditTxn)
+NS_IMPL_CYCLE_COLLECTION_UNLINK_0(EditTxn)
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(EditTxn)
+  // We don't have anything to traverse, but some of our subclasses do.
+NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(EditTxn)
   NS_INTERFACE_MAP_ENTRY(nsITransaction)
   NS_INTERFACE_MAP_ENTRY(nsPIEditorTransaction)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsITransaction)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(EditTxn)
--- a/extensions/spellcheck/src/mozGenericWordUtils.cpp
+++ b/extensions/spellcheck/src/mozGenericWordUtils.cpp
@@ -1,24 +1,15 @@
 /* -*- 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 "mozGenericWordUtils.h"
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(mozGenericWordUtils)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(mozGenericWordUtils)
-
-NS_INTERFACE_MAP_BEGIN(mozGenericWordUtils)
-  NS_INTERFACE_MAP_ENTRY(mozISpellI18NUtil)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, mozISpellI18NUtil)
-  NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(mozGenericWordUtils)
-NS_INTERFACE_MAP_END
-
-NS_IMPL_CYCLE_COLLECTION_0(mozGenericWordUtils)
+NS_IMPL_ISUPPORTS1(mozGenericWordUtils, mozISpellI18NUtil)
 
   // do something sensible but generic ... eventually.  For now whine.
 
 mozGenericWordUtils::mozGenericWordUtils()
 {
   /* member initializers and constructor code */
 }
 
--- a/extensions/spellcheck/src/mozGenericWordUtils.h
+++ b/extensions/spellcheck/src/mozGenericWordUtils.h
@@ -8,17 +8,16 @@
 
 #include "nsCOMPtr.h"
 #include "mozISpellI18NUtil.h"
 #include "nsCycleCollectionParticipant.h"
 
 class mozGenericWordUtils : public mozISpellI18NUtil
 {
 public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+  NS_DECL_ISUPPORTS
   NS_DECL_MOZISPELLI18NUTIL
-  NS_DECL_CYCLE_COLLECTION_CLASS(mozGenericWordUtils)
 
   mozGenericWordUtils();
   virtual ~mozGenericWordUtils();
 };
 
 #endif
--- a/extensions/spellcheck/src/mozInlineSpellChecker.cpp
+++ b/extensions/spellcheck/src/mozInlineSpellChecker.cpp
@@ -473,21 +473,20 @@ NS_INTERFACE_MAP_BEGIN(mozInlineSpellChe
   NS_INTERFACE_MAP_ENTRY(nsIDOMEventListener)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMEventListener)
   NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(mozInlineSpellChecker)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(mozInlineSpellChecker)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(mozInlineSpellChecker)
 
-NS_IMPL_CYCLE_COLLECTION_5(mozInlineSpellChecker,
+NS_IMPL_CYCLE_COLLECTION_4(mozInlineSpellChecker,
                            mSpellCheck,
                            mTextServicesDocument,
                            mTreeWalker,
-                           mConverter,
                            mCurrentSelectionAnchorNode)
 
 mozInlineSpellChecker::SpellCheckingState
   mozInlineSpellChecker::gCanEnableSpellChecking =
   mozInlineSpellChecker::SpellCheck_Uninitialized;
 
 mozInlineSpellChecker::mozInlineSpellChecker() :
     mNumWordsInSpellSelection(0),
--- a/extensions/spellcheck/src/mozSpellChecker.cpp
+++ b/extensions/spellcheck/src/mozSpellChecker.cpp
@@ -16,18 +16,17 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(mozSpell
 NS_IMPL_CYCLE_COLLECTING_RELEASE(mozSpellChecker)
 
 NS_INTERFACE_MAP_BEGIN(mozSpellChecker)
   NS_INTERFACE_MAP_ENTRY(nsISpellChecker)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISpellChecker)
   NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(mozSpellChecker)
 NS_INTERFACE_MAP_END
 
-NS_IMPL_CYCLE_COLLECTION_3(mozSpellChecker,
-                           mConverter,
+NS_IMPL_CYCLE_COLLECTION_2(mozSpellChecker,
                            mTsDoc,
                            mPersonalDictionary)
 
 mozSpellChecker::mozSpellChecker()
 {
 }
 
 mozSpellChecker::~mozSpellChecker()
--- a/extensions/spellcheck/src/mozSpellI18NManager.cpp
+++ b/extensions/spellcheck/src/mozSpellI18NManager.cpp
@@ -3,26 +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 "mozSpellI18NManager.h"
 #include "mozEnglishWordUtils.h"
 #include "mozGenericWordUtils.h"
 #include "nsString.h"
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(mozSpellI18NManager)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(mozSpellI18NManager)
-
-NS_INTERFACE_MAP_BEGIN(mozSpellI18NManager)
-  NS_INTERFACE_MAP_ENTRY(mozISpellI18NManager)
-  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, mozISpellI18NManager)
-  NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(mozSpellI18NManager)
-NS_INTERFACE_MAP_END
-
-NS_IMPL_CYCLE_COLLECTION_0(mozSpellI18NManager)
+NS_IMPL_ISUPPORTS1(mozSpellI18NManager, mozISpellI18NManager)
 
 mozSpellI18NManager::mozSpellI18NManager()
 {
   /* member initializers and constructor code */
 }
 
 mozSpellI18NManager::~mozSpellI18NManager()
 {
--- a/extensions/spellcheck/src/mozSpellI18NManager.h
+++ b/extensions/spellcheck/src/mozSpellI18NManager.h
@@ -14,17 +14,16 @@
 #define MOZ_SPELLI18NMANAGER_CID         \
 { /* {AEB8936F-219C-4D3C-8385-D9382DAA551A} */  \
 0xaeb8936f, 0x219c, 0x4d3c, \
   { 0x83, 0x85, 0xd9, 0x38, 0x2d, 0xaa, 0x55, 0x1a } }
 
 class mozSpellI18NManager : public mozISpellI18NManager
 {
 public:
-  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
+  NS_DECL_ISUPPORTS
   NS_DECL_MOZISPELLI18NMANAGER
-  NS_DECL_CYCLE_COLLECTION_CLASS(mozSpellI18NManager)
 
   mozSpellI18NManager();
   virtual ~mozSpellI18NManager();
 };
 #endif
 
--- a/rdf/datasource/src/nsFileSystemDataSource.cpp
+++ b/rdf/datasource/src/nsFileSystemDataSource.cpp
@@ -208,23 +208,17 @@ FileSystemDataSource::Create(nsISupports
         return NS_ERROR_OUT_OF_MEMORY;
      
     nsresult rv = self->Init();
     NS_ENSURE_SUCCESS(rv, rv);
 
     return self->QueryInterface(aIID, aResult);
 }
 
-NS_IMPL_CYCLE_COLLECTION_0(FileSystemDataSource) 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(FileSystemDataSource)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(FileSystemDataSource)
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FileSystemDataSource)
-    NS_INTERFACE_MAP_ENTRY(nsIRDFDataSource)
-    NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
+NS_IMPL_ISUPPORTS1(FileSystemDataSource, nsIRDFDataSource)
 
 NS_IMETHODIMP
 FileSystemDataSource::GetURI(char **uri)
 {
     NS_PRECONDITION(uri != nullptr, "null ptr");
     if (! uri)
         return NS_ERROR_NULL_POINTER;
 
--- a/rdf/datasource/src/nsFileSystemDataSource.h
+++ b/rdf/datasource/src/nsFileSystemDataSource.h
@@ -8,28 +8,26 @@
 
 #include "nsIRDFDataSource.h"
 #include "nsIRDFLiteral.h"
 #include "nsIRDFResource.h"
 #include "nsIRDFService.h"
 #include "nsISupportsArray.h"
 #include "nsCOMPtr.h"
 #include "nsString.h"
-#include "nsCycleCollectionParticipant.h"
 #include "mozilla/Attributes.h"
 
 #if defined(XP_UNIX) || defined(XP_OS2) || defined(XP_WIN)
 #define USE_NC_EXTENSION
 #endif
 
 class FileSystemDataSource MOZ_FINAL : public nsIRDFDataSource
 {
 public:
-    NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-    NS_DECL_CYCLE_COLLECTION_CLASS(FileSystemDataSource)
+    NS_DECL_ISUPPORTS
     NS_DECL_NSIRDFDATASOURCE
 
     static nsresult Create(nsISupports* aOuter,
                            const nsIID& aIID, void **aResult);
 
     ~FileSystemDataSource() { }
     nsresult Init();
 
--- a/xpcom/glue/nsCycleCollectionParticipant.h
+++ b/xpcom/glue/nsCycleCollectionParticipant.h
@@ -789,20 +789,18 @@ struct Skippable
   NS_METHOD                                                                    \
   NS_CYCLE_COLLECTION_CLASSNAME(_class)::UnrootImpl(void *p)                   \
   {                                                                            \
     _class *tmp = static_cast<_class*>(p);                                     \
     tmp->_unroot_function();                                                   \
     return NS_OK;                                                              \
   }
 
-#define NS_IMPL_CYCLE_COLLECTION_0(_class)                                     \
- NS_IMPL_CYCLE_COLLECTION_UNLINK_0(_class)                                     \
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class)                               \
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
+// NS_IMPL_CYCLE_COLLECTION_0 is not defined because most of the time it doesn't
+// make sense to add something to the CC that doesn't traverse to anything.
 
 #define NS_IMPL_CYCLE_COLLECTION_1(_class, _f)                                 \
  NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class)                                 \
  NS_IMPL_CYCLE_COLLECTION_UNLINK(_f)                                           \
  NS_IMPL_CYCLE_COLLECTION_UNLINK_END                                           \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class)                               \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f)                                         \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
@@ -938,22 +936,16 @@ struct Skippable
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f4)                                        \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f5)                                        \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f6)                                        \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f7)                                        \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f8)                                        \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f9)                                        \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
-#define NS_IMPL_CYCLE_COLLECTION_INHERITED_0(_class, _base)                    \
- NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(_class, _base)                \
- NS_IMPL_CYCLE_COLLECTION_UNLINK_END                                           \
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(_class, _base)              \
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
 #define NS_IMPL_CYCLE_COLLECTION_INHERITED_1(_class, _base, _f1)               \
  NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(_class, _base)                \
  NS_IMPL_CYCLE_COLLECTION_UNLINK(_f1)                                          \
  NS_IMPL_CYCLE_COLLECTION_UNLINK_END                                           \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(_class, _base)              \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_f1)                                        \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END