bug 1301407 - ensure PSM is initialized on the main thread before doing a speculative connect r=mcmanus a=ritu
authorDavid Keeler <dkeeler@mozilla.com>
Thu, 22 Sep 2016 14:54:48 -0700
changeset 348562 6b1a3f769aa6d826bd404750e7af66702ff01214
parent 348561 29d25f5224ad918470c049f1991628853e1831cd
child 348563 9c7f589a8f74bc57fe02a85abb4bd5aa352af129
push id6475
push userkwierso@gmail.com
push dateMon, 10 Oct 2016 21:14:32 +0000
treeherdermozilla-beta@0c41036b9e63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, ritu
bugs1301407
milestone50.0
bug 1301407 - ensure PSM is initialized on the main thread before doing a speculative connect r=mcmanus a=ritu MozReview-Commit-ID: Bc9KiN3Qw1E
netwerk/protocol/http/nsHttpConnectionMgr.cpp
--- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
+++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
@@ -403,16 +403,21 @@ private:
 nsresult
 nsHttpConnectionMgr::SpeculativeConnect(nsHttpConnectionInfo *ci,
                                         nsIInterfaceRequestor *callbacks,
                                         uint32_t caps,
                                         NullHttpTransaction *nullTransaction)
 {
     MOZ_ASSERT(NS_IsMainThread(), "nsHttpConnectionMgr::SpeculativeConnect called off main thread!");
 
+    if (!IsNeckoChild()) {
+        // HACK: make sure PSM gets initialized on the main thread.
+        net_EnsurePSMInit();
+    }
+
     LOG(("nsHttpConnectionMgr::SpeculativeConnect [ci=%s]\n",
          ci->HashKey().get()));
 
     nsCOMPtr<nsISpeculativeConnectionOverrider> overrider =
         do_GetInterface(callbacks);
 
     bool allow1918 = false;
     if (overrider) {