Ensure raw_ptr<T> and T* are treated identically in //base callback.

There are safety checks associated with raw pointers (e.g. ensuring
receiver pointers are not raw pointers). Make sure these checks are
applied whether the input type is T* or raw_ptr<T>.

- Implement base::IsPointer<T> and base::RemovePointer<T>, which are
  similar to std::is_pointer<T> and std::remove_pointer<T>, except they
  also consider raw_ptr<T> a raw pointer type.
- Fix failures from the strengthened asserts: WebAppInstallFinalizer
  does not need a callback at all, while the privacy sandbox dialog
  tests can safely use base::Unretained().
- Add test cases to cover this in the //base callback nocompile test
  suite.
- Fix the existing nocompile tests, which did not escape `||` and
  inadvertently matched any error text.

Bug: 1335458
Change-Id: I470e3d5bc35ed52bf125136db738a868ef90b7e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3700700
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1013266}


CrOS-Libchrome-Original-Commit: 00c072a2c7f24921af3bbf8441abb34ecb0551a6
5 files changed
tree: e6536ef31a725ed93b257c2f3e4e9e8bdadfc008
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/