From 355a21abced286a275eed8c55784a94d1d6a440c Mon Sep 17 00:00:00 2001 From: "rpotts%netscape.com" Date: Tue, 3 Oct 2000 04:49:51 +0000 Subject: [PATCH] bug #54239 (r=dougt). PSM can be initialized on the wrong thread... --- netwerk/protocol/http/src/nsHTTPSHandler.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/netwerk/protocol/http/src/nsHTTPSHandler.cpp b/netwerk/protocol/http/src/nsHTTPSHandler.cpp index 096883571d17..8a5b5466c9ce 100644 --- a/netwerk/protocol/http/src/nsHTTPSHandler.cpp +++ b/netwerk/protocol/http/src/nsHTTPSHandler.cpp @@ -24,12 +24,24 @@ #include "nsHTTPSHandler.h" #include "nsISocketTransportService.h" #include "nsIServiceManager.h" +#include "nsIPSMComponent.h" static NS_DEFINE_CID(kSocketTransportServiceCID, NS_SOCKETTRANSPORTSERVICE_CID); nsHTTPSHandler::nsHTTPSHandler() : nsHTTPHandler() { + nsresult rv; + nsISupports *psm = nsnull; + // + // Initialize the PSM component. + // This is to ensure that PSM is initialized on the main UI thread. + // + rv = nsServiceManager::GetService( PSM_COMPONENT_CONTRACTID, + NS_GET_IID(nsIPSMComponent), + (nsISupports**)&psm); + + NS_IF_RELEASE(psm); } nsHTTPSHandler::~nsHTTPSHandler()