Title: [287139] trunk/Source/WebCore
Revision
287139
Author
[email protected]
Date
2021-12-16 08:59:53 -0800 (Thu, 16 Dec 2021)

Log Message

Clear AXObjectCache::m_notificationsToPost after moving in notificationPostTimerFired.
https://bugs.webkit.org/show_bug.cgi?id=234355
<rdar://problem/86532703>

Reviewed by Chris Fleizach.

Covered by existing tests.

This memeber variable must be clear after moving its resources to a
local variable, otherwise this may cause undefined behavior.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::notificationPostTimerFired):
(WebCore::AXObjectCache::passwordNotificationPostTimerFired):
Same problem here with m_passwordNotificationsToPost.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (287138 => 287139)


--- trunk/Source/WebCore/ChangeLog	2021-12-16 16:54:13 UTC (rev 287138)
+++ trunk/Source/WebCore/ChangeLog	2021-12-16 16:59:53 UTC (rev 287139)
@@ -1,3 +1,21 @@
+2021-12-16  Andres Gonzalez  <[email protected]>
+
+        Clear AXObjectCache::m_notificationsToPost after moving in notificationPostTimerFired.
+        https://bugs.webkit.org/show_bug.cgi?id=234355
+        <rdar://problem/86532703>
+
+        Reviewed by Chris Fleizach.
+
+        Covered by existing tests.
+
+        This memeber variable must be clear after moving its resources to a
+        local variable, otherwise this may cause undefined behavior.
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::notificationPostTimerFired):
+        (WebCore::AXObjectCache::passwordNotificationPostTimerFired):
+        Same problem here with m_passwordNotificationsToPost.
+
 2021-12-15  Darin Adler  <[email protected]>
 
         Many call sites use makeNeverDestroyed, but could instead take advantage of the NeverDestroyed deduction guide

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (287138 => 287139)


--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2021-12-16 16:54:13 UTC (rev 287138)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2021-12-16 16:59:53 UTC (rev 287139)
@@ -1082,6 +1082,7 @@
     // In tests, posting notifications has a tendency to immediately queue up other notifications, which can lead to unexpected behavior
     // when the notification list is cleared at the end. Instead copy this list at the start.
     auto notifications = WTFMove(m_notificationsToPost);
+    m_notificationsToPost.clear();
 
     // Filter out the notifications that are not going to be posted to platform clients.
     Vector<std::pair<RefPtr<AXCoreObject>, AXNotification>> notificationsToPost;
@@ -1133,6 +1134,7 @@
     // In tests, posting notifications has a tendency to immediately queue up other notifications, which can lead to unexpected behavior
     // when the notification list is cleared at the end. Instead copy this list at the start.
     auto notifications = WTFMove(m_passwordNotificationsToPost);
+    m_passwordNotificationsToPost.clear();
 
     for (auto& notification : notifications)
         postTextStateChangePlatformNotification(notification.get(), AXTextEditTypeInsert, " ", VisiblePosition());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to