Bug 1414762 - imgRequestProxy::CancelAndForgetObserver should always force load group removal to dispatch. r=tnikkel
authorAndrew Osmond <aosmond@mozilla.com>
Tue, 07 Nov 2017 06:42:47 -0500
changeset 390567 417a70344a98fcc4f0384b4d8388d89aafef4830
parent 390566 fb5b3dbdaf6799c8ba321f3993ed19049430676e
child 390568 36da5e7e5ad76569028c22e41ada077845da6295
push id32837
push userebalazs@mozilla.com
push dateTue, 07 Nov 2017 21:57:29 +0000
treeherdermozilla-central@40df5dd35fdb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1414762, 1404422
milestone58.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 1414762 - imgRequestProxy::CancelAndForgetObserver should always force load group removal to dispatch. r=tnikkel imgRequestProxy::CancelAndForgetObserver was intended to always dispatch any load group removals due to reentracy conflicts with the callers. However in bug 1404422 the fact that imgRequest::RemoveProxy can indirectly trigger a load group removal through completing an incompleted request.
image/imgRequestProxy.cpp
--- a/image/imgRequestProxy.cpp
+++ b/image/imgRequestProxy.cpp
@@ -510,22 +510,22 @@ imgRequestProxy::CancelAndForgetObserver
   // onStopRequest.
   if (mCanceled && !mListener) {
     return NS_ERROR_FAILURE;
   }
 
   LOG_SCOPE(gImgLog, "imgRequestProxy::CancelAndForgetObserver");
 
   mCanceled = true;
+  mForceDispatchLoadGroup = true;
 
   if (GetOwner()) {
     GetOwner()->RemoveProxy(this, aStatus);
   }
 
-  mForceDispatchLoadGroup = true;
   RemoveFromLoadGroup();
   mForceDispatchLoadGroup = false;
 
   NullOutListener();
 
   return NS_OK;
 }