Bug 1873294 - Clean up logic for firing cross-process load events, r=smaug
Previously it may have been possible in some edge cases for us to send `MaybeFireEmbedderLoadEvents` for a non-toplevel frame during docshell tree teardown. Differential Revision: https://phabricator.services.mozilla.com/D197825
This commit is contained in:
@@ -2197,7 +2197,7 @@ void nsDocShell::TriggerParentCheckDocShellIsEmpty() {
|
||||
parent->DocLoaderIsEmpty(true);
|
||||
}
|
||||
if (GetBrowsingContext()->IsContentSubframe() &&
|
||||
!GetBrowsingContext()->GetParent()->IsInProcess()) {
|
||||
!GetBrowsingContext()->GetParentWindowContext()->IsInProcess()) {
|
||||
if (BrowserChild* browserChild = BrowserChild::GetFrom(this)) {
|
||||
mozilla::Unused << browserChild->SendMaybeFireEmbedderLoadEvents(
|
||||
EmbedderElementEventType::NoEvent);
|
||||
@@ -3381,7 +3381,8 @@ void nsDocShell::UnblockEmbedderLoadEventForFailure(bool aFireFrameErrorEvent) {
|
||||
// SendMaybeFireEmbedderLoadEvents via any of the normal call paths.
|
||||
// (Obviously, we must do this before any of the returns below.)
|
||||
RefPtr<BrowserChild> browserChild = BrowserChild::GetFrom(this);
|
||||
if (browserChild) {
|
||||
if (browserChild &&
|
||||
!mBrowsingContext->GetParentWindowContext()->IsInProcess()) {
|
||||
mozilla::Unused << browserChild->SendMaybeFireEmbedderLoadEvents(
|
||||
aFireFrameErrorEvent ? EmbedderElementEventType::ErrorEvent
|
||||
: EmbedderElementEventType::NoEvent);
|
||||
|
||||
Reference in New Issue
Block a user