Bug 1333974, part 2 - Use new API for images. r=tn draft
authorAndrew McCreight <continuation@gmail.com>
Tue, 31 Jan 2017 11:34:01 -0800
changeset 468640 4977d52237477fa3a3802c38e09274b602c34e85
parent 468639 7a910be6c072f6c711db0cd88f162299825141fc
child 544023 315300789277c0787c0f1b640991e9356b5e83bd
push id43544
push userbmo:continuation@gmail.com
push dateTue, 31 Jan 2017 22:45:39 +0000
reviewerstn
bugs1333974
milestone54.0a1
Bug 1333974, part 2 - Use new API for images. r=tn MozReview-Commit-ID: CmjVpXAFmjx
image/AnimationSurfaceProvider.cpp
image/DecodedSurfaceProvider.cpp
image/Decoder.cpp
--- 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