Backed out changeset ca1f19ad3de6 (bug 1341572) for causing test failures in test_altsvc.js
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Wed, 08 Mar 2017 16:29:50 +0100
changeset 346582 033f1a67064d17ddca757b5529502d42e718b08e
parent 346581 a0d5e6f181dade610f4fa0a1783eef57e13ba97e
child 346583 b3692a0e5a43648e25a6efa3df05e132f7cb38fa
push id31472
push userkwierso@gmail.com
push dateThu, 09 Mar 2017 01:08:10 +0000
treeherdermozilla-central@19289cc8bf6f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1341572
milestone55.0a1
backs outca1f19ad3de6431fb5c46bd5d341bfacf539b36f
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
Backed out changeset ca1f19ad3de6 (bug 1341572) for causing test failures in test_altsvc.js
netwerk/protocol/http/ConnectionDiagnostics.cpp
netwerk/protocol/http/NullHttpTransaction.cpp
netwerk/protocol/http/NullHttpTransaction.h
netwerk/protocol/http/nsHttpConnection.cpp
netwerk/protocol/http/nsHttpConnection.h
netwerk/protocol/http/nsHttpConnectionMgr.cpp
netwerk/protocol/http/nsHttpConnectionMgr.h
--- a/netwerk/protocol/http/ConnectionDiagnostics.cpp
+++ b/netwerk/protocol/http/ConnectionDiagnostics.cpp
@@ -199,20 +199,10 @@ nsHttpTransaction::PrintDiagnostics(nsCS
   nsAutoCString requestURI;
   mRequestHead->RequestURI(requestURI);
   log.AppendPrintf("     ::: uri = %s\n", requestURI.get());
   log.AppendPrintf("     caps = 0x%x\n", mCaps);
   log.AppendPrintf("     priority = %d\n", mPriority);
   log.AppendPrintf("     restart count = %u\n", mRestartCount);
 }
 
-void
-nsHttpConnectionMgr::PendingTransactionInfo::PrintDiagnostics(nsCString &log)
-{
-  log.AppendPrintf("     ::: Pending transaction\n");
-  mTransaction->PrintDiagnostics(log);
-  RefPtr<nsHalfOpenSocket> halfOpen = do_QueryReferent(mHalfOpen);
-  log.AppendPrintf("     Waiting for half open sock: %p or connection: %p\n",
-                   halfOpen.get(), mActiveConn.get());
-}
-
 } // namespace net
 } // namespace mozilla
--- a/netwerk/protocol/http/NullHttpTransaction.cpp
+++ b/netwerk/protocol/http/NullHttpTransaction.cpp
@@ -137,22 +137,16 @@ NullHttpTransaction::Claim()
   if (mClaimed) {
     return false;
   }
   mClaimed = true;
   return true;
 }
 
 void
-NullHttpTransaction::Unclaim()
-{
-  mClaimed = false;
-}
-
-void
 NullHttpTransaction::SetConnection(nsAHttpConnection *conn)
 {
   mConnection = conn;
 }
 
 nsAHttpConnection *
 NullHttpTransaction::Connection()
 {
--- a/netwerk/protocol/http/NullHttpTransaction.h
+++ b/netwerk/protocol/http/NullHttpTransaction.h
@@ -34,17 +34,16 @@ public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSAHTTPTRANSACTION
 
   NullHttpTransaction(nsHttpConnectionInfo *ci,
                       nsIInterfaceRequestor *callbacks,
                       uint32_t caps);
 
   MOZ_MUST_USE bool Claim();
-  void Unclaim();
 
   // Overload of nsAHttpTransaction methods
   bool IsNullTransaction() override final { return true; }
   NullHttpTransaction *QueryNullTransaction() override final { return this; }
   bool ResponseTimeoutEnabled() const override final {return true; }
   PRIntervalTime ResponseTimeout() override final
   {
     return PR_SecondsToInterval(15);
--- a/netwerk/protocol/http/nsHttpConnection.cpp
+++ b/netwerk/protocol/http/nsHttpConnection.cpp
@@ -2069,32 +2069,21 @@ nsHttpConnection::DisableTCPKeepalives()
     }
     return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // nsHttpConnection::nsISupports
 //-----------------------------------------------------------------------------
 
-NS_IMPL_ADDREF(nsHttpConnection)
-NS_IMPL_RELEASE(nsHttpConnection)
-
-NS_INTERFACE_MAP_BEGIN(nsHttpConnection)
-    NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
-    NS_INTERFACE_MAP_ENTRY(nsIInputStreamCallback)
-    NS_INTERFACE_MAP_ENTRY(nsIOutputStreamCallback)
-    NS_INTERFACE_MAP_ENTRY(nsITransportEventSink)
-    NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
-    // we have no macro that covers this case.
-    if (aIID.Equals(NS_GET_IID(nsHttpConnection)) ) {
-        AddRef();
-        *aInstancePtr = this;
-        return NS_OK;
-    } else
-NS_INTERFACE_MAP_END
+NS_IMPL_ISUPPORTS(nsHttpConnection,
+                  nsIInputStreamCallback,
+                  nsIOutputStreamCallback,
+                  nsITransportEventSink,
+                  nsIInterfaceRequestor)
 
 //-----------------------------------------------------------------------------
 // nsHttpConnection::nsIInputStreamCallback
 //-----------------------------------------------------------------------------
 
 // called on the socket transport thread
 NS_IMETHODIMP
 nsHttpConnection::OnInputStreamReady(nsIAsyncInputStream *in)
--- a/netwerk/protocol/http/nsHttpConnection.h
+++ b/netwerk/protocol/http/nsHttpConnection.h
@@ -26,41 +26,35 @@ class nsISocketTransport;
 class nsISSLSocketControl;
 
 namespace mozilla {
 namespace net {
 
 class nsHttpHandler;
 class ASpdySession;
 
-// 1dcc863e-db90-4652-a1fe-13fea0b54e46
-#define NS_HTTPCONNECTION_IID \
-{ 0x1dcc863e, 0xdb90, 0x4652, {0xa1, 0xfe, 0x13, 0xfe, 0xa0, 0xb5, 0x4e, 0x46 }}
-
 //-----------------------------------------------------------------------------
 // nsHttpConnection - represents a connection to a HTTP server (or proxy)
 //
 // NOTE: this objects lives on the socket thread only.  it should not be
 // accessed from any other thread.
 //-----------------------------------------------------------------------------
 
 class nsHttpConnection final : public nsAHttpSegmentReader
                              , public nsAHttpSegmentWriter
                              , public nsIInputStreamCallback
                              , public nsIOutputStreamCallback
                              , public nsITransportEventSink
                              , public nsIInterfaceRequestor
                              , public NudgeTunnelCallback
                              , public ARefBase
-                             , public nsSupportsWeakReference
 {
     virtual ~nsHttpConnection();
 
 public:
-    NS_DECLARE_STATIC_IID_ACCESSOR(NS_HTTPCONNECTION_IID)
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSAHTTPSEGMENTREADER
     NS_DECL_NSAHTTPSEGMENTWRITER
     NS_DECL_NSIINPUTSTREAMCALLBACK
     NS_DECL_NSIOUTPUTSTREAMCALLBACK
     NS_DECL_NSITRANSPORTEVENTSINK
     NS_DECL_NSIINTERFACEREQUESTOR
     NS_DECL_NUDGETUNNELCALLBACK
@@ -377,14 +371,12 @@ private:
                                                              // for the end of
                                                              // the handsake.
     int64_t                        mContentBytesWritten0RTT;
     bool                           mEarlyDataNegotiated; //Only used for telemetry
     nsCString                      mEarlyNegotiatedALPN;
     bool                           mDid0RTTSpdy;
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(nsHttpConnection, NS_HTTPCONNECTION_IID)
-
 } // namespace net
 } // namespace mozilla
 
 #endif // nsHttpConnection_h__
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -39,44 +39,41 @@
 
 namespace mozilla {
 namespace net {
 
 //-----------------------------------------------------------------------------
 
 NS_IMPL_ISUPPORTS(nsHttpConnectionMgr, nsIObserver)
 
-void
-nsHttpConnectionMgr::InsertTransactionSorted(nsTArray<RefPtr<nsHttpConnectionMgr::PendingTransactionInfo> > &pendingQ,
-                                             nsHttpConnectionMgr::PendingTransactionInfo *pendingTransInfo)
+static void
+InsertTransactionSorted(nsTArray<RefPtr<nsHttpTransaction> > &pendingQ, nsHttpTransaction *trans)
 {
     // insert into queue with smallest valued number first.  search in reverse
     // order under the assumption that many of the existing transactions will
     // have the same priority (usually 0).
 
-    nsHttpTransaction *trans = pendingTransInfo->mTransaction;
-
     for (int32_t i = pendingQ.Length() - 1; i >= 0; --i) {
-        nsHttpTransaction *t = pendingQ[i]->mTransaction;
+        nsHttpTransaction *t = pendingQ[i];
         if (trans->Priority() >= t->Priority()) {
             if (ChaosMode::isActive(ChaosFeature::NetworkScheduling)) {
                 int32_t samePriorityCount;
                 for (samePriorityCount = 0; i - samePriorityCount >= 0; ++samePriorityCount) {
-                    if (pendingQ[i - samePriorityCount]->mTransaction->Priority() != trans->Priority()) {
+                    if (pendingQ[i - samePriorityCount]->Priority() != trans->Priority()) {
                         break;
                     }
                 }
                 // skip over 0...all of the elements with the same priority.
                 i -= ChaosMode::randomUint32LessThan(samePriorityCount + 1);
             }
-            pendingQ.InsertElementAt(i+1, pendingTransInfo);
+            pendingQ.InsertElementAt(i+1, trans);
             return;
         }
     }
-    pendingQ.InsertElementAt(0, pendingTransInfo);
+    pendingQ.InsertElementAt(0, trans);
 }
 
 //-----------------------------------------------------------------------------
 
 nsHttpConnectionMgr::nsHttpConnectionMgr()
     : mReentrantMonitor("nsHttpConnectionMgr.mReentrantMonitor")
     , mMaxConns(0)
     , mMaxPersistConnsPerHost(0)
@@ -625,18 +622,17 @@ nsHttpConnectionMgr::LookupConnectionEnt
         // The connection could be either in preferred or ent. It is most
         // likely the only active connection in preferred - so start with that.
         if (preferred->mActiveConns.Contains(conn))
             return preferred;
         if (preferred->mIdleConns.Contains(conn))
             return preferred;
     }
 
-    if (trans &&
-        preferred->mPendingQ.Contains(trans, PendingComparator()))
+    if (trans && preferred->mPendingQ.Contains(trans))
         return preferred;
 
     // Neither conn nor trans found in preferred, use the default entry
     return ent;
 }
 
 nsresult
 nsHttpConnectionMgr::CloseIdleConnection(nsHttpConnection *conn)
@@ -880,87 +876,52 @@ nsHttpConnectionMgr::ProcessPendingQForE
 
     LOG(("nsHttpConnectionMgr::ProcessPendingQForEntry "
          "[ci=%s ent=%p active=%" PRIuSIZE " idle=%" PRIuSIZE " queued=%" PRIuSIZE "]\n",
          ent->mConnInfo->HashKey().get(), ent, ent->mActiveConns.Length(),
          ent->mIdleConns.Length(), ent->mPendingQ.Length()));
 
     ProcessSpdyPendingQ(ent);
 
-    PendingTransactionInfo *pendingTransInfo;
+    nsHttpTransaction *trans;
     nsresult rv;
     bool dispatchedSuccessfully = false;
 
     // if !considerAll iterate the pending list until one is dispatched successfully.
     // Keep iterating afterwards only until a transaction fails to dispatch.
     // if considerAll == true then try and dispatch all items.
     for (uint32_t i = 0; i < ent->mPendingQ.Length(); ) {
-        pendingTransInfo = ent->mPendingQ[i];
-        LOG(("nsHttpConnectionMgr::ProcessPendingQForEntry "
-             "[trans=%p, halfOpen=%p, activeConn=%p]\n",
-             pendingTransInfo->mTransaction.get(),
-             pendingTransInfo->mHalfOpen.get(),
-             pendingTransInfo->mActiveConn.get()));
+        trans = ent->mPendingQ[i];
 
         // When this transaction has already established a half-open
         // connection, we want to prevent any duplicate half-open
         // connections from being established and bound to this
         // transaction. Allow only use of an idle persistent connection
         // (if found) for transactions referred by a half-open connection.
-        bool alreadyHalfOpenOrWaitingForTLS = false;
-        if (pendingTransInfo->mHalfOpen) {
-            MOZ_ASSERT(!pendingTransInfo->mActiveConn);
-            RefPtr<nsHalfOpenSocket> halfOpen =
-                do_QueryReferent(pendingTransInfo->mHalfOpen);
-            if (halfOpen) {
-                // The half open socket was made for this transaction, in
-                // that case ent->mHalfOpens[j]->Transaction() == trans or
-                // the half open socket was opened speculatively and this
-                // transaction took it (in this case it must be:
-                // ent->mHalfOpens[j]->Transaction().IsNullTransaction())
-                MOZ_ASSERT(halfOpen->Transaction()->IsNullTransaction() ||
-                           halfOpen->Transaction() == pendingTransInfo->mTransaction);
-                alreadyHalfOpenOrWaitingForTLS = true;
-            } else {
-                // If we have not found the halfOpen socket, remove the pointer.
-                pendingTransInfo->mHalfOpen = nullptr;
-            }
-        }  else if (pendingTransInfo->mActiveConn) {
-            MOZ_ASSERT(!pendingTransInfo->mHalfOpen);
-            RefPtr<nsHttpConnection> activeConn =
-                do_QueryReferent(pendingTransInfo->mActiveConn);
-            // Check if this transaction claimed a connection that is still
-            // performing tls handshake with a NullHttpTransaction or it is between
-            // finishing tls and relaiming (When nullTrans finishes tls handshake,
-            // httpConnection does not have a transaction any more and a
-            // ReclaimConnection is dispatched).
-            if (activeConn &&
-                (!activeConn->Transaction() ||
-                 activeConn->Transaction()->IsNullTransaction())) {
-                alreadyHalfOpenOrWaitingForTLS = true;
-            } else {
-                // If we have not found the connection, remove the pointer.
-                pendingTransInfo->mActiveConn = nullptr;
+        bool alreadyHalfOpen = false;
+        for (int32_t j = 0; j < ((int32_t) ent->mHalfOpens.Length()); ++j) {
+            if (ent->mHalfOpens[j]->Transaction() == trans) {
+                alreadyHalfOpen = true;
+                break;
             }
         }
 
         rv = TryDispatchTransaction(ent,
-                                    alreadyHalfOpenOrWaitingForTLS || !!pendingTransInfo->mTransaction->TunnelProvider(),
-                                    pendingTransInfo);
+                                    alreadyHalfOpen || !!trans->TunnelProvider(),
+                                    trans);
         if (NS_SUCCEEDED(rv) || (rv != NS_ERROR_NOT_AVAILABLE)) {
             if (NS_SUCCEEDED(rv))
                 LOG(("  dispatching pending transaction...\n"));
             else
                 LOG(("  removing pending transaction based on "
                      "TryDispatchTransaction returning hard error %" PRIx32 "\n",
                      static_cast<uint32_t>(rv)));
 
-            ReleaseClaimedSockets(ent, pendingTransInfo);
-            if (ent->mPendingQ.RemoveElement(pendingTransInfo)) {
-                // pendingTransInfo is now potentially destroyed
+            if (ent->mPendingQ.RemoveElement(trans)) {
+                // trans is now potentially destroyed
                 dispatchedSuccessfully = true;
                 continue; // dont ++i as we just made the array shorter
             }
 
             LOG(("  transaction not found in pending queue\n"));
         }
 
         if (dispatchedSuccessfully && !considerAll)
@@ -1096,20 +1057,18 @@ nsHttpConnectionMgr::RestrictConnections
 }
 
 // returns NS_OK if a connection was started
 // return NS_ERROR_NOT_AVAILABLE if a new connection cannot be made due to
 //        ephemeral limits
 // returns other NS_ERROR on hard failure conditions
 nsresult
 nsHttpConnectionMgr::MakeNewConnection(nsConnectionEntry *ent,
-                                       PendingTransactionInfo *pendingTransInfo)
+                                       nsHttpTransaction *trans)
 {
-    nsHttpTransaction *trans = pendingTransInfo->mTransaction;
-
     LOG(("nsHttpConnectionMgr::MakeNewConnection %p ent=%p trans=%p",
          this, ent, trans));
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
 
     uint32_t halfOpenLength = ent->mHalfOpens.Length();
     for (uint32_t i = 0; i < halfOpenLength; i++) {
         if (ent->mHalfOpens[i]->IsSpeculative()) {
             // We've found a speculative connection in the half
@@ -1118,18 +1077,16 @@ nsHttpConnectionMgr::MakeNewConnection(n
             // (or another one in the pending queue) - we don't
             // need to open a new connection here.
             LOG(("nsHttpConnectionMgr::MakeNewConnection [ci = %s]\n"
                  "Found a speculative half open connection\n",
                  ent->mConnInfo->HashKey().get()));
 
             uint32_t flags;
             ent->mHalfOpens[i]->SetSpeculative(false);
-            pendingTransInfo->mHalfOpen =
-                do_GetWeakReference(static_cast<nsISupportsWeakReference*>(ent->mHalfOpens[i]));
             nsISocketTransport *transport = ent->mHalfOpens[i]->SocketTransport();
             if (transport && NS_SUCCEEDED(transport->GetConnectionFlags(&flags))) {
                 flags &= ~nsISocketTransport::DISABLE_RFC1918;
                 transport->SetConnectionFlags(flags);
             }
 
             Telemetry::AutoCounter<Telemetry::HTTPCONNMGR_USED_SPECULATIVE_CONN> usedSpeculativeConn;
             ++usedSpeculativeConn;
@@ -1151,18 +1108,16 @@ nsHttpConnectionMgr::MakeNewConnection(n
         uint32_t activeLength = ent->mActiveConns.Length();
         for (uint32_t i = 0; i < activeLength; i++) {
             nsAHttpTransaction *activeTrans = ent->mActiveConns[i]->Transaction();
             NullHttpTransaction *nullTrans = activeTrans ? activeTrans->QueryNullTransaction() : nullptr;
             if (nullTrans && nullTrans->Claim()) {
                 LOG(("nsHttpConnectionMgr::MakeNewConnection [ci = %s] "
                      "Claiming a null transaction for later use\n",
                      ent->mConnInfo->HashKey().get()));
-                pendingTransInfo->mActiveConn =
-                    do_GetWeakReference(static_cast<nsISupportsWeakReference*>(ent->mActiveConns[i]));
                 return NS_OK;
             }
         }
     }
 
     // If this host is trying to negotiate a SPDY session right now,
     // don't create any new connections until the result of the
     // negotiation is known.
@@ -1229,18 +1184,17 @@ nsHttpConnectionMgr::MakeNewConnection(n
         }
       outerLoopEnd:
         ;
     }
 
     if (AtActiveConnectionLimit(ent, trans->Caps()))
         return NS_ERROR_NOT_AVAILABLE;
 
-    nsresult rv = CreateTransport(ent, trans, trans->Caps(), false, false,
-                                  true, pendingTransInfo);
+    nsresult rv = CreateTransport(ent, trans, trans->Caps(), false, false, true);
     if (NS_FAILED(rv)) {
         /* hard failure */
         LOG(("nsHttpConnectionMgr::MakeNewConnection [ci = %s trans = %p] "
              "CreateTransport() hard failure.\n",
              ent->mConnInfo->HashKey().get(), trans));
         trans->Close(rv);
         if (rv == NS_ERROR_NOT_AVAILABLE)
             rv = NS_ERROR_FAILURE;
@@ -1254,28 +1208,23 @@ nsHttpConnectionMgr::MakeNewConnection(n
 //   and the transaction is started.
 // returns ERROR_NOT_AVAILABLE if no connection can be found and it
 //   should be queued until circumstances change
 // returns other ERROR when transaction has a hard failure and should
 //   not remain in the pending queue
 nsresult
 nsHttpConnectionMgr::TryDispatchTransaction(nsConnectionEntry *ent,
                                             bool onlyReusedConnection,
-                                            PendingTransactionInfo *pendingTransInfo)
+                                            nsHttpTransaction *trans)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
-
-    nsHttpTransaction *trans = pendingTransInfo->mTransaction;
-
     LOG(("nsHttpConnectionMgr::TryDispatchTransaction without conn "
-         "[trans=%p halfOpen=%p conn=%p ci=%p ci=%s caps=%x tunnelprovider=%p "
-         "onlyreused=%d active=%" PRIuSIZE " idle=%" PRIuSIZE "]\n", trans,
-         pendingTransInfo->mHalfOpen.get(),
-         pendingTransInfo->mActiveConn.get(), ent->mConnInfo.get(),
-         ent->mConnInfo->HashKey().get(),
+         "[trans=%p ci=%p ci=%s caps=%x tunnelprovider=%p onlyreused=%d "
+         "active=%" PRIuSIZE " idle=%" PRIuSIZE "]\n", trans,
+         ent->mConnInfo.get(), ent->mConnInfo->HashKey().get(),
          uint32_t(trans->Caps()), trans->TunnelProvider(),
          onlyReusedConnection, ent->mActiveConns.Length(),
          ent->mIdleConns.Length()));
 
     uint32_t caps = trans->Caps();
 
     // 0 - If this should use spdy then dispatch it post haste.
     // 1 - If there is connection pressure then see if we can pipeline this on
@@ -1401,17 +1350,17 @@ nsHttpConnectionMgr::TryDispatchTransact
     }
 
     // step 3
     // consider pipelining scripts and revalidations
     // h1 pipelining has been removed
 
     // step 4
     if (!onlyReusedConnection) {
-        nsresult rv = MakeNewConnection(ent, pendingTransInfo);
+        nsresult rv = MakeNewConnection(ent, trans);
         if (NS_SUCCEEDED(rv)) {
             // this function returns NOT_AVAILABLE for asynchronous connects
             LOG(("   dispatched step 4 (async new conn) trans=%p\n", trans));
             return NS_ERROR_NOT_AVAILABLE;
         }
 
         if (rv != NS_ERROR_NOT_AVAILABLE) {
             // not available return codes should try next step as they are
@@ -1630,17 +1579,16 @@ nsHttpConnectionMgr::ProcessNewTransacti
     ReportProxyTelemetry(ent);
 
     // Check if the transaction already has a sticky reference to a connection.
     // If so, then we can just use it directly by transferring its reference
     // to the new connection variable instead of searching for a new one
 
     nsAHttpConnection *wrappedConnection = trans->Connection();
     RefPtr<nsHttpConnection> conn;
-    RefPtr<PendingTransactionInfo> pendingTransInfo;
     if (wrappedConnection)
         conn = wrappedConnection->TakeHttpConnection();
 
     if (conn) {
         MOZ_ASSERT(trans->Caps() & NS_HTTP_STICKY_CONNECTION);
         LOG(("nsHttpConnectionMgr::ProcessNewTransaction trans=%p "
              "sticky connection=%p\n", trans, conn.get()));
 
@@ -1654,34 +1602,30 @@ nsHttpConnectionMgr::ProcessNewTransacti
             MOZ_ASSERT(!conn->IsExperienced());
 
             AddActiveConn(conn, ent); // make it active
         }
 
         trans->SetConnection(nullptr);
         rv = DispatchTransaction(ent, trans, conn);
     } else {
-        pendingTransInfo = new PendingTransactionInfo(trans);
-        rv = TryDispatchTransaction(ent, !!trans->TunnelProvider(), pendingTransInfo);
+        rv = TryDispatchTransaction(ent, !!trans->TunnelProvider(), trans);
     }
 
     if (NS_SUCCEEDED(rv)) {
         LOG(("  ProcessNewTransaction Dispatch Immediately trans=%p\n", trans));
         return rv;
     }
 
     if (rv == NS_ERROR_NOT_AVAILABLE) {
         LOG(("  adding transaction to pending queue "
              "[trans=%p pending-count=%" PRIuSIZE "]\n",
              trans, ent->mPendingQ.Length()+1));
         // put this transaction on the pending queue...
-        if (!pendingTransInfo) {
-            pendingTransInfo = new PendingTransactionInfo(trans);
-        }
-        InsertTransactionSorted(ent->mPendingQ, pendingTransInfo);
+        InsertTransactionSorted(ent->mPendingQ, trans);
         return NS_OK;
     }
 
     LOG(("  ProcessNewTransaction Hard Error trans=%p rv=%" PRIx32 "\n",
          trans, static_cast<uint32_t>(rv)));
     return rv;
 }
 
@@ -1712,53 +1656,23 @@ nsHttpConnectionMgr::StartedConnect()
 
 void
 nsHttpConnectionMgr::RecvdConnect()
 {
     mNumActiveConns--;
     ConditionallyStopTimeoutTick();
 }
 
-void
-nsHttpConnectionMgr::ReleaseClaimedSockets(nsConnectionEntry *ent,
-                                           PendingTransactionInfo * pendingTransInfo)
-{
-    if (pendingTransInfo->mHalfOpen) {
-        RefPtr<nsHalfOpenSocket> halfOpen =
-            do_QueryReferent(pendingTransInfo->mHalfOpen);
-        if (halfOpen) {
-            if (halfOpen->Transaction() &&
-                halfOpen->Transaction()->IsNullTransaction()) {
-                LOG(("nsHttpConnectionMgr::ReleaseClaimedSockets - mark halfOpne %p "
-                    "speculative again.", halfOpen.get()));
-                halfOpen->SetSpeculative(true);
-            }
-        }
-        pendingTransInfo->mHalfOpen = nullptr;
-    } else if (pendingTransInfo->mActiveConn) {
-        RefPtr<nsHttpConnection> activeConn =
-            do_QueryReferent(pendingTransInfo->mActiveConn);
-        if (activeConn && activeConn->Transaction() &&
-            activeConn->Transaction()->IsNullTransaction()) {
-            NullHttpTransaction *nullTrans = activeConn->Transaction()->QueryNullTransaction();
-            nullTrans->Unclaim();
-            LOG(("nsHttpConnectionMgr::ReleaseClaimedSockets - mark %p unclaimed.",
-                 activeConn.get()));
-        }
-    }
-}
-
 nsresult
 nsHttpConnectionMgr::CreateTransport(nsConnectionEntry *ent,
                                      nsAHttpTransaction *trans,
                                      uint32_t caps,
                                      bool speculative,
                                      bool isFromPredictor,
-                                     bool allow1918,
-                                     PendingTransactionInfo *pendingTransInfo)
+                                     bool allow1918)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
 
     RefPtr<nsHalfOpenSocket> sock = new nsHalfOpenSocket(ent, trans, caps);
     if (speculative) {
         sock->SetSpeculative(true);
         sock->SetAllow1918(allow1918);
         Telemetry::AutoCounter<Telemetry::HTTPCONNMGR_TOTAL_SPECULATIVE_CONN> totalSpeculativeConn;
@@ -1772,21 +1686,16 @@ nsHttpConnectionMgr::CreateTransport(nsC
     }
 
     // The socket stream holds the reference to the half open
     // socket - so if the stream fails to init the half open
     // will go away.
     nsresult rv = sock->SetupPrimaryStreams();
     NS_ENSURE_SUCCESS(rv, rv);
 
-    if (pendingTransInfo) {
-        pendingTransInfo->mHalfOpen =
-            do_GetWeakReference(static_cast<nsISupportsWeakReference*>(sock));
-    }
-
     ent->mHalfOpens.AppendElement(sock);
     mNumHalfOpenConns++;
     return NS_OK;
 }
 
 // This function tries to dispatch the pending spdy transactions on
 // the connection entry sent in as an argument. It will do so on the
 // active spdy connection either in that same entry or in the
@@ -1795,49 +1704,47 @@ nsHttpConnectionMgr::CreateTransport(nsC
 
 void
 nsHttpConnectionMgr::ProcessSpdyPendingQ(nsConnectionEntry *ent)
 {
     nsHttpConnection *conn = GetSpdyPreferredConn(ent);
     if (!conn || !conn->CanDirectlyActivate())
         return;
 
-    nsTArray<RefPtr<PendingTransactionInfo> > leftovers;
+    nsTArray<RefPtr<nsHttpTransaction> > leftovers;
     uint32_t index;
 
     // Dispatch all the transactions we can
     for (index = 0;
          index < ent->mPendingQ.Length() && conn->CanDirectlyActivate();
          ++index) {
-        PendingTransactionInfo *pendingTransInfo = ent->mPendingQ[index];
-
-        if (!(pendingTransInfo->mTransaction->Caps() & NS_HTTP_ALLOW_KEEPALIVE) ||
-            pendingTransInfo->mTransaction->Caps() & NS_HTTP_DISALLOW_SPDY) {
-            leftovers.AppendElement(pendingTransInfo);
+        nsHttpTransaction *trans = ent->mPendingQ[index];
+
+        if (!(trans->Caps() & NS_HTTP_ALLOW_KEEPALIVE) ||
+            trans->Caps() & NS_HTTP_DISALLOW_SPDY) {
+            leftovers.AppendElement(trans);
             continue;
         }
 
-        nsresult rv = DispatchTransaction(ent, pendingTransInfo->mTransaction,
-                                          conn);
+        nsresult rv = DispatchTransaction(ent, trans, conn);
         if (NS_FAILED(rv)) {
             // this cannot happen, but if due to some bug it does then
             // close the transaction
             MOZ_ASSERT(false, "Dispatch SPDY Transaction");
             LOG(("ProcessSpdyPendingQ Dispatch Transaction failed trans=%p\n",
-                 pendingTransInfo->mTransaction.get()));
-            pendingTransInfo->mTransaction->Close(rv);
+                    trans));
+            trans->Close(rv);
         }
-        ReleaseClaimedSockets(ent, pendingTransInfo);
     }
 
     // Slurp up the rest of the pending queue into our leftovers bucket (we
     // might have some left if conn->CanDirectlyActivate returned false)
     for (; index < ent->mPendingQ.Length(); ++index) {
-        PendingTransactionInfo *pendingTransInfo = ent->mPendingQ[index];
-        leftovers.AppendElement(pendingTransInfo);
+        nsHttpTransaction *trans = ent->mPendingQ[index];
+        leftovers.AppendElement(trans);
     }
 
     // Put the leftovers back in the pending queue and get rid of the
     // transactions we dispatched
     leftovers.SwapElements(ent->mPendingQ);
     leftovers.Clear();
 }
 
@@ -1942,18 +1849,18 @@ nsHttpConnectionMgr::OnMsgShutdown(int32
         }
 
         // If all idle connections are removed we can stop pruning dead
         // connections.
         ConditionallyStopPruneDeadConnectionsTimer();
 
         // Close all pending transactions.
         while (ent->mPendingQ.Length()) {
-            PendingTransactionInfo *pendingTransInfo = ent->mPendingQ[0];
-            pendingTransInfo->mTransaction->Close(NS_ERROR_ABORT);
+            nsHttpTransaction *trans = ent->mPendingQ[0];
+            trans->Close(NS_ERROR_ABORT);
             ent->mPendingQ.RemoveElementAt(0);
         }
 
         // Close all half open tcp connections.
         for (int32_t i = int32_t(ent->mHalfOpens.Length()) - 1; i >= 0; i--) {
             ent->mHalfOpens[i]->Abandon();
         }
 
@@ -2011,21 +1918,20 @@ nsHttpConnectionMgr::OnMsgReschedTransac
 
     RefPtr<nsHttpTransaction> trans = static_cast<nsHttpTransaction *>(param);
     trans->SetPriority(priority);
 
     nsConnectionEntry *ent = LookupConnectionEntry(trans->ConnectionInfo(),
                                                    nullptr, trans);
 
     if (ent) {
-        int32_t index = ent->mPendingQ.IndexOf(trans, 0, PendingComparator());
+        int32_t index = ent->mPendingQ.IndexOf(trans);
         if (index >= 0) {
-            RefPtr<PendingTransactionInfo> pendingTransInfo = ent->mPendingQ[index];
             ent->mPendingQ.RemoveElementAt(index);
-            InsertTransactionSorted(ent->mPendingQ, pendingTransInfo);
+            InsertTransactionSorted(ent->mPendingQ, trans);
         }
     }
 }
 
 void
 nsHttpConnectionMgr::OnMsgCancelTransaction(int32_t reason, ARefBase *param)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@@ -2044,39 +1950,33 @@ nsHttpConnectionMgr::OnMsgCancelTransact
     RefPtr<nsAHttpConnection> conn(trans->Connection());
     if (conn && !trans->IsDone()) {
         conn->CloseTransaction(trans, closeCode);
     } else {
         nsConnectionEntry *ent =
             LookupConnectionEntry(trans->ConnectionInfo(), nullptr, trans);
 
         if (ent) {
-            int32_t transIndex = ent->mPendingQ.IndexOf(trans, 0, PendingComparator());
-            // We will abandon all half-open sockets belonging to the given
-            // transaction.
-            RefPtr<PendingTransactionInfo> pendingTransInfo;
+            int32_t transIndex = ent->mPendingQ.IndexOf(trans);
             if (transIndex >= 0) {
                 LOG(("nsHttpConnectionMgr::OnMsgCancelTransaction [trans=%p]"
                      " found in pending queue\n", trans));
-                pendingTransInfo = ent->mPendingQ[transIndex];
-                // We do not need to ReleaseClaimedSockets while we are going
-                // to close them all any way!
                 ent->mPendingQ.RemoveElementAt(transIndex);
             }
 
             // Abandon all half-open sockets belonging to the given transaction.
-            if (pendingTransInfo) {
-                RefPtr<nsHalfOpenSocket> half =
-                    do_QueryReferent(pendingTransInfo->mHalfOpen);
-                if (half) {
-                    MOZ_ASSERT(trans == half->Transaction() ||
-                               half->Transaction()->IsNullTransaction());
+            for (uint32_t index = 0;
+                 index < ent->mHalfOpens.Length();
+                 ++index) {
+                nsHalfOpenSocket *half = ent->mHalfOpens[index];
+                if (trans == half->Transaction()) {
                     half->Abandon();
+                    // there is only one, and now mHalfOpens[] has been changed.
+                    break;
                 }
-                pendingTransInfo->mHalfOpen = nullptr;
             }
         }
 
         trans->Close(closeCode);
 
         // Cancel is a pretty strong signal that things might be hanging
         // so we want to cancel any null transactions related to this connection
         // entry. They are just optimizations, but they aren't hooked up to
@@ -2146,20 +2046,20 @@ nsHttpConnectionMgr::OnMsgCancelTransact
     nsConnectionEntry *ent = mCT.Get(ci->HashKey());
     LOG(("nsHttpConnectionMgr::OnMsgCancelTransactions %s %p\n",
          ci->HashKey().get(), ent));
     if (!ent) {
         return;
     }
 
     for (int32_t i = ent->mPendingQ.Length() - 1; i >= 0; --i) {
-        PendingTransactionInfo *pendingTransInfo = ent->mPendingQ[i];
+        nsHttpTransaction *trans = ent->mPendingQ[i];
         LOG(("nsHttpConnectionMgr::OnMsgCancelTransactions %s %p %p\n",
-             ci->HashKey().get(), ent, pendingTransInfo->mTransaction.get()));
-        pendingTransInfo->mTransaction->Close(reason);
+             ci->HashKey().get(), ent, trans));
+        trans->Close(reason);
         ent->mPendingQ.RemoveElementAt(i);
     }
 }
 
 void
 nsHttpConnectionMgr::OnMsgPruneDeadConnections(int32_t, ARefBase *)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@@ -2700,18 +2600,17 @@ nsHttpConnectionMgr::OnMsgSpeculativeCon
     bool keepAlive = args->mTrans->Caps() & NS_HTTP_ALLOW_KEEPALIVE;
     if (mNumHalfOpenConns < parallelSpeculativeConnectLimit &&
         ((ignoreIdle && (ent->mIdleConns.Length() < parallelSpeculativeConnectLimit)) ||
          !ent->mIdleConns.Length()) &&
         !(keepAlive && RestrictConnections(ent)) &&
         !AtActiveConnectionLimit(ent, args->mTrans->Caps())) {
         DebugOnly<nsresult> rv = CreateTransport(ent, args->mTrans,
                                                  args->mTrans->Caps(), true,
-                                                 isFromPredictor, allow1918,
-                                                 nullptr);
+                                                 isFromPredictor, allow1918);
         MOZ_ASSERT(NS_SUCCEEDED(rv));
     } else {
         LOG(("OnMsgSpeculativeConnect Transport "
              "not created due to existing connection count\n"));
     }
 }
 
 bool
@@ -2735,32 +2634,22 @@ ConnectionHandle::DontReuse()
 nsresult
 ConnectionHandle::PushBack(const char *buf, uint32_t bufLen)
 {
     return mConn->PushBack(buf, bufLen);
 }
 
 
 //////////////////////// nsHalfOpenSocket
-NS_IMPL_ADDREF(nsHttpConnectionMgr::nsHalfOpenSocket)
-NS_IMPL_RELEASE(nsHttpConnectionMgr::nsHalfOpenSocket)
-
-NS_INTERFACE_MAP_BEGIN(nsHttpConnectionMgr::nsHalfOpenSocket)
-    NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
-    NS_INTERFACE_MAP_ENTRY(nsIOutputStreamCallback)
-    NS_INTERFACE_MAP_ENTRY(nsITransportEventSink)
-    NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
-    NS_INTERFACE_MAP_ENTRY(nsITimerCallback)
-    // we have no macro that covers this case.
-    if (aIID.Equals(NS_GET_IID(nsHttpConnectionMgr::nsHalfOpenSocket)) ) {
-        AddRef();
-        *aInstancePtr = this;
-        return NS_OK;
-    } else
-NS_INTERFACE_MAP_END
+
+NS_IMPL_ISUPPORTS(nsHttpConnectionMgr::nsHalfOpenSocket,
+                  nsIOutputStreamCallback,
+                  nsITransportEventSink,
+                  nsIInterfaceRequestor,
+                  nsITimerCallback)
 
 nsHttpConnectionMgr::
 nsHalfOpenSocket::nsHalfOpenSocket(nsConnectionEntry *ent,
                                    nsAHttpTransaction *trans,
                                    uint32_t caps)
     : mEnt(ent)
     , mTransaction(trans)
     , mDispatchedMTransaction(false)
@@ -3157,26 +3046,24 @@ nsHalfOpenSocket::OnOutputStreamReady(ns
         return rv;
     }
 
     // This half-open socket has created a connection.  This flag excludes it
     // from counter of actual connections used for checking limits.
     mHasConnected = true;
 
     // if this is still in the pending list, remove it and dispatch it
-    index = mEnt->mPendingQ.IndexOf(mTransaction, 0, PendingComparator());
+    index = mEnt->mPendingQ.IndexOf(mTransaction);
     if (index != -1) {
         MOZ_ASSERT(!mSpeculative,
                    "Speculative Half Open found mTransaction");
-        RefPtr<PendingTransactionInfo> temp = mEnt->mPendingQ[index];
+        RefPtr<nsHttpTransaction> temp = mEnt->mPendingQ[index];
         mEnt->mPendingQ.RemoveElementAt(index);
         gHttpHandler->ConnMgr()->AddActiveConn(conn, mEnt);
-        rv = gHttpHandler->ConnMgr()->DispatchTransaction(mEnt,
-                                                          temp->mTransaction,
-                                                          conn);
+        rv = gHttpHandler->ConnMgr()->DispatchTransaction(mEnt, temp, conn);
     } else {
         // this transaction was dispatched off the pending q before all the
         // sockets established themselves.
 
         // After about 1 second allow for the possibility of restarting a
         // transaction due to server close. Keep at sub 1 second as that is the
         // minimum granularity we can expect a server to be timing out with.
         conn->SetIsReusedAfter(950);
@@ -3219,31 +3106,18 @@ nsHalfOpenSocket::OnOutputStreamReady(ns
 NS_IMETHODIMP
 nsHttpConnectionMgr::nsHalfOpenSocket::OnTransportStatus(nsITransport *trans,
                                                          nsresult status,
                                                          int64_t progress,
                                                          int64_t progressMax)
 {
     MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
 
-    if (mTransaction) {
-        if ((trans == mSocketTransport) ||
-            ((trans == mBackupTransport) && (status == NS_NET_STATUS_CONNECTED_TO) &&
-            mEnt->mPendingQ.Contains(mTransaction, PendingComparator()))) {
-            // Send this status event only if the transaction is still panding,
-            // i.e. it has not found a free already connected socket.
-            // Sockets in halfOpen state can only get following events:
-            // NS_NET_STATUS_RESOLVING_HOST, NS_NET_STATUS_RESOLVED_HOST,
-            // NS_NET_STATUS_CONNECTING_TO and NS_NET_STATUS_CONNECTED_TO.
-            // mBackupTransport is only started after
-            // NS_NET_STATUS_CONNECTING_TO of mSocketTransport, so ignore all
-            // mBackupTransport events until NS_NET_STATUS_CONNECTED_TO.
-            mTransaction->OnTransportStatus(trans, status, progress);
-        }
-    }
+    if (mTransaction)
+        mTransaction->OnTransportStatus(trans, status, progress);
 
     MOZ_ASSERT(trans == mSocketTransport || trans == mBackupTransport);
     if (status == NS_NET_STATUS_CONNECTED_TO) {
         if (trans == mSocketTransport) {
             mPrimaryConnectedOK = true;
         } else {
             mBackupConnectedOK = true;
         }
--- a/netwerk/protocol/http/nsHttpConnectionMgr.h
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.h
@@ -13,33 +13,28 @@
 #include "nsClassHashtable.h"
 #include "nsDataHashtable.h"
 #include "nsAutoPtr.h"
 #include "mozilla/ReentrantMonitor.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/Attributes.h"
 #include "AlternateServices.h"
 #include "ARefBase.h"
-#include "nsWeakReference.h"
 
 #include "nsIObserver.h"
 #include "nsITimer.h"
 
 class nsIHttpUpgradeListener;
 
 namespace mozilla {
 namespace net {
 class EventTokenBucket;
 class NullHttpTransaction;
 struct HttpRetParams;
 
-// 8d411b53-54bc-4a99-8b78-ff125eab1564
-#define NS_HALFOPENSOCKET_IID \
-{ 0x8d411b53, 0x54bc, 0x4a99, {0x8b, 0x78, 0xff, 0x12, 0x5e, 0xab, 0x15, 0x64 }}
-
 //-----------------------------------------------------------------------------
 
 // message handlers have this signature
 class nsHttpConnectionMgr;
 typedef void (nsHttpConnectionMgr:: *nsConnEventHandler)(int32_t, ARefBase *);
 
 class nsHttpConnectionMgr final : public nsIObserver
                                 , public AltSvcCache
@@ -196,32 +191,31 @@ public:
 
     // public, so that the SPDY/http2 seesions can activate
     void ActivateTimeoutTick();
 
 private:
     virtual ~nsHttpConnectionMgr();
 
     class nsHalfOpenSocket;
-    class PendingTransactionInfo;
 
     // nsConnectionEntry
     //
     // mCT maps connection info hash key to nsConnectionEntry object, which
     // contains list of active and idle connections as well as the list of
     // pending transactions.
     //
     class nsConnectionEntry
     {
     public:
         explicit nsConnectionEntry(nsHttpConnectionInfo *ci);
         ~nsConnectionEntry();
 
         RefPtr<nsHttpConnectionInfo> mConnInfo;
-        nsTArray<RefPtr<PendingTransactionInfo> > mPendingQ;    // pending transaction queue
+        nsTArray<RefPtr<nsHttpTransaction> > mPendingQ;    // pending transaction queue
         nsTArray<RefPtr<nsHttpConnection> >  mActiveConns; // active connections
         nsTArray<RefPtr<nsHttpConnection> >  mIdleConns;   // idle persistent connections
         nsTArray<nsHalfOpenSocket*>  mHalfOpens;   // half open connections
 
         bool AvailableForDispatchNow();
 
         // calculate the number of half open sockets that have not had at least 1
         // connection complete
@@ -272,23 +266,21 @@ public:
 private:
 
     // nsHalfOpenSocket is used to hold the state of an opening TCP socket
     // while we wait for it to establish and bind it to a connection
 
     class nsHalfOpenSocket final : public nsIOutputStreamCallback,
                                    public nsITransportEventSink,
                                    public nsIInterfaceRequestor,
-                                   public nsITimerCallback,
-                                   public nsSupportsWeakReference
+                                   public nsITimerCallback
     {
         ~nsHalfOpenSocket();
 
     public:
-        NS_DECLARE_STATIC_IID_ACCESSOR(NS_HALFOPENSOCKET_IID)
         NS_DECL_THREADSAFE_ISUPPORTS
         NS_DECL_NSIOUTPUTSTREAMCALLBACK
         NS_DECL_NSITRANSPORTEVENTSINK
         NS_DECL_NSIINTERFACEREQUESTOR
         NS_DECL_NSITIMERCALLBACK
 
         nsHalfOpenSocket(nsConnectionEntry *ent,
                          nsAHttpTransaction *trans,
@@ -359,45 +351,16 @@ private:
         // connection process. It may have completed unsuccessfully.
         bool                           mHasConnected;
 
         bool                           mPrimaryConnectedOK;
         bool                           mBackupConnectedOK;
     };
     friend class nsHalfOpenSocket;
 
-    class PendingTransactionInfo : public ARefBase
-    {
-    public:
-        explicit PendingTransactionInfo(nsHttpTransaction * trans)
-            : mTransaction(trans)
-        {}
-
-        NS_INLINE_DECL_THREADSAFE_REFCOUNTING(PendingTransactionInfo)
-
-        void PrintDiagnostics(nsCString &log);
-    public: // meant to be public.
-        RefPtr<nsHttpTransaction> mTransaction;
-        nsWeakPtr mHalfOpen;
-        nsWeakPtr mActiveConn;
-
-    private:
-        virtual ~PendingTransactionInfo() {}
-    };
-    friend class PendingTransactionInfo;
-
-    class PendingComparator
-    {
-    public:
-        bool Equals(const PendingTransactionInfo *aPendingTrans,
-                    const nsAHttpTransaction *aTrans) const {
-            return aPendingTrans->mTransaction.get() == aTrans;
-        }
-    };
-
     //-------------------------------------------------------------------------
     // NOTE: these members may be accessed from any thread (use mReentrantMonitor)
     //-------------------------------------------------------------------------
 
     ReentrantMonitor    mReentrantMonitor;
     nsCOMPtr<nsIEventTarget>     mSocketThreadTarget;
 
     // connection limits
@@ -411,53 +374,43 @@ private:
     // NOTE: these members are only accessed on the socket transport thread
     //-------------------------------------------------------------------------
 
     MOZ_MUST_USE bool ProcessPendingQForEntry(nsConnectionEntry *,
                                               bool considerAll);
     bool     AtActiveConnectionLimit(nsConnectionEntry *, uint32_t caps);
     MOZ_MUST_USE nsresult TryDispatchTransaction(nsConnectionEntry *ent,
                                                  bool onlyReusedConnection,
-                                                 PendingTransactionInfo *pendingTransInfo);
+                                                 nsHttpTransaction *trans);
     MOZ_MUST_USE nsresult DispatchTransaction(nsConnectionEntry *,
                                               nsHttpTransaction *,
                                               nsHttpConnection *);
     MOZ_MUST_USE nsresult DispatchAbstractTransaction(nsConnectionEntry *,
                                                       nsAHttpTransaction *,
                                                       uint32_t,
                                                       nsHttpConnection *,
                                                       int32_t);
     bool     RestrictConnections(nsConnectionEntry *);
     MOZ_MUST_USE nsresult ProcessNewTransaction(nsHttpTransaction *);
     MOZ_MUST_USE nsresult EnsureSocketThreadTarget();
     void     ClosePersistentConnections(nsConnectionEntry *ent);
     void     ReportProxyTelemetry(nsConnectionEntry *ent);
     MOZ_MUST_USE nsresult CreateTransport(nsConnectionEntry *,
                                           nsAHttpTransaction *, uint32_t, bool,
-                                          bool, bool,
-                                          PendingTransactionInfo *pendingTransInfo);
+                                          bool, bool);
     void     AddActiveConn(nsHttpConnection *, nsConnectionEntry *);
     void     DecrementActiveConnCount(nsHttpConnection *);
     void     StartedConnect();
     void     RecvdConnect();
 
-    // This function will unclaim the claimed connection or set a halfOpen
-    // socket to the speculative state if the transaction claiming them ends up
-    // using another connection.
-    void ReleaseClaimedSockets(nsConnectionEntry *ent,
-                               PendingTransactionInfo * pendingTransInfo);
-
-    void InsertTransactionSorted(nsTArray<RefPtr<PendingTransactionInfo> > &pendingQ,
-                                 PendingTransactionInfo *pendingTransInfo);
-
     nsConnectionEntry *GetOrCreateConnectionEntry(nsHttpConnectionInfo *,
                                                   bool allowWildCard);
 
     MOZ_MUST_USE nsresult MakeNewConnection(nsConnectionEntry *ent,
-                                            PendingTransactionInfo *pendingTransInfo);
+                                            nsHttpTransaction *trans);
 
     // Manage the preferred spdy connection entry for this address
     nsConnectionEntry *GetSpdyPreferredEnt(nsConnectionEntry *aOriginalEntry);
     nsConnectionEntry *LookupPreferredHash(nsConnectionEntry *ent);
     void               StorePreferredHash(nsConnectionEntry *ent);
     void               RemovePreferredHash(nsConnectionEntry *ent);
     nsHttpConnection  *GetSpdyPreferredConn(nsConnectionEntry *ent);
     nsDataHashtable<nsCStringHashKey, nsConnectionEntry *>   mSpdyPreferredHash;
@@ -532,14 +485,12 @@ private:
     void TimeoutTick();
 
     // For diagnostics
     void OnMsgPrintDiagnostics(int32_t, ARefBase *);
 
     nsCString mLogData;
 };
 
-NS_DEFINE_STATIC_IID_ACCESSOR(nsHttpConnectionMgr::nsHalfOpenSocket, NS_HALFOPENSOCKET_IID)
-
 } // namespace net
 } // namespace mozilla
 
 #endif // !nsHttpConnectionMgr_h__