Bug 1168176 - Mark gfxFontShaper::mFont as MOZ_NON_OWNING_REF. r=jtd
authorMichael Layzell <michael@thelayzells.com>
Mon, 25 May 2015 11:32:00 -0400
changeset 249161 60d7b4ba9e03b5083d6d1da7e6c36a9b8b1830e5
parent 249160 2672dbf9be5d562fdd045d6fe16edd21982edc60
child 249162 00113dc99ee970f54756e9e8a64caacfd5715db3
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)
reviewersjtd
bugs1168176
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 1168176 - Mark gfxFontShaper::mFont as MOZ_NON_OWNING_REF. r=jtd
gfx/thebes/gfxFont.h
--- a/gfx/thebes/gfxFont.h
+++ b/gfx/thebes/gfxFont.h
@@ -644,18 +644,20 @@ public:
                       bool aDisableLigatures,
                       const nsAString& aFamilyName,
                       bool aAddSmallCaps,
                       PLDHashOperator (*aHandleFeature)(const uint32_t&,
                                                         uint32_t&, void*),
                       void* aHandleFeatureData);
 
 protected:
-    // the font this shaper is working with
-    gfxFont * mFont;
+    // the font this shaper is working with. The font owns a nsAutoPtr reference
+    // to this object, and will destroy it before it dies. Thus, mFont will always
+    // be valid.
+    gfxFont* MOZ_NON_OWNING_REF mFont;
 };
 
 
 /*
  * gfxShapedText is an abstract superclass for gfxShapedWord and gfxTextRun.
  * These are objects that store a list of zero or more glyphs for each character.
  * For each glyph we store the glyph ID, the advance, and possibly x/y-offsets.
  * The idea is that a string is rendered by a loop that draws each glyph