Bug 1128219 - Re-check mListener while calling OnStopRequest after OnStartRequest in HttpBaseChannel::DoNotifyListener. r=michal
authorHonza Bambas <honzab.moz@firemni.cz>
Fri, 13 Feb 2015 07:56:00 -0500
changeset 229023 95666abd14471a5c41df765355a830e8ed1d6175
parent 229022 95f5dfa2292eafe53b732acf15c6508b11555155
child 229024 4a61c39218431767244c112f1dff0d62a589bfe6
push id55568
push userryanvm@gmail.com
push dateFri, 13 Feb 2015 19:04:24 +0000
treeherdermozilla-inbound@db8257416bff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal
bugs1128219
milestone38.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 1128219 - Re-check mListener while calling OnStopRequest after OnStartRequest in HttpBaseChannel::DoNotifyListener. r=michal
netwerk/protocol/http/HttpBaseChannel.cpp
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -2006,26 +2006,29 @@ HttpBaseChannel::ReleaseListeners()
   mListenerContext = nullptr;
   mCallbacks = nullptr;
   mProgressSink = nullptr;
 }
 
 void
 HttpBaseChannel::DoNotifyListener()
 {
+  if (mListener) {
+    mListener->OnStartRequest(this, mListenerContext);
+  }
+
   // Make sure mIsPending is set to false. At this moment we are done from
   // the point of view of our consumer and we have to report our self
   // as not-pending.
+  mIsPending = false;
+
   if (mListener) {
-    mListener->OnStartRequest(this, mListenerContext);
-    mIsPending = false;
     mListener->OnStopRequest(this, mListenerContext, mStatus);
-  } else {
-    mIsPending = false;
   }
+
   // We have to make sure to drop the references to listeners and callbacks
   // no longer  needed
   ReleaseListeners();
 
   DoNotifyListenerCleanup();
 }
 
 void