Bug 832456: Declare nsRunnable subclass at file scope instead of inside of a function, to fix build warning about 'visibility' attribute being ignored. r=BenWa

This commit is contained in:
Daniel Holbert 2013-01-18 15:15:04 -08:00
parent ae20ff569a
commit 9f5f951033

View File

@ -15,24 +15,25 @@ gfxReusableSurfaceWrapper::gfxReusableSurfaceWrapper(gfxImageSurface* aSurface)
MOZ_COUNT_CTOR(gfxReusableSurfaceWrapper);
}
class DeleteImageOnMainThread : public nsRunnable {
public:
DeleteImageOnMainThread(gfxImageSurface *aImage)
: mImage(aImage)
{}
NS_IMETHOD Run()
{
return NS_OK;
}
private:
nsRefPtr<gfxImageSurface> mImage;
};
gfxReusableSurfaceWrapper::~gfxReusableSurfaceWrapper()
{
NS_ABORT_IF_FALSE(mReadCount == 0, "Should not be locked when released");
MOZ_COUNT_DTOR(gfxReusableSurfaceWrapper);
if (!NS_IsMainThread()) {
class DeleteImageOnMainThread : public nsRunnable {
public:
DeleteImageOnMainThread(gfxImageSurface *aImage)
: mImage(aImage)
{}
NS_IMETHOD Run()
{
return NS_OK;
}
private:
nsRefPtr<gfxImageSurface> mImage;
};
NS_DispatchToMainThread(new DeleteImageOnMainThread(mSurface));
}
}