Bug 1808691 - Handle re-entrance in SignalImpendingShutdownToContentJS. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D166051
This commit is contained in:
Jens Stutte 2023-01-05 15:14:12 +00:00
Родитель c3e3ee14cc
Коммит 90c1a75237
2 изменённых файлов: 4 добавлений и 1 удалений

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

@ -3723,10 +3723,12 @@ class RequestContentJSInterruptRunnable final : public Runnable {
};
void ContentParent::SignalImpendingShutdownToContentJS() {
if (!AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdown)) {
if (!mIsSignaledImpendingShutdown &&
!AppShutdown::IsInOrBeyond(ShutdownPhase::AppShutdown)) {
MaybeLogBlockShutdownDiagnostics(
this, "BlockShutdown: NotifyImpendingShutdown.", __FILE__, __LINE__);
NotifyImpendingShutdown();
mIsSignaledImpendingShutdown = true;
if (mHangMonitorActor &&
StaticPrefs::dom_abort_script_on_child_shutdown()) {
MaybeLogBlockShutdownDiagnostics(

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

@ -1660,6 +1660,7 @@ class ContentParent final : public PContentParent,
static uint32_t sPageLoadEventCounter;
static Maybe<TimeStamp> sLastContentProcessLaunch;
bool mIsSignaledImpendingShutdown = false;
bool mIsNotifiedShutdownSuccess = false;
};