mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-28 19:37:32 +09:00
Issue #1587 followup - Improve resilience of AbortSignals.
This commit is contained in:
parent
2e6ec48b81
commit
589e9b77ae
2 changed files with 9 additions and 2 deletions
|
|
@ -56,9 +56,16 @@ AbortSignal::Aborted() const
|
||||||
void
|
void
|
||||||
AbortSignal::Abort()
|
AbortSignal::Abort()
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(!mAborted);
|
// Re-entrancy guard
|
||||||
|
if (mAborted) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
mAborted = true;
|
mAborted = true;
|
||||||
|
|
||||||
|
// We might be deleted as a result of aborting a follower, so ensure we
|
||||||
|
// stay alive until all followers have been aborted.
|
||||||
|
RefPtr<AbortSignal> pinThis = this;
|
||||||
|
|
||||||
// Let's inform the followers.
|
// Let's inform the followers.
|
||||||
for (uint32_t i = 0; i < mFollowers.Length(); ++i) {
|
for (uint32_t i = 0; i < mFollowers.Length(); ++i) {
|
||||||
mFollowers[i]->Aborted();
|
mFollowers[i]->Aborted();
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ EXPORTS.mozilla.dom += [
|
||||||
'AbortSignal.h',
|
'AbortSignal.h',
|
||||||
]
|
]
|
||||||
|
|
||||||
UNIFIED_SOURCES += [
|
SOURCES += [
|
||||||
'AbortController.cpp',
|
'AbortController.cpp',
|
||||||
'AbortSignal.cpp',
|
'AbortSignal.cpp',
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue