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 110776 0f2858ae977f5def0fd983b1abd7ca8705876d1b
parent 110775 3d48c911df8d7cda4de0bb189d08290cf19b053f
child 110777 fbf63fe2c1b0dc22f30c337ab3c78ee4e71435a7
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersmats
bugs776505
milestone19.0a1
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) {