Bug 811926 - Fix a pair of TRAVERSE that were using NoteNativeChild on nsISupports* - simplify goop with helper CC macros - r=smaug
authorBenoit Jacob <bjacob@mozilla.com>
Thu, 15 Nov 2012 14:31:56 -0500
changeset 113406 1368272550daa6eec609468808e6d372136ad066
parent 113405 c231b310485e2df40314842e2320618d7237298e
child 113407 baf6f923340be01c78ce6f4232d22014ac5d42e0
push id23870
push userryanvm@gmail.com
push dateFri, 16 Nov 2012 01:21:36 +0000
treeherdermozilla-central@58ebb638a7ea [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs811926
milestone19.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 811926 - Fix a pair of TRAVERSE that were using NoteNativeChild on nsISupports* - simplify goop with helper CC macros - r=smaug
dom/telephony/CallEvent.cpp
dom/telephony/TelephonyCall.cpp
--- a/dom/telephony/CallEvent.cpp
+++ b/dom/telephony/CallEvent.cpp
@@ -21,31 +21,19 @@ CallEvent::Create(TelephonyCall* aCall)
 
   nsRefPtr<CallEvent> event = new CallEvent();
 
   event->mCall = aCall;
 
   return event.forget();
 }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(CallEvent)
-
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(CallEvent,
-                                                  nsDOMEvent)
-  // NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_PTR(tmp->mCall->ToISupports(),
-  //                                              TelephonyCall, "mCall")
-  NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mCall");
-  cb.NoteNativeChild(tmp->mCall->ToISupports(), NS_CYCLE_COLLECTION_PARTICIPANT(TelephonyCall));
-
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(CallEvent,
-                                                nsDOMEvent)
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mCall)
-NS_IMPL_CYCLE_COLLECTION_UNLINK_END
+NS_IMPL_CYCLE_COLLECTION_INHERITED_1(CallEvent,
+                                     nsDOMEvent,
+                                     mCall)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(CallEvent)
   NS_INTERFACE_MAP_ENTRY(nsIDOMCallEvent)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(CallEvent)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
 
 NS_IMPL_ADDREF_INHERITED(CallEvent, nsDOMEvent)
 NS_IMPL_RELEASE_INHERITED(CallEvent, nsDOMEvent)
--- a/dom/telephony/TelephonyCall.cpp
+++ b/dom/telephony/TelephonyCall.cpp
@@ -135,30 +135,19 @@ TelephonyCall::NotifyError(const nsAStri
   NS_ASSERTION(event, "This should never fail!");
 
   if (NS_FAILED(event->Dispatch(ToIDOMEventTarget(),
                                 NS_LITERAL_STRING("error")))) {
     NS_WARNING("Failed to dispatch error event!");
   }
 }
 
-NS_IMPL_CYCLE_COLLECTION_CLASS(TelephonyCall)
-
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(TelephonyCall,
-                                                  nsDOMEventTargetHelper)
-  // NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_PTR(tmp->mTelephony->ToISupports(),
-  //                                              Telephony, "mTelephony")
-  NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mTelephony");
-  cb.NoteNativeChild(tmp->mTelephony->ToISupports(), NS_CYCLE_COLLECTION_PARTICIPANT(Telephony));
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(TelephonyCall,
-                                                nsDOMEventTargetHelper)
-  NS_IMPL_CYCLE_COLLECTION_UNLINK(mTelephony)
-NS_IMPL_CYCLE_COLLECTION_UNLINK_END
+NS_IMPL_CYCLE_COLLECTION_INHERITED_1(TelephonyCall,
+                                     nsDOMEventTargetHelper,
+                                     mTelephony)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(TelephonyCall)
   NS_INTERFACE_MAP_ENTRY(nsIDOMTelephonyCall)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(TelephonyCall)
 NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
 
 NS_IMPL_ADDREF_INHERITED(TelephonyCall, nsDOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(TelephonyCall, nsDOMEventTargetHelper)