-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a RemoveObserverPolicy parameter to ObserverListThreadSafe
The policy defaults to kAnySequence, the existing behaviour, but can be set to kAddingSequenceOnly to CHECK that observers are only removed from the same sequence that added them. This prevents a mistake where an observer is deleted immediately after calling RemoveObserver from a different sequence, even though it might still be inside a callback. Also adds 3 more cross-thread ObserverListThreadSafeTest's, and reduces the duration of each from 2s to 1s to compensate. R=fdoray Bug: 1471683 Change-Id: I73e9cc21f2186ebdcf8f2dacd1a71aa4d11134c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4781112 Commit-Queue: Matt Mueller <mattm@chromium.org> Reviewed-by: Matt Mueller <mattm@chromium.org> Reviewed-by: Francois Pierre Doray <fdoray@chromium.org> Auto-Submit: Joe Mason <joenotcharles@google.com> Cr-Commit-Position: refs/heads/main@{#1184841}
- Loading branch information
1 parent
f3a9781
commit 7eda661
Showing
4 changed files
with
137 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters