Bug 1277582 - Check if TabChild is still available before calling SendPHttpChannelConstructor. r=billm
authorValentin Gosu <valentin.gosu@gmail.com>
Fri, 15 Jul 2016 03:32:20 +0300
changeset 330203 2c0a0814add06997075c3326e399466555ee7e3f
parent 330202 f5df71ccaebb6aa84edc8414b2b2e4d5e2903b69
child 330204 b1d95b24cade1b252b61cb2f6718724f343a68eb
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1277582
milestone50.0a1
Bug 1277582 - Check if TabChild is still available before calling SendPHttpChannelConstructor. r=billm MozReview-Commit-ID: 5XH3cYkbUd1
netwerk/protocol/http/HttpChannelChild.cpp
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -1442,17 +1442,17 @@ HttpChannelChild::ConnectParent(uint32_t
   GetCallback(iTabChild);
   if (iTabChild) {
     tabChild = static_cast<mozilla::dom::TabChild*>(iTabChild.get());
   }
   if (MissingRequiredTabChild(tabChild, "http")) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
-  if (tabChild && tabChild->IsDestroyed()) {
+  if (tabChild && !tabChild->IPCOpen()) {
     return NS_ERROR_FAILURE;
   }
 
   // The socket transport in the chrome process now holds a logical ref to us
   // until OnStopRequest, or we do a redirect, or we hit an IPDL error.
   AddIPDLReference();
 
   HttpChannelConnectArgs connectArgs(registrarId, mShouldParentIntercept);
@@ -1964,17 +1964,17 @@ HttpChannelChild::ContinueAsyncOpen()
   char rcid[NSID_LENGTH];
   mRequestContextID.ToProvidedString(rcid);
   openArgs.requestContextID().AssignASCII(rcid);
 
   char chid[NSID_LENGTH];
   mChannelId.ToProvidedString(chid);
   openArgs.channelId().AssignASCII(chid);
 
-  if (tabChild && tabChild->IsDestroyed()) {
+  if (tabChild && !tabChild->IPCOpen()) {
     return NS_ERROR_FAILURE;
   }
 
   // The socket transport in the chrome process now holds a logical ref to us
   // until OnStopRequest, or we do a redirect, or we hit an IPDL error.
   AddIPDLReference();
 
   PBrowserOrId browser = static_cast<ContentChild*>(gNeckoChild->Manager())