зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1738984 - Prevent NSS initialization and channel creation during shutdown r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D133065
This commit is contained in:
Родитель
9c31da24d9
Коммит
2b555ca6ac
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
|
|
||||||
|
#include "mozilla/AppShutdown.h"
|
||||||
#include "mozilla/Atomics.h"
|
#include "mozilla/Atomics.h"
|
||||||
#include "mozilla/BasePrincipal.h"
|
#include "mozilla/BasePrincipal.h"
|
||||||
#include "mozilla/Components.h"
|
#include "mozilla/Components.h"
|
||||||
|
@ -2709,6 +2710,11 @@ void net_EnsurePSMInit() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Avoid a late initialization
|
||||||
|
if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownNetTeardown)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
MOZ_ASSERT(XRE_IsParentProcess());
|
MOZ_ASSERT(XRE_IsParentProcess());
|
||||||
MOZ_ASSERT(NS_IsMainThread());
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,7 @@
|
||||||
#include "mozilla/net/SocketProcessParent.h"
|
#include "mozilla/net/SocketProcessParent.h"
|
||||||
#include "mozilla/net/SocketProcessChild.h"
|
#include "mozilla/net/SocketProcessChild.h"
|
||||||
#include "mozilla/ipc/URIUtils.h"
|
#include "mozilla/ipc/URIUtils.h"
|
||||||
|
#include "mozilla/AppShutdown.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
#include "mozilla/Unused.h"
|
#include "mozilla/Unused.h"
|
||||||
#include "mozilla/AntiTrackingRedirectHeuristic.h"
|
#include "mozilla/AntiTrackingRedirectHeuristic.h"
|
||||||
|
@ -2059,6 +2060,11 @@ nsHttpHandler::NewProxiedChannel(nsIURI* uri, nsIProxyInfo* givenProxyInfo,
|
||||||
httpChannel = new nsHttpChannel();
|
httpChannel = new nsHttpChannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Avoid a late initialization
|
||||||
|
if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownNetTeardown)) {
|
||||||
|
return NS_ERROR_ILLEGAL_DURING_SHUTDOWN;
|
||||||
|
}
|
||||||
|
|
||||||
return SetupChannelInternal(httpChannel, uri, givenProxyInfo,
|
return SetupChannelInternal(httpChannel, uri, givenProxyInfo,
|
||||||
proxyResolveFlags, proxyURI, aLoadInfo, result);
|
proxyResolveFlags, proxyURI, aLoadInfo, result);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2246,6 +2246,11 @@ nsresult nsNSSComponent::Init() {
|
||||||
return NS_ERROR_NOT_AVAILABLE;
|
return NS_ERROR_NOT_AVAILABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Avoid a late initialization
|
||||||
|
if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownNetTeardown)) {
|
||||||
|
return NS_ERROR_ILLEGAL_DURING_SHUTDOWN;
|
||||||
|
}
|
||||||
|
|
||||||
Telemetry::AutoScalarTimer<Telemetry::ScalarID::NETWORKING_NSS_INITIALIZATION>
|
Telemetry::AutoScalarTimer<Telemetry::ScalarID::NETWORKING_NSS_INITIALIZATION>
|
||||||
timer;
|
timer;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче