Bug 1749831 - Don't launch/reset socket process when shutdown begins, r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D135817
This commit is contained in:
Kershaw Chang 2022-01-17 12:09:56 +00:00
Родитель 7ab30db7fe
Коммит a2804af3c8
2 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -37,6 +37,7 @@
#include "nsINode.h"
#include "nsIWidget.h"
#include "nsThreadUtils.h"
#include "mozilla/AppShutdown.h"
#include "mozilla/LoadInfo.h"
#include "mozilla/net/NeckoCommon.h"
#include "mozilla/Services.h"
@ -514,7 +515,8 @@ nsresult nsIOService::LaunchSocketProcess() {
return NS_OK;
}
if (mShutdown) {
// We shouldn't launch socket prcess when shutdown begins.
if (AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownConfirmed)) {
return NS_OK;
}

Просмотреть файл

@ -6,6 +6,7 @@
#include "SocketProcessBridgeChild.h"
#include "SocketProcessLogging.h"
#include "mozilla/AppShutdown.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/ipc/BackgroundChild.h"
#include "mozilla/ipc/Endpoint.h"
@ -156,7 +157,8 @@ mozilla::ipc::IPCResult SocketProcessBridgeChild::RecvTest() {
void SocketProcessBridgeChild::ActorDestroy(ActorDestroyReason aWhy) {
LOG(("SocketProcessBridgeChild::ActorDestroy\n"));
if (AbnormalShutdown == aWhy) {
if (gNeckoChild) {
if (gNeckoChild &&
!AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdownConfirmed)) {
// Let NeckoParent know that the socket process connections must be
// rebuilt.
gNeckoChild->SendResetSocketProcessBridge();