Bug 1112112 - Adding logging for e10s channel. r=jduell
authorDragana Damjanovic <dd.mozilla@gmail.com>
Thu, 08 Jan 2015 06:27:00 +0100
changeset 248696 00fc776b6f556570feb942246093f8f2b6a6f1c7
parent 248695 8a01e921708c0c5811c6e4ecfdf04b39e84eab5e
child 248697 a13166f0d914a85a083e5e22fc057be76538f0d8
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjduell
bugs1112112
milestone37.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 1112112 - Adding logging for e10s channel. r=jduell
netwerk/protocol/ftp/FTPChannelChild.cpp
netwerk/protocol/http/HttpChannelChild.cpp
netwerk/protocol/http/HttpChannelParent.cpp
--- a/netwerk/protocol/ftp/FTPChannelChild.cpp
+++ b/netwerk/protocol/ftp/FTPChannelChild.cpp
@@ -311,16 +311,18 @@ FTPChannelChild::RecvOnStartRequest(cons
 {
   // mFlushedForDiversion and mDivertingToParent should NEVER be set at this
   // stage, as they are set in the listener's OnStartRequest.
   MOZ_RELEASE_ASSERT(!mFlushedForDiversion,
     "mFlushedForDiversion should be unset before OnStartRequest!");
   MOZ_RELEASE_ASSERT(!mDivertingToParent,
     "mDivertingToParent should be unset before OnStartRequest!");
 
+  LOG(("FTPChannelChild::RecvOnStartRequest [this=%p]\n", this));
+
   if (mEventQ->ShouldEnqueue()) {
     mEventQ->Enqueue(new FTPStartRequestEvent(this, aChannelStatus,
                                               aContentLength, aContentType,
                                               aLastModified, aEntityID, aURI));
   } else {
     DoOnStartRequest(aChannelStatus, aContentLength, aContentType,
                      aLastModified, aEntityID, aURI);
   }
@@ -330,17 +332,17 @@ FTPChannelChild::RecvOnStartRequest(cons
 void
 FTPChannelChild::DoOnStartRequest(const nsresult& aChannelStatus,
                                   const int64_t& aContentLength,
                                   const nsCString& aContentType,
                                   const PRTime& aLastModified,
                                   const nsCString& aEntityID,
                                   const URIParams& aURI)
 {
-  LOG(("FTPChannelChild::RecvOnStartRequest [this=%p]\n", this));
+  LOG(("FTPChannelChild::DoOnStartRequest [this=%p]\n", this));
 
   // mFlushedForDiversion and mDivertingToParent should NEVER be set at this
   // stage, as they are set in the listener's OnStartRequest.
   MOZ_RELEASE_ASSERT(!mFlushedForDiversion,
     "mFlushedForDiversion should be unset before OnStartRequest!");
   MOZ_RELEASE_ASSERT(!mDivertingToParent,
     "mDivertingToParent should be unset before OnStartRequest!");
 
@@ -404,16 +406,18 @@ bool
 FTPChannelChild::RecvOnDataAvailable(const nsresult& channelStatus,
                                      const nsCString& data,
                                      const uint64_t& offset,
                                      const uint32_t& count)
 {
   MOZ_RELEASE_ASSERT(!mFlushedForDiversion,
                      "Should not be receiving any more callbacks from parent!");
 
+  LOG(("FTPChannelChild::RecvOnDataAvailable [this=%p]\n", this));
+
   if (mEventQ->ShouldEnqueue()) {
     mEventQ->Enqueue(
       new FTPDataAvailableEvent(this, channelStatus, data, offset, count));
   } else {
     MOZ_RELEASE_ASSERT(!mDivertingToParent,
                        "ShouldEnqueue when diverting to parent!");
 
     DoOnDataAvailable(channelStatus, data, offset, count);
@@ -422,17 +426,17 @@ FTPChannelChild::RecvOnDataAvailable(con
 }
 
 void
 FTPChannelChild::DoOnDataAvailable(const nsresult& channelStatus,
                                    const nsCString& data,
                                    const uint64_t& offset,
                                    const uint32_t& count)
 {
-  LOG(("FTPChannelChild::RecvOnDataAvailable [this=%p]\n", this));
+  LOG(("FTPChannelChild::DoOnDataAvailable [this=%p]\n", this));
 
   if (!mCanceled && NS_SUCCEEDED(mStatus)) {
     mStatus = channelStatus;
   }
 
   if (mDivertingToParent) {
     MOZ_RELEASE_ASSERT(!mFlushedForDiversion,
       "Should not be processing any more callbacks from parent!");
@@ -487,28 +491,31 @@ private:
 };
 
 bool
 FTPChannelChild::RecvOnStopRequest(const nsresult& aChannelStatus)
 {
   MOZ_RELEASE_ASSERT(!mFlushedForDiversion,
     "Should not be receiving any more callbacks from parent!");
 
+  LOG(("FTPChannelChild::RecvOnStopRequest [this=%p status=%x]\n",
+       this, aChannelStatus));
+
   if (mEventQ->ShouldEnqueue()) {
     mEventQ->Enqueue(new FTPStopRequestEvent(this, aChannelStatus));
   } else {
     DoOnStopRequest(aChannelStatus);
   }
   return true;
 }
 
 void
 FTPChannelChild::DoOnStopRequest(const nsresult& aChannelStatus)
 {
-  LOG(("FTPChannelChild::RecvOnStopRequest [this=%p status=%u]\n",
+  LOG(("FTPChannelChild::DoOnStopRequest [this=%p status=%x]\n",
        this, aChannelStatus));
 
   if (mDivertingToParent) {
     MOZ_RELEASE_ASSERT(!mFlushedForDiversion,
       "Should not be processing any more callbacks from parent!");
 
     SendDivertOnStopRequest(aChannelStatus);
     return;
@@ -543,27 +550,31 @@ class FTPFailedAsyncOpenEvent : public C
  private:
   FTPChannelChild* mChild;
   nsresult mStatus;
 };
 
 bool
 FTPChannelChild::RecvFailedAsyncOpen(const nsresult& statusCode)
 {
+  LOG(("FTPChannelChild::RecvFailedAsyncOpen [this=%p status=%x]\n",
+       this, statusCode));
   if (mEventQ->ShouldEnqueue()) {
     mEventQ->Enqueue(new FTPFailedAsyncOpenEvent(this, statusCode));
   } else {
     DoFailedAsyncOpen(statusCode);
   }
   return true;
 }
 
 void
 FTPChannelChild::DoFailedAsyncOpen(const nsresult& statusCode)
 {
+  LOG(("FTPChannelChild::DoFailedAsyncOpen [this=%p status=%x]\n",
+       this, statusCode));
   mStatus = statusCode;
 
   if (mLoadGroup)
     mLoadGroup->RemoveRequest(this, nullptr, statusCode);
 
   if (mListener) {
     mListener->OnStartRequest(this, mListenerContext);
     mIsPending = false;
@@ -594,42 +605,45 @@ class FTPFlushedForDiversionEvent : publ
   }
  private:
   FTPChannelChild* mChild;
 };
 
 bool
 FTPChannelChild::RecvFlushedForDiversion()
 {
+  LOG(("FTPChannelChild::RecvFlushedForDiversion [this=%p]\n", this));
   MOZ_ASSERT(mDivertingToParent);
 
   if (mEventQ->ShouldEnqueue()) {
     mEventQ->Enqueue(new FTPFlushedForDiversionEvent(this));
   } else {
     MOZ_CRASH();
   }
   return true;
 }
 
 void
 FTPChannelChild::FlushedForDiversion()
 {
+  LOG(("FTPChannelChild::FlushedForDiversion [this=%p]\n", this));
   MOZ_RELEASE_ASSERT(mDivertingToParent);
 
   // Once this is set, it should not be unset before FTPChannelChild is taken
   // down. After it is set, no OnStart/OnData/OnStop callbacks should be
   // received from the parent channel, nor dequeued from the ChannelEventQueue.
   mFlushedForDiversion = true;
 
   SendDivertComplete();
 }
 
 bool
 FTPChannelChild::RecvDivertMessages()
 {
+  LOG(("FTPChannelChild::RecvDivertMessages [this=%p]\n", this));
   MOZ_RELEASE_ASSERT(mDivertingToParent);
   MOZ_RELEASE_ASSERT(mSuspendCount > 0);
 
   // DivertTo() has been called on parent, so we can now start sending queued
   // IPDL messages back to parent listener.
   if (NS_WARN_IF(NS_FAILED(Resume()))) {
     return false;
   }
@@ -662,31 +676,34 @@ FTPChannelChild::DoDeleteSelf()
 {
   if (mIPCOpen)
     Send__delete__(this);
 }
 
 NS_IMETHODIMP
 FTPChannelChild::Cancel(nsresult status)
 {
+  LOG(("FTPChannelChild::Cancel [this=%p]\n", this));
   if (mCanceled)
     return NS_OK;
 
   mCanceled = true;
   mStatus = status;
   if (mIPCOpen)
     SendCancel(status);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 FTPChannelChild::Suspend()
 {
   NS_ENSURE_TRUE(mIPCOpen, NS_ERROR_NOT_AVAILABLE);
 
+  LOG(("FTPChannelChild::Suspend [this=%p]\n", this));
+
   // SendSuspend only once, when suspend goes from 0 to 1.
   // Don't SendSuspend at all if we're diverting callbacks to the parent;
   // suspend will be called at the correct time in the parent itself.
   if (!mSuspendCount++ && !mDivertingToParent) {
     SendSuspend();
     mSuspendSent = true;
   }
   mEventQ->Suspend();
@@ -694,16 +711,18 @@ FTPChannelChild::Suspend()
   return NS_OK;
 }
 
 NS_IMETHODIMP
 FTPChannelChild::Resume()
 {
   NS_ENSURE_TRUE(mIPCOpen, NS_ERROR_NOT_AVAILABLE);
 
+  LOG(("FTPChannelChild::Resume [this=%p]\n", this));
+
   // SendResume only once, when suspend count drops to 0.
   // Don't SendResume at all if we're diverting callbacks to the parent (unless
   // suspend was sent earlier); otherwise, resume will be called at the correct
   // time in the parent itself.
   if (!--mSuspendCount && (!mDivertingToParent || mSuspendSent)) {
     SendResume();
   }
   mEventQ->Resume();
@@ -713,16 +732,18 @@ FTPChannelChild::Resume()
 
 //-----------------------------------------------------------------------------
 // FTPChannelChild::nsIChildChannel
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 FTPChannelChild::ConnectParent(uint32_t id)
 {
+  LOG(("FTPChannelChild::ConnectParent [this=%p]\n", this));
+
   mozilla::dom::TabChild* tabChild = nullptr;
   nsCOMPtr<nsITabChild> iTabChild;
   NS_QueryNotificationCallbacks(mCallbacks, mLoadGroup,
                                 NS_GET_IID(nsITabChild),
                                 getter_AddRefs(iTabChild));
   GetCallback(iTabChild);
   if (iTabChild) {
     tabChild = static_cast<mozilla::dom::TabChild*>(iTabChild.get());
@@ -772,16 +793,18 @@ FTPChannelChild::CompleteRedirectSetup(n
 //-----------------------------------------------------------------------------
 NS_IMETHODIMP
 FTPChannelChild::DivertToParent(ChannelDiverterChild **aChild)
 {
   MOZ_RELEASE_ASSERT(aChild);
   MOZ_RELEASE_ASSERT(gNeckoChild);
   MOZ_RELEASE_ASSERT(!mDivertingToParent);
 
+  LOG(("FTPChannelChild::DivertToParent [this=%p]\n", this));
+
   // We must fail DivertToParent() if there's no parent end of the channel (and
   // won't be!) due to early failure.
   if (NS_FAILED(mStatus) && !mIPCOpen) {
     return mStatus;
   }
 
   nsresult rv = Suspend();
   if (NS_WARN_IF(NS_FAILED(rv))) {
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -175,28 +175,30 @@ class AssociateApplicationCacheEvent : p
     nsCString groupID;
     nsCString clientID;
 };
 
 bool
 HttpChannelChild::RecvAssociateApplicationCache(const nsCString &groupID,
                                                 const nsCString &clientID)
 {
+  LOG(("HttpChannelChild::RecvAssociateApplicationCache [this=%p]\n", this));
   if (mEventQ->ShouldEnqueue()) {
     mEventQ->Enqueue(new AssociateApplicationCacheEvent(this, groupID, clientID));
   } else {
     AssociateApplicationCache(groupID, clientID);
   }
   return true;
 }
 
 void
 HttpChannelChild::AssociateApplicationCache(const nsCString &groupID,
                                             const nsCString &clientID)
 {
+  LOG(("HttpChannelChild::AssociateApplicationCache [this=%p]\n", this));
   nsresult rv;
   mApplicationCache = do_CreateInstance(NS_APPLICATIONCACHE_CONTRACTID, &rv);
   if (NS_FAILED(rv))
     return;
 
   mLoadedFromApplicationCache = true;
   mApplicationCache->InitAsHandle(groupID, clientID);
 }
@@ -227,16 +229,17 @@ class StartRequestEvent : public Channel
   , mCachedCharset(cachedCharset)
   , mSecurityInfoSerialization(securityInfoSerialization)
   , mSelfAddr(selfAddr)
   , mPeerAddr(peerAddr)
   {}
 
   void Run()
   {
+    LOG(("StartRequestEvent [this=%p]\n", mChild));
     mChild->OnStartRequest(mChannelStatus, mResponseHead, mUseResponseHead,
                            mRequestHeaders, mIsFromCache, mCacheEntryAvailable,
                            mCacheExpirationTime, mCachedCharset,
                            mSecurityInfoSerialization, mSelfAddr, mPeerAddr);
   }
  private:
   HttpChannelChild* mChild;
   nsresult mChannelStatus;
@@ -261,16 +264,17 @@ HttpChannelChild::RecvOnStartRequest(con
                                      const bool& cacheEntryAvailable,
                                      const uint32_t& cacheExpirationTime,
                                      const nsCString& cachedCharset,
                                      const nsCString& securityInfoSerialization,
                                      const NetAddr& selfAddr,
                                      const NetAddr& peerAddr,
                                      const int16_t& redirectCount)
 {
+  LOG(("HttpChannelChild::RecvOnStartRequest [this=%p]\n", this));
   // mFlushedForDiversion and mDivertingToParent should NEVER be set at this
   // stage, as they are set in the listener's OnStartRequest.
   MOZ_RELEASE_ASSERT(!mFlushedForDiversion,
     "mFlushedForDiversion should be unset before OnStartRequest!");
   MOZ_RELEASE_ASSERT(!mDivertingToParent,
     "mDivertingToParent should be unset before OnStartRequest!");
 
 
@@ -300,17 +304,17 @@ HttpChannelChild::OnStartRequest(const n
                                  const bool& isFromCache,
                                  const bool& cacheEntryAvailable,
                                  const uint32_t& cacheExpirationTime,
                                  const nsCString& cachedCharset,
                                  const nsCString& securityInfoSerialization,
                                  const NetAddr& selfAddr,
                                  const NetAddr& peerAddr)
 {
-  LOG(("HttpChannelChild::RecvOnStartRequest [this=%p]\n", this));
+  LOG(("HttpChannelChild::OnStartRequest [this=%p]\n", this));
 
   // mFlushedForDiversion and mDivertingToParent should NEVER be set at this
   // stage, as they are set in the listener's OnStartRequest.
   MOZ_RELEASE_ASSERT(!mFlushedForDiversion,
     "mFlushedForDiversion should be unset before OnStartRequest!");
   MOZ_RELEASE_ASSERT(!mDivertingToParent,
     "mDivertingToParent should be unset before OnStartRequest!");
 
@@ -347,16 +351,17 @@ HttpChannelChild::OnStartRequest(const n
 
   mSelfAddr = selfAddr;
   mPeerAddr = peerAddr;
 }
 
 void
 HttpChannelChild::DoOnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
 {
+  LOG(("HttpChannelChild::DoOnStartRequest [this=%p]\n", this));
   nsresult rv = mListener->OnStartRequest(aRequest, aContext);
   if (NS_FAILED(rv)) {
     Cancel(rv);
     return;
   }
 
   if (mResponseHead)
     SetCookie(mResponseHead->PeekHeader(nsHttp::Set_Cookie));
@@ -420,16 +425,17 @@ bool
 HttpChannelChild::RecvOnTransportAndData(const nsresult& channelStatus,
                                          const nsresult& transportStatus,
                                          const uint64_t& progress,
                                          const uint64_t& progressMax,
                                          const nsCString& data,
                                          const uint64_t& offset,
                                          const uint32_t& count)
 {
+  LOG(("HttpChannelChild::RecvOnTransportAndData [this=%p]\n", this));
   MOZ_RELEASE_ASSERT(!mFlushedForDiversion,
                      "Should not be receiving any more callbacks from parent!");
 
   if (mEventQ->ShouldEnqueue()) {
     mEventQ->Enqueue(new TransportAndDataEvent(this, channelStatus,
                                                transportStatus, progress,
                                                progressMax, data, offset,
                                                count));
@@ -494,16 +500,17 @@ HttpChannelChild::OnTransportAndData(con
 
   DoOnDataAvailable(this, mListenerContext, stringStream, offset, count);
   stringStream->Close();
 }
 
 void
 HttpChannelChild::DoOnStatus(nsIRequest* aRequest, nsresult status)
 {
+  LOG(("HttpChannelChild::DoOnStatus [this=%p]\n", this));
   if (mCanceled)
     return;
 
   // cache the progress sink so we don't have to query for it each time.
   if (!mProgressSink)
     GetCallback(mProgressSink);
 
   // block status/progress after Cancel or OnStopRequest has been called,
@@ -521,16 +528,17 @@ HttpChannelChild::DoOnStatus(nsIRequest*
     mProgressSink->OnStatus(aRequest, nullptr, status,
                             NS_ConvertUTF8toUTF16(host).get());
   }
 }
 
 void
 HttpChannelChild::DoOnProgress(nsIRequest* aRequest, uint64_t progress, uint64_t progressMax)
 {
+  LOG(("HttpChannelChild::DoOnProgress [this=%p]\n", this));
   if (mCanceled)
     return;
 
   // cache the progress sink so we don't have to query for it each time.
   if (!mProgressSink)
     GetCallback(mProgressSink);
 
   // block status/progress after Cancel or OnStopRequest has been called,
@@ -547,16 +555,17 @@ HttpChannelChild::DoOnProgress(nsIReques
   }
 }
 
 void
 HttpChannelChild::DoOnDataAvailable(nsIRequest* aRequest, nsISupports* aContext,
                                     nsIInputStream* aStream,
                                     uint64_t offset, uint32_t count)
 {
+  LOG(("HttpChannelChild::DoOnDataAvailable [this=%p]\n", this));
   if (mCanceled)
     return;
 
   nsresult rv = mListener->OnDataAvailable(aRequest, aContext, aStream, offset, count);
   if (NS_FAILED(rv)) {
     Cancel(rv);
   }
 }
@@ -577,16 +586,17 @@ class StopRequestEvent : public ChannelE
   nsresult mChannelStatus;
   ResourceTimingStruct mTiming;
 };
 
 bool
 HttpChannelChild::RecvOnStopRequest(const nsresult& channelStatus,
                                     const ResourceTimingStruct& timing)
 {
+  LOG(("HttpChannelChild::RecvOnStopRequest [this=%p]\n", this));
   MOZ_RELEASE_ASSERT(!mFlushedForDiversion,
     "Should not be receiving any more callbacks from parent!");
 
   if (mEventQ->ShouldEnqueue()) {
     mEventQ->Enqueue(new StopRequestEvent(this, channelStatus, timing));
   } else {
     MOZ_ASSERT(!mDivertingToParent, "ShouldEnqueue when diverting to parent!");
 
@@ -645,26 +655,29 @@ HttpChannelChild::OnStopRequest(const ns
     // holds the last reference.  Don't rely on |this| existing after here.
     PHttpChannelChild::Send__delete__(this);
   }
 }
 
 void
 HttpChannelChild::DoPreOnStopRequest(nsresult aStatus)
 {
+  LOG(("HttpChannelChild::DoPreOnStopRequest [this=%p status=%x]\n",
+       this, aStatus));
   mIsPending = false;
 
   if (!mCanceled && NS_SUCCEEDED(mStatus)) {
     mStatus = aStatus;
   }
 }
 
 void
 HttpChannelChild::DoOnStopRequest(nsIRequest* aRequest, nsISupports* aContext)
 {
+  LOG(("HttpChannelChild::DoOnStopRequest [this=%p]\n", this));
   MOZ_ASSERT(!mIsPending);
 
   if (mStatus == NS_ERROR_TRACKING_URI) {
     nsChannelClassifier::SetBlockedTrackingContent(this);
   }
 
   mListener->OnStopRequest(aRequest, aContext, mStatus);
 
@@ -792,16 +805,17 @@ class FailedAsyncOpenEvent : public Chan
  private:
   HttpChannelChild* mChild;
   nsresult mStatus;
 };
 
 bool
 HttpChannelChild::RecvFailedAsyncOpen(const nsresult& status)
 {
+  LOG(("HttpChannelChild::RecvFailedAsyncOpen [this=%p]\n", this));
   if (mEventQ->ShouldEnqueue()) {
     mEventQ->Enqueue(new FailedAsyncOpenEvent(this, status));
   } else {
     FailedAsyncOpen(status);
   }
   return true;
 }
 
@@ -823,32 +837,34 @@ HttpChannelChild::FailedAsyncOpen(const 
 
   // We're already being called from IPDL, therefore already "async"
   HandleAsyncAbort();
 }
 
 void
 HttpChannelChild::DoNotifyListenerCleanup()
 {
+  LOG(("HttpChannelChild::DoNotifyListenerCleanup [this=%p]\n", this));
   if (mIPCOpen)
     PHttpChannelChild::Send__delete__(this);
 }
 
 class DeleteSelfEvent : public ChannelEvent
 {
  public:
   explicit DeleteSelfEvent(HttpChannelChild* child) : mChild(child) {}
   void Run() { mChild->DeleteSelf(); }
  private:
   HttpChannelChild* mChild;
 };
 
 bool
 HttpChannelChild::RecvDeleteSelf()
 {
+  LOG(("HttpChannelChild::RecvDeleteSelf [this=%p]\n", this));
   if (mEventQ->ShouldEnqueue()) {
     mEventQ->Enqueue(new DeleteSelfEvent(this));
   } else {
     DeleteSelf();
   }
   return true;
 }
 
@@ -886,33 +902,35 @@ class Redirect1Event : public ChannelEve
 };
 
 bool
 HttpChannelChild::RecvRedirect1Begin(const uint32_t& newChannelId,
                                      const URIParams& newUri,
                                      const uint32_t& redirectFlags,
                                      const nsHttpResponseHead& responseHead)
 {
+  LOG(("HttpChannelChild::RecvRedirect1Begin [this=%p]\n", this));
   if (mEventQ->ShouldEnqueue()) {
     mEventQ->Enqueue(new Redirect1Event(this, newChannelId, newUri,
                                        redirectFlags, responseHead));
   } else {
     Redirect1Begin(newChannelId, newUri, redirectFlags, responseHead);
   }
   return true;
 }
 
 void
 HttpChannelChild::Redirect1Begin(const uint32_t& newChannelId,
                                  const URIParams& newUri,
                                  const uint32_t& redirectFlags,
                                  const nsHttpResponseHead& responseHead)
 {
+  LOG(("HttpChannelChild::Redirect1Begin [this=%p]\n", this));
+
   nsresult rv;
-
   nsCOMPtr<nsIIOService> ioService;
   rv = gHttpHandler->GetIOService(getter_AddRefs(ioService));
   if (NS_FAILED(rv)) {
     // Veto redirect.  nsHttpChannel decides to cancel or continue.
     OnRedirectVerifyCallback(rv);
     return;
   }
 
@@ -963,16 +981,17 @@ class Redirect3Event : public ChannelEve
   void Run() { mChild->Redirect3Complete(); }
  private:
   HttpChannelChild* mChild;
 };
 
 bool
 HttpChannelChild::RecvRedirect3Complete()
 {
+  LOG(("HttpChannelChild::RecvRedirect3Complete [this=%p]\n", this));
   if (mEventQ->ShouldEnqueue()) {
     mEventQ->Enqueue(new Redirect3Event(this));
   } else {
     Redirect3Complete();
   }
   return true;
 }
 
@@ -991,16 +1010,17 @@ class HttpFlushedForDiversionEvent : pub
   }
  private:
   HttpChannelChild* mChild;
 };
 
 bool
 HttpChannelChild::RecvFlushedForDiversion()
 {
+  LOG(("HttpChannelChild::RecvFlushedForDiversion [this=%p]\n", this));
   MOZ_RELEASE_ASSERT(mDivertingToParent);
   MOZ_RELEASE_ASSERT(mEventQ->ShouldEnqueue());
 
   mEventQ->Enqueue(new HttpFlushedForDiversionEvent(this));
 
   return true;
 }
 
@@ -1009,42 +1029,45 @@ HttpChannelChild::RecvNotifyTrackingProt
 {
   nsChannelClassifier::NotifyTrackingProtectionDisabled(this);
   return true;
 }
 
 void
 HttpChannelChild::FlushedForDiversion()
 {
+  LOG(("HttpChannelChild::FlushedForDiversion [this=%p]\n", this));
   MOZ_RELEASE_ASSERT(mDivertingToParent);
 
   // Once this is set, it should not be unset before HttpChannelChild is taken
   // down. After it is set, no OnStart/OnData/OnStop callbacks should be
   // received from the parent channel, nor dequeued from the ChannelEventQueue.
   mFlushedForDiversion = true;
 
   SendDivertComplete();
 }
 
 bool
 HttpChannelChild::RecvDivertMessages()
 {
+  LOG(("HttpChannelChild::RecvDivertMessages [this=%p]\n", this));
   MOZ_RELEASE_ASSERT(mDivertingToParent);
   MOZ_RELEASE_ASSERT(mSuspendCount > 0);
 
   // DivertTo() has been called on parent, so we can now start sending queued
   // IPDL messages back to parent listener.
   MOZ_RELEASE_ASSERT(NS_SUCCEEDED(Resume()));
 
   return true;
 }
 
 void
 HttpChannelChild::Redirect3Complete()
 {
+  LOG(("HttpChannelChild::Redirect3Complete [this=%p]\n", this));
   nsresult rv = NS_OK;
 
   // Chrome channel has been AsyncOpen'd.  Reflect this in child.
   if (mRedirectChannelChild)
     rv = mRedirectChannelChild->CompleteRedirectSetup(mListener,
                                                       mListenerContext);
 
   // Redirecting to new channel: shut this down and init new channel
@@ -1060,16 +1083,17 @@ HttpChannelChild::Redirect3Complete()
 
 //-----------------------------------------------------------------------------
 // HttpChannelChild::nsIChildChannel
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 HttpChannelChild::ConnectParent(uint32_t id)
 {
+  LOG(("HttpChannelChild::ConnectParent [this=%p]\n", this));
   mozilla::dom::TabChild* tabChild = nullptr;
   nsCOMPtr<nsITabChild> iTabChild;
   GetCallback(iTabChild);
   if (iTabChild) {
     tabChild = static_cast<mozilla::dom::TabChild*>(iTabChild.get());
   }
   if (MissingRequiredTabChild(tabChild, "http")) {
     return NS_ERROR_ILLEGAL_VALUE;
@@ -1125,16 +1149,17 @@ HttpChannelChild::CompleteRedirectSetup(
 
 //-----------------------------------------------------------------------------
 // HttpChannelChild::nsIAsyncVerifyRedirectCallback
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 HttpChannelChild::OnRedirectVerifyCallback(nsresult result)
 {
+  LOG(("HttpChannelChild::OnRedirectVerifyCallback [this=%p]\n", this));
   OptionalURIParams redirectURI;
   nsCOMPtr<nsIHttpChannel> newHttpChannel =
       do_QueryInterface(mRedirectChannelChild);
 
   if (newHttpChannel) {
     // Must not be called until after redirect observers called.
     newHttpChannel->SetOriginalURI(mOriginalURI);
   }
@@ -1183,33 +1208,37 @@ HttpChannelChild::OnRedirectVerifyCallba
 
 //-----------------------------------------------------------------------------
 // HttpChannelChild::nsIRequest
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 HttpChannelChild::Cancel(nsresult status)
 {
+  LOG(("HttpChannelChild::Cancel [this=%p]\n", this));
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!mCanceled) {
     // If this cancel occurs before nsHttpChannel has been set up, AsyncOpen
     // is responsible for cleaning up.
     mCanceled = true;
     mStatus = status;
     if (RemoteChannelExists())
       SendCancel(status);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpChannelChild::Suspend()
 {
-  NS_ENSURE_TRUE(RemoteChannelExists() || mInterceptListener, NS_ERROR_NOT_AVAILABLE);
+  LOG(("HttpChannelChild::Suspend [this=%p, mSuspendCount=%lu, "
+       "mDivertingToParent=%d]\n", this, mSuspendCount+1, mDivertingToParent));
+  NS_ENSURE_TRUE(RemoteChannelExists() || mInterceptListener,
+                 NS_ERROR_NOT_AVAILABLE);
 
   // SendSuspend only once, when suspend goes from 0 to 1.
   // Don't SendSuspend at all if we're diverting callbacks to the parent;
   // suspend will be called at the correct time in the parent itself.
   if (!mSuspendCount++ && !mDivertingToParent) {
     if (RemoteChannelExists()) {
       SendSuspend();
       mSuspendSent = true;
@@ -1221,17 +1250,20 @@ HttpChannelChild::Suspend()
   mEventQ->Suspend();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpChannelChild::Resume()
 {
-  NS_ENSURE_TRUE(RemoteChannelExists() || mInterceptListener, NS_ERROR_NOT_AVAILABLE);
+  LOG(("HttpChannelChild::Resume [this=%p, mSuspendCount=%lu, "
+       "mDivertingToParent=%d]\n", this, mSuspendCount-1, mDivertingToParent));
+  NS_ENSURE_TRUE(RemoteChannelExists() || mInterceptListener,
+                 NS_ERROR_NOT_AVAILABLE);
   NS_ENSURE_TRUE(mSuspendCount > 0, NS_ERROR_UNEXPECTED);
 
   nsresult rv = NS_OK;
 
   // SendResume only once, when suspend count drops to 0.
   // Don't SendResume at all if we're diverting callbacks to the parent (unless
   // suspend was sent earlier); otherwise, resume will be called at the correct
   // time in the parent itself.
@@ -1584,16 +1616,17 @@ HttpChannelChild::ContinueAsyncOpen()
 // HttpChannelChild::nsIHttpChannel
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 HttpChannelChild::SetRequestHeader(const nsACString& aHeader,
                                    const nsACString& aValue,
                                    bool aMerge)
 {
+  LOG(("HttpChannelChild::SetRequestHeader [this=%p]\n", this));
   nsresult rv = HttpBaseChannel::SetRequestHeader(aHeader, aValue, aMerge);
   if (NS_FAILED(rv))
     return rv;
 
   RequestHeaderTuple* tuple = mClientSetRequestHeaders.AppendElement();
   if (!tuple)
     return NS_ERROR_OUT_OF_MEMORY;
 
@@ -1699,16 +1732,17 @@ HttpChannelChild::IsFromCache(bool *valu
 
 //-----------------------------------------------------------------------------
 // HttpChannelChild::nsIResumableChannel
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 HttpChannelChild::ResumeAt(uint64_t startPos, const nsACString& entityID)
 {
+  LOG(("HttpChannelChild::ResumeAt [this=%p]\n", this));
   ENSURE_CALLED_BEFORE_CONNECT();
   mStartPos = startPos;
   mEntityID = entityID;
   mSendResumeAt = true;
   return NS_OK;
 }
 
 // GetEntityID is shared in HttpBaseChannel
@@ -1956,16 +1990,17 @@ NS_IMETHODIMP HttpChannelChild::GetClien
 }
 
 //-----------------------------------------------------------------------------
 // HttpChannelChild::nsIDivertableChannel
 //-----------------------------------------------------------------------------
 NS_IMETHODIMP
 HttpChannelChild::DivertToParent(ChannelDiverterChild **aChild)
 {
+  LOG(("HttpChannelChild::DivertToParent [this=%p]\n", this));
   MOZ_RELEASE_ASSERT(aChild);
   MOZ_RELEASE_ASSERT(gNeckoChild);
   MOZ_RELEASE_ASSERT(!mDivertingToParent);
 
   // We must fail DivertToParent() if there's no parent end of the channel (and
   // won't be!) due to early failure.
   if (NS_FAILED(mStatus) && !RemoteChannelExists()) {
     return mStatus;
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -52,16 +52,18 @@ HttpChannelParent::HttpChannelParent(con
   , mPBOverride(aOverrideStatus)
   , mLoadContext(aLoadContext)
   , mStatus(NS_OK)
   , mDivertingFromChild(false)
   , mDivertedOnStartRequest(false)
   , mSuspendedForDiversion(false)
   , mNestedFrameId(0)
 {
+  LOG(("Creating HttpChannelParent [this=%p]\n", this));
+
   // Ensure gHttpHandler is initialized: we need the atom table up and running.
   nsCOMPtr<nsIHttpProtocolHandler> dummyInitializer =
     do_GetService(NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "http");
 
   MOZ_ASSERT(gHttpHandler);
   mHttpHandler = gHttpHandler;
 
   if (iframeEmbedding.type() == PBrowserOrId::TPBrowserParent) {
@@ -70,16 +72,17 @@ HttpChannelParent::HttpChannelParent(con
     mNestedFrameId = iframeEmbedding.get_TabId();
   }
 
   mObserver = new OfflineObserver(this);
 }
 
 HttpChannelParent::~HttpChannelParent()
 {
+  LOG(("Destroying HttpChannelParent [this=%p]\n", this));
   if (mObserver) {
     mObserver->RemoveObserver();
   }
 }
 
 void
 HttpChannelParent::ActorDestroy(ActorDestroyReason why)
 {
@@ -87,16 +90,17 @@ HttpChannelParent::ActorDestroy(ActorDes
   // yet, but child process has crashed.  We must not try to send any more msgs
   // to child, or IPDL will kill chrome process, too.
   mIPCClosed = true;
 }
 
 bool
 HttpChannelParent::Init(const HttpChannelCreationArgs& aArgs)
 {
+  LOG(("HttpChannelParent::Init [this=%p]\n", this));
   switch (aArgs.type()) {
   case HttpChannelCreationArgs::THttpChannelOpenArgs:
   {
     const HttpChannelOpenArgs& a = aArgs.get_HttpChannelOpenArgs();
     return DoAsyncOpen(a.uri(), a.original(), a.doc(), a.referrer(),
                        a.referrerPolicy(), a.apiRedirectTo(), a.topWindowURI(),
                        a.loadFlags(), a.requestHeaders(),
                        a.requestMethod(), a.uploadStream(),
@@ -376,17 +380,18 @@ HttpChannelParent::DoAsyncOpen(  const U
   return true;
 }
 
 bool
 HttpChannelParent::ConnectChannel(const uint32_t& channelId)
 {
   nsresult rv;
 
-  LOG(("Looking for a registered channel [this=%p, id=%d]", this, channelId));
+  LOG(("HttpChannelParent::ConnectChannel: Looking for a registered channel "
+       "[this=%p, id=%lu]\n", this, channelId));
   nsCOMPtr<nsIChannel> channel;
   rv = NS_LinkRedirectChannels(channelId, this, getter_AddRefs(channel));
   mChannel = static_cast<nsHttpChannel*>(channel.get());
   LOG(("  found channel %p, rv=%08x", mChannel.get(), rv));
 
   if (mPBOverride != kPBOverride_Unset) {
     // redirected-to channel may not support PB
     nsCOMPtr<nsIPrivateBrowsingChannel> pbChannel = do_QueryObject(mChannel);
@@ -412,16 +417,19 @@ HttpChannelParent::ConnectChannel(const 
   }
 
   return true;
 }
 
 bool
 HttpChannelParent::RecvSetPriority(const uint16_t& priority)
 {
+  LOG(("HttpChannelParent::RecvSetPriority [this=%p, priority=%u]\n",
+       this, priority));
+
   if (mChannel) {
     mChannel->SetPriority(priority);
   }
 
   nsCOMPtr<nsISupportsPriority> priorityRedirectChannel =
       do_QueryInterface(mRedirectChannel);
   if (priorityRedirectChannel)
     priorityRedirectChannel->SetPriority(priority);
@@ -436,34 +444,40 @@ HttpChannelParent::RecvSetClassOfService
     mChannel->SetClassFlags(cos);
   }
   return true;
 }
 
 bool
 HttpChannelParent::RecvSuspend()
 {
+  LOG(("HttpChannelParent::RecvSuspend [this=%p]\n", this));
+
   if (mChannel) {
     mChannel->Suspend();
   }
   return true;
 }
 
 bool
 HttpChannelParent::RecvResume()
 {
+  LOG(("HttpChannelParent::RecvResume [this=%p]\n", this));
+
   if (mChannel) {
     mChannel->Resume();
   }
   return true;
 }
 
 bool
 HttpChannelParent::RecvCancel(const nsresult& status)
 {
+  LOG(("HttpChannelParent::RecvCancel [this=%p]\n", this));
+
   // May receive cancel before channel has been constructed!
   if (mChannel) {
     mChannel->Cancel(status);
   }
   return true;
 }
 
 
@@ -486,16 +500,18 @@ HttpChannelParent::RecvUpdateAssociatedC
   return true;
 }
 
 bool
 HttpChannelParent::RecvRedirect2Verify(const nsresult& result,
                                        const RequestHeaderTuples& changedHeaders,
                                        const OptionalURIParams&   aAPIRedirectURI)
 {
+  LOG(("HttpChannelParent::RecvRedirect2Verify [this=%p result=%x]\n",
+       this, result));
   if (NS_SUCCEEDED(result)) {
     nsCOMPtr<nsIHttpChannel> newHttpChannel =
         do_QueryInterface(mRedirectChannel);
 
     if (newHttpChannel) {
       nsCOMPtr<nsIURI> apiRedirectUri = DeserializeURI(aAPIRedirectURI);
 
       if (apiRedirectUri)
@@ -524,16 +540,19 @@ HttpChannelParent::RecvRedirect2Verify(c
 
     NS_ERROR("Unexpcted call to HttpChannelParent::RecvRedirect2Verify, "
              "mRedirectCallback null");
   }
 
   mReceivedRedirect2Verify = true;
 
   if (mRedirectCallback) {
+    LOG(("HttpChannelParent::RecvRedirect2Verify call OnRedirectVerifyCallback"
+         " [this=%p result=%x, mRedirectCallback=%p]\n",
+         this, result, mRedirectCallback.get()));
     mRedirectCallback->OnRedirectVerifyCallback(result);
     mRedirectCallback = nullptr;
   }
 
   return true;
 }
 
 bool
@@ -556,16 +575,18 @@ HttpChannelParent::RecvMarkOfflineCacheE
   return true;
 }
 
 bool
 HttpChannelParent::RecvDivertOnDataAvailable(const nsCString& data,
                                              const uint64_t& offset,
                                              const uint32_t& count)
 {
+  LOG(("HttpChannelParent::RecvDivertOnDataAvailable [this=%p]\n", this));
+
   MOZ_ASSERT(mParentListener);
   if (NS_WARN_IF(!mDivertingFromChild)) {
     MOZ_ASSERT(mDivertingFromChild,
                "Cannot RecvDivertOnDataAvailable if diverting is not set!");
     FailDiversion(NS_ERROR_UNEXPECTED);
     return false;
   }
 
@@ -596,16 +617,18 @@ HttpChannelParent::RecvDivertOnDataAvail
     return true;
   }
   return true;
 }
 
 bool
 HttpChannelParent::RecvDivertOnStopRequest(const nsresult& statusCode)
 {
+  LOG(("HttpChannelParent::RecvDivertOnStopRequest [this=%p]\n", this));
+
   MOZ_ASSERT(mParentListener);
   if (NS_WARN_IF(!mDivertingFromChild)) {
     MOZ_ASSERT(mDivertingFromChild,
                "Cannot RecvDivertOnStopRequest if diverting is not set!");
     FailDiversion(NS_ERROR_UNEXPECTED);
     return false;
   }
 
@@ -619,16 +642,18 @@ HttpChannelParent::RecvDivertOnStopReque
 
   mParentListener->OnStopRequest(mChannel, nullptr, status);
   return true;
 }
 
 bool
 HttpChannelParent::RecvDivertComplete()
 {
+  LOG(("HttpChannelParent::RecvDivertComplete [this=%p]\n", this));
+
   MOZ_ASSERT(mParentListener);
   if (NS_WARN_IF(!mDivertingFromChild)) {
     MOZ_ASSERT(mDivertingFromChild,
                "Cannot RecvDivertComplete if diverting is not set!");
     FailDiversion(NS_ERROR_UNEXPECTED);
     return false;
   }
 
@@ -644,17 +669,18 @@ HttpChannelParent::RecvDivertComplete()
 
 //-----------------------------------------------------------------------------
 // HttpChannelParent::nsIRequestObserver
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 HttpChannelParent::OnStartRequest(nsIRequest *aRequest, nsISupports *aContext)
 {
-  LOG(("HttpChannelParent::OnStartRequest [this=%p]\n", this));
+  LOG(("HttpChannelParent::OnStartRequest [this=%p, aRequest=%p]\n",
+       this, aRequest));
 
   MOZ_RELEASE_ASSERT(!mDivertingFromChild,
     "Cannot call OnStartRequest if diverting is set!");
 
   nsHttpChannel *chan = static_cast<nsHttpChannel *>(aRequest);
   nsHttpResponseHead *responseHead = chan->GetResponseHead();
   nsHttpRequestHead  *requestHead = chan->GetRequestHead();
   bool isFromCache = false;
@@ -722,18 +748,18 @@ HttpChannelParent::OnStartRequest(nsIReq
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpChannelParent::OnStopRequest(nsIRequest *aRequest,
                                  nsISupports *aContext,
                                  nsresult aStatusCode)
 {
-  LOG(("HttpChannelParent::OnStopRequest: [this=%p status=%x]\n",
-       this, aStatusCode));
+  LOG(("HttpChannelParent::OnStopRequest: [this=%p aRequest=%p status=%x]\n",
+       this, aRequest, aStatusCode));
 
   MOZ_RELEASE_ASSERT(!mDivertingFromChild,
     "Cannot call OnStopRequest if diverting is set!");
   ResourceTimingStruct timing;
   mChannel->GetDomainLookupStart(&timing.domainLookupStart);
   mChannel->GetDomainLookupEnd(&timing.domainLookupEnd);
   mChannel->GetConnectStart(&timing.connectStart);
   mChannel->GetConnectEnd(&timing.connectEnd);
@@ -755,17 +781,18 @@ HttpChannelParent::OnStopRequest(nsIRequ
 
 NS_IMETHODIMP
 HttpChannelParent::OnDataAvailable(nsIRequest *aRequest,
                                    nsISupports *aContext,
                                    nsIInputStream *aInputStream,
                                    uint64_t aOffset,
                                    uint32_t aCount)
 {
-  LOG(("HttpChannelParent::OnDataAvailable [this=%p]\n", this));
+  LOG(("HttpChannelParent::OnDataAvailable [this=%p aRequest=%p]\n",
+       this, aRequest));
 
   MOZ_RELEASE_ASSERT(!mDivertingFromChild,
     "Cannot call OnDataAvailable if diverting is set!");
 
   nsCString data;
   nsresult rv = NS_ReadInputStreamToString(aInputStream, data, aCount);
   if (NS_FAILED(rv))
     return rv;
@@ -834,16 +861,18 @@ HttpChannelParent::OnStatus(nsIRequest *
 
 //-----------------------------------------------------------------------------
 // HttpChannelParent::nsIParentChannel
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 HttpChannelParent::SetParentListener(HttpChannelParentListener* aListener)
 {
+  LOG(("HttpChannelParent::SetParentListener [this=%p aListener=%p]\n",
+       this, aListener));
   MOZ_ASSERT(aListener);
   MOZ_ASSERT(!mParentListener, "SetParentListener should only be called for "
                                "new HttpChannelParents after a redirect, when "
                                "mParentListener is null.");
   mParentListener = aListener;
   return NS_OK;
 }
 
@@ -869,16 +898,20 @@ HttpChannelParent::Delete()
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 HttpChannelParent::StartRedirect(uint32_t newChannelId,
                                  nsIChannel* newChannel,
                                  uint32_t redirectFlags,
                                  nsIAsyncVerifyRedirectCallback* callback)
 {
+  LOG(("HttpChannelParent::StartRedirect [this=%p, newChannelId=%lu "
+       "newChannel=%p callback=%p]\n", this, newChannelId, newChannel,
+       callback));
+
   if (mIPCClosed)
     return NS_BINDING_ABORTED;
 
   nsCOMPtr<nsIURI> newURI;
   newChannel->GetURI(getter_AddRefs(newURI));
 
   URIParams uriParams;
   SerializeURI(newURI, uriParams);
@@ -901,31 +934,35 @@ HttpChannelParent::StartRedirect(uint32_
   mRedirectChannel = newChannel;
   mRedirectCallback = callback;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 HttpChannelParent::CompleteRedirect(bool succeeded)
 {
+  LOG(("HttpChannelParent::CompleteRedirect [this=%p succeeded=%d]\n",
+       this, succeeded));
+
   if (succeeded && !mIPCClosed) {
     // TODO: check return value: assume child dead if failed
     unused << SendRedirect3Complete();
   }
 
   mRedirectChannel = nullptr;
   return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // HttpChannelParent::ADivertableParentChannel
 //-----------------------------------------------------------------------------
 nsresult
 HttpChannelParent::SuspendForDiversion()
 {
+  LOG(("HttpChannelParent::SuspendForDiversion [this=%p]\n", this));
   MOZ_ASSERT(mChannel);
   MOZ_ASSERT(mParentListener);
   if (NS_WARN_IF(mDivertingFromChild)) {
     MOZ_ASSERT(!mDivertingFromChild, "Already suspended for diversion!");
     return NS_ERROR_UNEXPECTED;
   }
 
   // Try suspending the channel. Allow it to fail, since OnStopRequest may have
@@ -943,16 +980,17 @@ HttpChannelParent::SuspendForDiversion()
 
   return NS_OK;
 }
 
 /* private, supporting function for ADivertableParentChannel */
 nsresult
 HttpChannelParent::ResumeForDiversion()
 {
+  LOG(("HttpChannelParent::ResumeForDiversion [this=%p]\n", this));
   MOZ_ASSERT(mChannel);
   if (NS_WARN_IF(!mDivertingFromChild)) {
     MOZ_ASSERT(mDivertingFromChild,
                "Cannot ResumeForDiversion if not diverting!");
     return NS_ERROR_UNEXPECTED;
   }
 
   if (mSuspendedForDiversion) {
@@ -970,16 +1008,18 @@ HttpChannelParent::ResumeForDiversion()
     return NS_ERROR_UNEXPECTED;
   }
   return NS_OK;
 }
 
 void
 HttpChannelParent::DivertTo(nsIStreamListener *aListener)
 {
+  LOG(("HttpChannelParent::DivertTo [this=%p aListener=%p]\n",
+       this, aListener));
   MOZ_ASSERT(mParentListener);
   if (NS_WARN_IF(!mDivertingFromChild)) {
     MOZ_ASSERT(mDivertingFromChild,
                "Cannot DivertTo new listener if diverting is not set!");
     return;
   }
 
   mDivertListener = aListener;
@@ -989,16 +1029,17 @@ HttpChannelParent::DivertTo(nsIStreamLis
   NS_DispatchToCurrentThread(
     NS_NewRunnableMethod(this, &HttpChannelParent::StartDiversion));
   return;
 }
 
 void
 HttpChannelParent::StartDiversion()
 {
+  LOG(("HttpChannelParent::StartDiversion [this=%p]\n", this));
   if (NS_WARN_IF(!mDivertingFromChild)) {
     MOZ_ASSERT(mDivertingFromChild,
                "Cannot StartDiversion if diverting is not set!");
     return;
   }
 
   // Fake pending status in case OnStopRequest has already been called.
   if (mChannel) {
@@ -1080,16 +1121,18 @@ HttpChannelParent::FailDiversion(nsresul
   NS_DispatchToCurrentThread(
     new HTTPFailDiversionEvent(this, aErrorCode, aSkipResume));
 }
 
 void
 HttpChannelParent::NotifyDiversionFailed(nsresult aErrorCode,
                                          bool aSkipResume)
 {
+  LOG(("HttpChannelParent::NotifyDiversionFailed [this=%p aErrorCode=%x]\n",
+       this, aErrorCode));
   MOZ_RELEASE_ASSERT(NS_FAILED(aErrorCode));
   MOZ_RELEASE_ASSERT(mDivertingFromChild);
   MOZ_RELEASE_ASSERT(mParentListener);
   MOZ_RELEASE_ASSERT(mChannel);
 
   mChannel->Cancel(aErrorCode);
 
   mChannel->ForcePending(false);