Bug 1527384 - Make net_EnsurePSMInit() work on socket process r=dragana

`net_EnsurePSMInit()` in socket process is called from `nsHttpConnectionMgr::SpeculativeConnect`, so let's also call `EnsureNSSInitializedChromeOrContent` to ensure NSS component is initialized.

Differential Revision: https://phabricator.services.mozilla.com/D64598

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kershaw Chang 2020-03-17 16:32:32 +00:00
parent c3d87369fb
commit c523e09d38

View File

@ -2694,6 +2694,14 @@ nsresult NS_GetFilenameFromDisposition(nsAString& aFilename,
}
void net_EnsurePSMInit() {
if (XRE_IsSocketProcess()) {
EnsureNSSInitializedChromeOrContent();
return;
}
MOZ_ASSERT(XRE_IsParentProcess());
MOZ_ASSERT(NS_IsMainThread());
nsresult rv;
nsCOMPtr<nsISupports> psm = do_GetService(PSM_COMPONENT_CONTRACTID, &rv);
MOZ_ASSERT(NS_SUCCEEDED(rv));