Bug 1168161 - Mark nsPIDOMWindow::mDocShell as MOZ_NON_OWNING_REF. r=ehsan
authorMichael Layzell <michael@thelayzells.com>
Mon, 25 May 2015 10:57:00 +0200
changeset 275850 13bedf2492be370e0a27ea58addab68c7fcb75d8
parent 275849 50b3b013e383d6210611226f30ab5b46aae433fa
child 275851 cd94f7a2b847521e3b9578b336871398597a9eb6
push id3246
push usergijskruitbosch@gmail.com
push dateTue, 07 Jul 2015 09:06:38 +0000
reviewersehsan
bugs1168161
milestone42.0a1
Bug 1168161 - Mark nsPIDOMWindow::mDocShell as MOZ_NON_OWNING_REF. r=ehsan
dom/base/nsPIDOMWindow.h
--- a/dom/base/nsPIDOMWindow.h
+++ b/dom/base/nsPIDOMWindow.h
@@ -773,17 +773,20 @@ protected:
   // Cache the URI when mDoc is cleared.
   nsCOMPtr<nsIURI> mDocumentURI; // strong
   nsCOMPtr<nsIURI> mDocBaseURI; // strong
 
   nsCOMPtr<mozilla::dom::EventTarget> mParentTarget; // strong
 
   // These members are only used on outer windows.
   nsCOMPtr<mozilla::dom::Element> mFrameElement;
-  nsIDocShell           *mDocShell;  // Weak Reference
+  // This reference is used by the subclass nsGlobalWindow, and cleared in it's
+  // DetachFromDocShell() method. This method is called by nsDocShell::Destroy(),
+  // which is called before the nsDocShell is destroyed.
+  nsIDocShell* MOZ_NON_OWNING_REF mDocShell;  // Weak Reference
 
   // mPerformance is only used on inner windows.
   nsRefPtr<nsPerformance>       mPerformance;
 
   uint32_t               mModalStateDepth;
 
   // These variables are only used on inner windows.
   nsTimeout             *mRunningTimeout;