Bug 1168180 - Mark nsPresContext::mShell as MOZ_NON_OWNING_REF. r=dbaron
authorMichael Layzell <michael@thelayzells.com>
Tue, 16 Jun 2015 08:25:00 -0400
changeset 249157 2b1d3372ecd8c93e6c4de2c0e93c0460b852eaea
parent 249156 a1558d74b4db051c079d1cf3414effae2ef8160b
child 249158 9052882b93309fdf08cc8329047e2cd2d2775683
push id61153
push userryanvm@gmail.com
push dateTue, 16 Jun 2015 19:06:09 +0000
treeherdermozilla-inbound@e8b8cdc974ab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1168180
milestone41.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 1168180 - Mark nsPresContext::mShell as MOZ_NON_OWNING_REF. r=dbaron
layout/base/nsPresContext.h
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -1212,17 +1212,19 @@ protected:
 
   bool IsChromeSlow() const;
 
   // IMPORTANT: The ownership implicit in the following member variables
   // has been explicitly checked.  If you add any members to this class,
   // please make the ownership explicit (pinkerton, scc).
 
   nsPresContextType     mType;
-  nsIPresShell*         mShell;         // [WEAK]
+  // the nsPresShell owns a strong reference to the nsPresContext, and is responsible
+  // for nulling this pointer before it is destroyed
+  nsIPresShell* MOZ_NON_OWNING_REF mShell;         // [WEAK]
   nsCOMPtr<nsIDocument> mDocument;
   nsRefPtr<nsDeviceContext> mDeviceContext; // [STRONG] could be weak, but
                                             // better safe than sorry.
                                             // Cannot reintroduce cycles
                                             // since there is no dependency
                                             // from gfx back to layout.
   nsRefPtr<mozilla::EventStateManager> mEventManager;
   nsRefPtr<nsRefreshDriver> mRefreshDriver;