This is an automated email from the git hooks/post-receive script.
richard pushed a commit to branch tor-browser-91.13.0esr-11.5-1 in repository tor-browser.
commit b0dab0834f6b13356c897f74711d47250addbcb5 Author: Emilio Cobos Álvarez emilio@crisal.io AuthorDate: Thu Sep 15 15:37:56 2022 +0000
Bug 1789439 - Don't allow reentrant programmatic print calls. r=smaug,peterv a=pascalc
Differential Revision: https://phabricator.services.mozilla.com/D156682 --- dom/base/nsGlobalWindowOuter.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dom/base/nsGlobalWindowOuter.cpp b/dom/base/nsGlobalWindowOuter.cpp index e981573e9822..08fbebd4bc03 100644 --- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp @@ -5220,14 +5220,17 @@ void nsGlobalWindowOuter::PrintOuter(ErrorResult& aError) { #ifdef NS_PRINTING RefPtr<BrowsingContext> top = mBrowsingContext ? mBrowsingContext->Top() : nullptr; - bool oldIsPrinting = top && top->GetIsPrinting(); + if (NS_WARN_IF(top && top->GetIsPrinting())) { + return; + } + if (top) { Unused << top->SetIsPrinting(true); }
auto unset = MakeScopeExit([&] { if (top) { - Unused << top->SetIsPrinting(oldIsPrinting); + Unused << top->SetIsPrinting(false); } });