Further harden base::SupportsUserData against reentrancy
`SupportsUserData`'s destructor tries to ensure it presents a consistent view of itself to `SupportsUserData::Data` instances by swapping the internal map to a local before deleting `SupportsUserData::Data` instances. Extend this same protection to `ClearAllUserData()` and update `ClearAllUserData()` to similarly block mutation during the clear operation. Finally, block all operations other than `GetUserData()` while clearing `SupportsUserData::Data` instances. This sort of reentrancy can only lead to trouble; `GetUserData()` is the sole exception since there are likely too many existing violations to easily fix at this time. Bug: 40222690 Change-Id: I1cb47152a51c90c8b75911fb6be245be2ec7ca5d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5610828 Reviewed-by:Erik Chen <erikchen@chromium.org> Commit-Queue: Daniel Cheng <dcheng@chromium.org> Cr-Commit-Position: refs/heads/main@{#1312603}
Loading
Please register or sign in to comment