base/stl_util.h has ContainsKey() and ContainsValue() [1]
helper functions to find a Key or a Value in a Container,
respectively. With ScopedVector being deprecated, snippets
of the form
std::vector<std::unique_ptr<Typename>> haystack;
std::find_if(haystack.begin(),
haystack.end(),
[needle](const std::unique_ptr<Typename>& entry) {
return entry.get() == needle;
});
can be found in the code.
Consider extending/specialising ContainsValue() or adding
a ContainsPointedValue() and using it throughout.
[1] https://cs.chromium.org/chromium/src/base/stl_util.h?sq=package:chromium&dr=CSs&l=196
Comment 1 by mcasas@chromium.org
, Jun 30 2016