Bug 1106396 - Add some checks so that we can detect that a redirect has not been completed properly. r=mayhemer
authorDragana Damjanovic <dd.mozilla@gmail.com>
Tue, 20 Jan 2015 06:54:00 -0500
changeset 224818 d11387c52d672b79bba9560a60b8f6b6c00a47d8
parent 224817 147d4f71335e066d23dbdf954662c215a615acb4
child 224819 0fef95e82103e79ca31f325629ac5cc9d3643ff0
push id54354
push userryanvm@gmail.com
push dateWed, 21 Jan 2015 04:56:43 +0000
treeherdermozilla-inbound@d11387c52d67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs1106396
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 1106396 - Add some checks so that we can detect that a redirect has not been completed properly. r=mayhemer
netwerk/protocol/http/HttpChannelParentListener.cpp
--- a/netwerk/protocol/http/HttpChannelParentListener.cpp
+++ b/netwerk/protocol/http/HttpChannelParentListener.cpp
@@ -42,16 +42,19 @@ NS_IMPL_ISUPPORTS(HttpChannelParentListe
 
 //-----------------------------------------------------------------------------
 // HttpChannelParentListener::nsIRequestObserver
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 HttpChannelParentListener::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext)
 {
+  MOZ_RELEASE_ASSERT(mRedirectChannelId == 0,
+    "The redirect must be finished before OnStartRequest is called!");
+
   MOZ_RELEASE_ASSERT(!mSuspendedForDiversion,
     "Cannot call OnStartRequest if suspended for diversion!");
 
   if (!mNextListener)
     return NS_ERROR_UNEXPECTED;
 
   LOG(("HttpChannelParentListener::OnStartRequest [this=%p]\n", this));
   return mNextListener->OnStartRequest(aRequest, aContext);
@@ -82,16 +85,19 @@ HttpChannelParentListener::OnStopRequest
 
 NS_IMETHODIMP
 HttpChannelParentListener::OnDataAvailable(nsIRequest *aRequest,
                                             nsISupports *aContext,
                                             nsIInputStream *aInputStream,
                                             uint64_t aOffset,
                                             uint32_t aCount)
 {
+  MOZ_RELEASE_ASSERT(mRedirectChannelId == 0,
+    "The redirect must be finished before OnDataAvaialble is called!");
+
   MOZ_RELEASE_ASSERT(!mSuspendedForDiversion,
     "Cannot call OnDataAvailable if suspended for diversion!");
 
   if (!mNextListener)
     return NS_ERROR_UNEXPECTED;
 
   LOG(("HttpChannelParentListener::OnDataAvailable [this=%p]\n", this));
   return mNextListener->OnDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount);