Bug 234355 - Clear AXObjectCache::m_notificationsToPost after moving in notificationPostTimerFired.
Summary: Clear AXObjectCache::m_notificationsToPost after moving in notificationPostTi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andres Gonzalez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-12-15 10:59 PST by Andres Gonzalez
Modified: 2022-01-06 06:41 PST (History)
11 users (show)

See Also:


Attachments
Patch (1.81 KB, patch)
2021-12-15 11:06 PST, Andres Gonzalez
no flags Details | Formatted Diff | Diff
Patch (2.51 KB, patch)
2021-12-15 19:25 PST, Andres Gonzalez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andres Gonzalez 2021-12-15 10:59:16 PST
Clear AXObjectCache::m_notificationsToPost after moving in notificationPostTimerFired.
Comment 1 Radar WebKit Bug Importer 2021-12-15 10:59:29 PST
<rdar://problem/86532703>
Comment 2 Andres Gonzalez 2021-12-15 11:06:36 PST
Created attachment 447261 [details]
Patch
Comment 3 chris fleizach 2021-12-15 11:34:50 PST
Comment on attachment 447261 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=447261&action=review

> Source/WebCore/ChangeLog:10
> +

extra new line
Comment 4 Andres Gonzalez 2021-12-15 19:25:42 PST
Created attachment 447316 [details]
Patch
Comment 5 Andres Gonzalez 2021-12-15 19:28:19 PST
(In reply to chris fleizach from comment #3)
> Comment on attachment 447261 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=447261&action=review
> 
> > Source/WebCore/ChangeLog:10
> > +
> 
> extra new line

Fixed.

Also found another instance of this problem with m_passwordNotificationsToPost.
Comment 6 EWS 2021-12-16 09:01:08 PST
Committed r287139 (245323@main): <https://commits.webkit.org/245323@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 447316 [details].
Comment 7 Darin Adler 2021-12-16 13:26:22 PST
Comment on attachment 447316 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=447316&action=review

> Source/WebCore/accessibility/AXObjectCache.cpp:1085
>      auto notifications = WTFMove(m_notificationsToPost);
> +    m_notificationsToPost.clear();

The best idiom for this sort of thing is:

    auto notifications = std::exchange(m_notificationsToPost, { });
Comment 8 Andres Gonzalez 2022-01-06 06:41:27 PST
(In reply to Darin Adler from comment #7)
> Comment on attachment 447316 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=447316&action=review
> 
> > Source/WebCore/accessibility/AXObjectCache.cpp:1085
> >      auto notifications = WTFMove(m_notificationsToPost);
> > +    m_notificationsToPost.clear();
> 
> The best idiom for this sort of thing is:
> 
>     auto notifications = std::exchange(m_notificationsToPost, { });

Thanks, corrected in https://bugs.webkit.org/show_bug.cgi?id=234919.