Bug 899022 - Cycle collect WindowRoot's window. r=mccr8, a=abillings
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Thu, 08 Aug 2013 21:23:55 +0300
changeset 153690 69d2e4db243b1e39195187038fb92809c7e8994b
parent 153689 cbe6bd1058f2d084ab1ac125df7a2cd0258d9394
child 153691 109bf9967b3d3b6e872fcb0b2db5345e04aa89f9
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8, abillings
bugs899022
milestone25.0a2
Bug 899022 - Cycle collect WindowRoot's window. r=mccr8, a=abillings
dom/base/nsWindowRoot.cpp
dom/base/nsWindowRoot.h
--- a/dom/base/nsWindowRoot.cpp
+++ b/dom/base/nsWindowRoot.cpp
@@ -38,17 +38,18 @@ nsWindowRoot::nsWindowRoot(nsPIDOMWindow
 
 nsWindowRoot::~nsWindowRoot()
 {
   if (mListenerManager) {
     mListenerManager->Disconnect();
   }
 }
 
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_3(nsWindowRoot,
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_4(nsWindowRoot,
+                                        mWindow,
                                         mListenerManager,
                                         mPopupNode,
                                         mParent)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsWindowRoot)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMEventTarget)
   NS_INTERFACE_MAP_ENTRY(nsPIWindowRoot)
--- a/dom/base/nsWindowRoot.h
+++ b/dom/base/nsWindowRoot.h
@@ -53,17 +53,17 @@ public:
   virtual mozilla::dom::EventTarget* GetParentTarget() MOZ_OVERRIDE { return mParent; }
   virtual nsIDOMWindow* GetOwnerGlobal() MOZ_OVERRIDE;
 
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsWindowRoot,
                                                          nsIDOMEventTarget)
 
 protected:
   // Members
-  nsPIDOMWindow* mWindow; // [Weak]. The window will hold on to us and let go when it dies.
+  nsCOMPtr<nsPIDOMWindow> mWindow;
   nsRefPtr<nsEventListenerManager> mListenerManager; // [Strong]. We own the manager, which owns event listeners attached
                                                       // to us.
 
   nsCOMPtr<nsIDOMNode> mPopupNode; // [OWNER]
 
   nsCOMPtr<mozilla::dom::EventTarget> mParent;
 };