Bug 1333974, part 2 - Use new API for images. r=tn
MozReview-Commit-ID: CmjVpXAFmjx
--- a/image/AnimationSurfaceProvider.cpp
+++ b/image/AnimationSurfaceProvider.cpp
@@ -45,17 +45,17 @@ AnimationSurfaceProvider::DropImageRefer
// RasterImage objects need to be destroyed on the main thread. We also need
// to destroy them asynchronously, because if our surface cache entry is
// destroyed and we were the only thing keeping |mImage| alive, RasterImage's
// destructor may call into the surface cache while whatever code caused us to
// get evicted is holding the surface cache lock, causing deadlock.
RefPtr<RasterImage> image = mImage;
mImage = nullptr;
- NS_ReleaseOnMainThread(image.forget(), /* aAlwaysProxy = */ true);
+ NS_ReleaseOnMainThreadSystemGroup(image.forget(), /* aAlwaysProxy = */ true);
}
DrawableFrameRef
AnimationSurfaceProvider::DrawableRef(size_t aFrame)
{
MutexAutoLock lock(mFramesMutex);
if (Availability().IsPlaceholder()) {
--- a/image/DecodedSurfaceProvider.cpp
+++ b/image/DecodedSurfaceProvider.cpp
@@ -44,17 +44,17 @@ DecodedSurfaceProvider::DropImageReferen
// RasterImage objects need to be destroyed on the main thread. We also need
// to destroy them asynchronously, because if our surface cache entry is
// destroyed and we were the only thing keeping |mImage| alive, RasterImage's
// destructor may call into the surface cache while whatever code caused us to
// get evicted is holding the surface cache lock, causing deadlock.
RefPtr<RasterImage> image = mImage;
mImage = nullptr;
- NS_ReleaseOnMainThread(image.forget(), /* aAlwaysProxy = */ true);
+ NS_ReleaseOnMainThreadSystemGroup(image.forget(), /* aAlwaysProxy = */ true);
}
DrawableFrameRef
DecodedSurfaceProvider::DrawableRef(size_t aFrame)
{
MOZ_ASSERT(aFrame == 0,
"Requesting an animation frame from a DecodedSurfaceProvider?");
--- a/image/Decoder.cpp
+++ b/image/Decoder.cpp
@@ -72,17 +72,17 @@ Decoder::~Decoder()
"Destroying Decoder without taking all its progress changes");
MOZ_ASSERT(mInvalidRect.IsEmpty() || !mImage,
"Destroying Decoder without taking all its invalidations");
mInitialized = false;
if (mImage && !NS_IsMainThread()) {
// Dispatch mImage to main thread to prevent it from being destructed by the
// decode thread.
- NS_ReleaseOnMainThread(mImage.forget());
+ NS_ReleaseOnMainThreadSystemGroup(mImage.forget());
}
}
/*
* Common implementation of the decoder interface.
*/
nsresult