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 251468 13bedf2492be370e0a27ea58addab68c7fcb75d8
parent 251467 50b3b013e383d6210611226f30ab5b46aae433fa
child 251469 cd94f7a2b847521e3b9578b336871398597a9eb6
push id29001
push userkwierso@gmail.com
push dateTue, 07 Jul 2015 00:07:21 +0000
treeherdermozilla-central@e8e7191442b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1168161
milestone42.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 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;