Bug 1064587 - Cycle collect nsFormFillController. r=smaug
authorAndrew McCreight <continuation@gmail.com>
Tue, 09 Sep 2014 19:45:50 -0700
changeset 204460 badb065c77acef3b3e17eb33b9e859b95a661a88
parent 204459 bf3cb1e5ea630a705eb29944fa048884d57a9bee
child 204461 09699bf795acdab2c91664efb113995d0462989f
push id27458
push usercbook@mozilla.com
push dateWed, 10 Sep 2014 12:59:53 +0000
treeherdermozilla-central@3402f4fbf7b2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1064587
milestone35.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 1064587 - Cycle collect nsFormFillController. r=smaug
toolkit/components/satchel/nsFormFillController.cpp
toolkit/components/satchel/nsFormFillController.h
--- a/toolkit/components/satchel/nsFormFillController.cpp
+++ b/toolkit/components/satchel/nsFormFillController.cpp
@@ -34,23 +34,35 @@
 #include "nsToolkitCompsCID.h"
 #include "nsEmbedCID.h"
 #include "nsIDOMNSEditableElement.h"
 #include "nsContentUtils.h"
 #include "nsILoadContext.h"
 
 using namespace mozilla::dom;
 
-NS_IMPL_ISUPPORTS(nsFormFillController,
-                  nsIFormFillController,
-                  nsIAutoCompleteInput,
-                  nsIAutoCompleteSearch,
-                  nsIDOMEventListener,
-                  nsIFormAutoCompleteObserver,
-                  nsIMutationObserver)
+NS_IMPL_CYCLE_COLLECTION(nsFormFillController,
+                         mController, mLoginManager, mFocusedPopup, mDocShells,
+                         mPopups, mLastSearchResult, mLastListener,
+                         mLastFormAutoComplete)
+
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsFormFillController)
+  NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIFormFillController)
+  NS_INTERFACE_MAP_ENTRY(nsIFormFillController)
+  NS_INTERFACE_MAP_ENTRY(nsIAutoCompleteInput)
+  NS_INTERFACE_MAP_ENTRY(nsIAutoCompleteSearch)
+  NS_INTERFACE_MAP_ENTRY(nsIDOMEventListener)
+  NS_INTERFACE_MAP_ENTRY(nsIFormAutoCompleteObserver)
+  NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
+NS_INTERFACE_MAP_END
+
+NS_IMPL_CYCLE_COLLECTING_ADDREF(nsFormFillController)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(nsFormFillController)
+
+
 
 nsFormFillController::nsFormFillController() :
   mFocusedInput(nullptr),
   mFocusedInputNode(nullptr),
   mListNode(nullptr),
   mTimeout(50),
   mMinResultsForPopup(1),
   mMaxRows(0),
--- a/toolkit/components/satchel/nsFormFillController.h
+++ b/toolkit/components/satchel/nsFormFillController.h
@@ -16,41 +16,44 @@
 #include "nsCOMPtr.h"
 #include "nsDataHashtable.h"
 #include "nsIDocShell.h"
 #include "nsIDOMWindow.h"
 #include "nsIDOMHTMLInputElement.h"
 #include "nsILoginManager.h"
 #include "nsIMutationObserver.h"
 #include "nsTArray.h"
+#include "nsCycleCollectionParticipant.h"
 
 // X.h defines KeyPress
 #ifdef KeyPress
 #undef KeyPress
 #endif
 
 class nsFormHistory;
 class nsINode;
 
-class nsFormFillController : public nsIFormFillController,
-                             public nsIAutoCompleteInput,
-                             public nsIAutoCompleteSearch,
-                             public nsIDOMEventListener,
-                             public nsIFormAutoCompleteObserver,
-                             public nsIMutationObserver
+class nsFormFillController MOZ_FINAL : public nsIFormFillController,
+                                       public nsIAutoCompleteInput,
+                                       public nsIAutoCompleteSearch,
+                                       public nsIDOMEventListener,
+                                       public nsIFormAutoCompleteObserver,
+                                       public nsIMutationObserver
 {
 public:
-  NS_DECL_ISUPPORTS
+  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_NSIFORMFILLCONTROLLER
   NS_DECL_NSIAUTOCOMPLETESEARCH
   NS_DECL_NSIAUTOCOMPLETEINPUT
   NS_DECL_NSIFORMAUTOCOMPLETEOBSERVER
   NS_DECL_NSIDOMEVENTLISTENER
   NS_DECL_NSIMUTATIONOBSERVER
 
+  NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsFormFillController, nsIFormFillController)
+
   nsresult Focus(nsIDOMEvent* aEvent);
   nsresult KeyPress(nsIDOMEvent* aKeyEvent);
   nsresult MouseDown(nsIDOMEvent* aMouseEvent);
 
   nsFormFillController();
 
 protected:
   virtual ~nsFormFillController();