mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09:00
Issue #2452 - Fire events after iterating ServiceWorkerManager::mControlledDocuments is done.
https://bugzilla.mozilla.org/show_bug.cgi?id=1413466
This commit is contained in:
parent
d6dd1f8133
commit
0efbc454b6
1 changed files with 8 additions and 0 deletions
|
|
@ -3082,6 +3082,8 @@ void
|
|||
ServiceWorkerManager::FireControllerChange(ServiceWorkerRegistrationInfo* aRegistration)
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
|
||||
AutoTArray<nsCOMPtr<nsIDocument>, 16> documents;
|
||||
for (auto iter = mControlledDocuments.Iter(); !iter.Done(); iter.Next()) {
|
||||
if (iter.UserData() != aRegistration) {
|
||||
continue;
|
||||
|
|
@ -3092,6 +3094,12 @@ ServiceWorkerManager::FireControllerChange(ServiceWorkerRegistrationInfo* aRegis
|
|||
continue;
|
||||
}
|
||||
|
||||
documents.AppendElement(doc);
|
||||
}
|
||||
|
||||
// Fire event after iterating mControlledDocuments is done to prevent
|
||||
// modification by reentering from the event handlers during iteration.
|
||||
for (auto& doc : documents) {
|
||||
FireControllerChangeOnDocument(doc);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue