Bug 1550498, r=kershaw
authorHonza Bambas <honzab.moz@firemni.cz>
Thu, 09 May 2019 17:42:17 +0000
changeset 535667 7bfe542574a942df1aaca059b8cc7d4da0cfa158
parent 535666 28716788b1f142d48886472be02790659f559d2e
child 535668 230016dbba05b36ecc1ccada9abdc2d5370a0ae7
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskershaw
bugs1550498
milestone68.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 1550498, r=kershaw Differential Revision: https://phabricator.services.mozilla.com/D30510
netwerk/protocol/http/nsHttpConnectionMgr.cpp
netwerk/protocol/http/nsHttpHandler.h
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -589,18 +589,22 @@ nsresult nsHttpConnectionMgr::CompleteUp
 }
 
 nsresult nsHttpConnectionMgr::UpdateParam(nsParamName name, uint16_t value) {
   uint32_t param = (uint32_t(name) << 16) | uint32_t(value);
   return PostEvent(&nsHttpConnectionMgr::OnMsgUpdateParam,
                    static_cast<int32_t>(param), nullptr);
 }
 
-nsresult nsHttpConnectionMgr::ProcessPendingQ(nsHttpConnectionInfo* ci) {
-  LOG(("nsHttpConnectionMgr::ProcessPendingQ [ci=%s]\n", ci->HashKey().get()));
+nsresult nsHttpConnectionMgr::ProcessPendingQ(nsHttpConnectionInfo* aCI) {
+  LOG(("nsHttpConnectionMgr::ProcessPendingQ [ci=%s]\n", aCI->HashKey().get()));
+  RefPtr<nsHttpConnectionInfo> ci;
+  if (aCI) {
+    ci = aCI->Clone();
+  }
   return PostEvent(&nsHttpConnectionMgr::OnMsgProcessPendingQ, 0, ci);
 }
 
 nsresult nsHttpConnectionMgr::ProcessPendingQ() {
   LOG(("nsHttpConnectionMgr::ProcessPendingQ [All CI]\n"));
   return PostEvent(&nsHttpConnectionMgr::OnMsgProcessPendingQ, 0, nullptr);
 }
 
--- a/netwerk/protocol/http/nsHttpHandler.h
+++ b/netwerk/protocol/http/nsHttpHandler.h
@@ -310,17 +310,18 @@ class nsHttpHandler final : public nsIHt
   MOZ_MUST_USE nsresult GetSocketThreadTarget(nsIEventTarget** target) {
     return mConnMgr->GetSocketThreadTarget(target);
   }
 
   MOZ_MUST_USE nsresult SpeculativeConnect(nsHttpConnectionInfo* ci,
                                            nsIInterfaceRequestor* callbacks,
                                            uint32_t caps = 0) {
     TickleWifi(callbacks);
-    return mConnMgr->SpeculativeConnect(ci, callbacks, caps);
+    RefPtr<nsHttpConnectionInfo> clone = ci->Clone();
+    return mConnMgr->SpeculativeConnect(clone, callbacks, caps);
   }
 
   // Alternate Services Maps are main thread only
   void UpdateAltServiceMapping(AltSvcMapping* map, nsProxyInfo* proxyInfo,
                                nsIInterfaceRequestor* callbacks, uint32_t caps,
                                const OriginAttributes& originAttributes) {
     mConnMgr->UpdateAltServiceMapping(map, proxyInfo, callbacks, caps,
                                       originAttributes);