• Peter Kasting's avatar
    Convert SyncHandleRegistry to use a CallbackList. · 4b7b3265
    Peter Kasting authored
    This changes the API to look like CallbackList's: instead of calling
    UnregisterEvent(), callers destroy a subscription object they get from
    registering.  This is a bit easier for callers to deal with.  However,
    the necessity of also synchronously clearing the event from the WaitSet
    makes the implementation a bit irritating, since while CallbackList does
    provide a hook to be called back on callback removal, that happens after
    notification is finished, rather than right at subscription destruction.
    Instead of using the hook, wrap the CallbackList::Subscriptions in an
    object that will also remove the WaitSet item if need be.
    
    Bug: none
    Change-Id: Ideb74b1435bfaad1647324e5ba5f90976c268e2e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343956
    Commit-Queue: Peter Kasting <pkasting@chromium.org>
    Reviewed-by: default avatarKen Rockot <rockot@google.com>
    Cr-Commit-Position: refs/heads/master@{#796728}
    4b7b3265
sync_event_watcher.h 2.3 KB