Bug 1301407 - Ensure nss initialized during nsHttpHandler initialization. r=mcmanus, r=keeler
authorDragana Damjanovic dd.mozilla@gmail.com
Tue, 25 Oct 2016 10:43:00 -0400
changeset 346303 a14a46bd1ea229e6bb735c8a59f270c1c0aa748e
parent 346302 8b98dca70dd1d73edca6e2a03323ae3c5ac999cd
child 346304 f576244a25137fb0a43507a528270ba1ffdf3e7d
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, keeler
bugs1301407
milestone52.0a1
Bug 1301407 - Ensure nss initialized during nsHttpHandler initialization. r=mcmanus, r=keeler
netwerk/base/moz.build
netwerk/base/nsNetUtil.cpp
--- a/netwerk/base/moz.build
+++ b/netwerk/base/moz.build
@@ -299,17 +299,18 @@ EXTRA_JS_MODULES += [
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 LOCAL_INCLUDES += [
     '/docshell/base',
     '/dom/base',
-    '/netwerk/protocol/http'
+    '/netwerk/protocol/http',
+    '/security/pkix/include'
 ]
 
 if 'rtsp' in CONFIG['NECKO_PROTOCOLS']:
     LOCAL_INCLUDES += [
         '/netwerk/protocol/rtsp/controller',
         '/netwerk/protocol/rtsp/rtsp',
     ]
 
--- a/netwerk/base/nsNetUtil.cpp
+++ b/netwerk/base/nsNetUtil.cpp
@@ -64,16 +64,17 @@
 #include "nsInterfaceRequestorAgg.h"
 #include "plstr.h"
 #include "nsINestedURI.h"
 #include "mozilla/dom/nsCSPUtils.h"
 #include "mozilla/net/HttpBaseChannel.h"
 #include "nsIScriptError.h"
 #include "nsISiteSecurityService.h"
 #include "nsHttpHandler.h"
+#include "nsNSSComponent.h"
 
 #ifdef MOZ_WIDGET_GONK
 #include "nsINetworkManager.h"
 #include "nsThreadUtils.h" // for NS_IsMainThread
 #endif
 
 #include <limits>
 
@@ -2120,22 +2121,19 @@ NS_GetFilenameFromDisposition(nsAString 
   if (aFilename.IsEmpty())
     return NS_ERROR_NOT_AVAILABLE;
 
   return NS_OK;
 }
 
 void net_EnsurePSMInit()
 {
-    nsCOMPtr<nsISocketProviderService> spserv =
-            do_GetService(NS_SOCKETPROVIDERSERVICE_CONTRACTID);
-    if (spserv) {
-        nsCOMPtr<nsISocketProvider> provider;
-        spserv->GetSocketProvider("ssl", getter_AddRefs(provider));
-    }
+    nsresult rv;
+    nsCOMPtr<nsISupports> psm = do_GetService(PSM_COMPONENT_CONTRACTID, &rv);
+    MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
 }
 
 bool NS_IsAboutBlank(nsIURI *uri)
 {
     // GetSpec can be expensive for some URIs, so check the scheme first.
     bool isAbout = false;
     if (NS_FAILED(uri->SchemeIs("about", &isAbout)) || !isAbout) {
         return false;