Bug 1163446 - Drop reference to FontFace once a FontFaceBufferSource is loaded. r=jdaggett
authorCameron McCormack <cam@mcc.id.au>
Mon, 11 May 2015 11:24:49 +1000
changeset 243323 6325283ba40bc00b0b3d0a85331880f1ef18a786
parent 243322 3bae55ada55e72dac1c406ac1b0983159b3a15ba
child 243324 2f26a0e2c3320194a521f8c0c551ac37a29253d1
push id28738
push usercbook@mozilla.com
push dateTue, 12 May 2015 14:11:31 +0000
treeherdermozilla-central@bedce1b405a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdaggett
bugs1163446
milestone40.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 1163446 - Drop reference to FontFace once a FontFaceBufferSource is loaded. r=jdaggett
layout/style/FontFace.cpp
layout/style/crashtests/crashtests.list
--- a/layout/style/FontFace.cpp
+++ b/layout/style/FontFace.cpp
@@ -34,17 +34,20 @@ public:
 
 private:
   nsRefPtr<FontFace> mFontFace;
 };
 
 void
 FontFaceBufferSource::TakeBuffer(uint8_t*& aBuffer, uint32_t& aLength)
 {
+  MOZ_ASSERT(mFontFace, "only call TakeBuffer once on a given "
+                        "FontFaceBufferSource object");
   mFontFace->TakeBuffer(aBuffer, aLength);
+  mFontFace = nullptr;
 }
 
 // -- Utility functions ------------------------------------------------------
 
 template<typename T>
 static void
 GetDataFrom(const T& aObject, uint8_t*& aBuffer, uint32_t& aLength)
 {
--- a/layout/style/crashtests/crashtests.list
+++ b/layout/style/crashtests/crashtests.list
@@ -109,10 +109,11 @@ load 992333-1.html
 pref(dom.webcomponents.enabled,true) load 1017798-1.html
 load 1028514-1.html
 load 1066089-1.html
 load 1074651-1.html
 pref(dom.webcomponents.enabled,true) load 1089463-1.html
 pref(layout.css.expensive-style-struct-assertions.enabled,true) load 1136010-1.html
 load 1153693-1.html
 load 1161366-1.html
+load 1163446-1.html
 load large_border_image_width.html
 load border-image-visited-link.html