[tbb-commits] [tor-browser] 27/36: Bug 1789439 - Don't allow reentrant programmatic print calls. r=smaug, peterv a=pascalc
gitolite role
git at cupani.torproject.org
Thu Oct 13 07:51:15 UTC 2022
This is an automated email from the git hooks/post-receive script.
pierov pushed a commit to annotated tag FIREFOX_102_4_0esr_BUILD1
in repository tor-browser.
commit 7b585baebb2c74d4ca9c5908107868a41acdb4b8
Author: Emilio Cobos Álvarez <emilio at 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 d98276d975b7..8f7f880de51a 100644
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -5132,14 +5132,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);
}
});
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the tbb-commits
mailing list