Bug 1647433 - Fix use of GetTopLevelContentDocument in HangMonitorChild::InterruptCallback, r=peterv

No need to access top level doc. Disabling bfcaching on any subframe prevents bfcaching of the top level page.

(There may be other issues around stopping slow scripts in Fission.)

Differential Revision: https://phabricator.services.mozilla.com/D109400
This commit is contained in:
Olli Pettay 2021-03-26 19:13:22 +00:00
parent 6a26ece73c
commit d1b5dfa384

View File

@ -449,9 +449,7 @@ bool HangMonitorChild::InterruptCallback() {
if (NS_SUCCEEDED(rv) && canCancel) {
// Don't add this page to the BF cache, since we're cancelling its JS.
if (Document* doc = win->GetExtantDoc()) {
if (Document* topLevelDoc = doc->GetTopLevelContentDocument()) {
topLevelDoc->DisallowBFCaching();
}
doc->DisallowBFCaching();
}
return false;