Bug 776505. Assert that nsDeviceContext is created on the main thread only. r=mats
authorRobert O'Callahan <robert@ocallahan.org>
Wed, 17 Oct 2012 17:51:58 +1300
changeset 110641 0f2858ae977f5def0fd983b1abd7ca8705876d1b
parent 110640 3d48c911df8d7cda4de0bb189d08290cf19b053f
child 110642 fbf63fe2c1b0dc22f30c337ab3c78ee4e71435a7
push id16652
push userrocallahan@mozilla.com
push dateThu, 18 Oct 2012 09:06:39 +0000
treeherdermozilla-inbound@4033a060e7af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs776505
milestone19.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 776505. Assert that nsDeviceContext is created on the main thread only. r=mats
dom/bindings/BindingGen.py
gfx/src/nsDeviceContext.cpp
--- a/gfx/src/nsDeviceContext.cpp
+++ b/gfx/src/nsDeviceContext.cpp
@@ -221,16 +221,17 @@ nsFontCache::Flush()
 
 nsDeviceContext::nsDeviceContext()
     : mWidth(0), mHeight(0), mDepth(0),
       mAppUnitsPerDevPixel(-1), mAppUnitsPerDevNotScaledPixel(-1),
       mAppUnitsPerPhysicalInch(-1),
       mPixelScale(1.0f), mPrintingScale(1.0f),
       mFontCache(nullptr)
 {
+    MOZ_ASSERT(NS_IsMainThread(), "nsDeviceContext created off main thread");
 }
 
 // Note: we use a bare pointer for mFontCache so that nsFontCache
 // can be an incomplete type in nsDeviceContext.h.
 // Therefore we have to do all the refcounting by hand.
 nsDeviceContext::~nsDeviceContext()
 {
     if (mFontCache) {