Follow the lead of upstream and rewrite most raw pointers to using raw_ptr<T> instead, making also sure that they are initialized. This rewrite affected all *.h and *.cc files in this repository except those from the ios/, third_party/ and vendor/ directories, and it didn't touch any *.mm file either. Regular expression used for the search & replace process: Find regexp: "^\s*?(\S*?)\* (\S*?[a-zA-Z0-9]_?);" Replace with: "raw_ptr<$1> $2 = nullptr;" Chromium change: https://source.chromium.org/chromium/chromium/src/+/0e45c020c43b1a9f6d2870ff7f92b30a2f03a458 commit 0e45c020c43b1a9f6d2870ff7f92b30a2f03a458 Author: Keishi Hattori <keishi@chromium.org> Date: Sat Nov 27 09:25:52 2021 +0000 Rewrite most `Foo* field_` pointer fields to `raw_ptr<Foo> field_`. DO NOT REVERT (unless absolutely necessary)! Report build breaks to keishi@(APAC)/glazunov@(EMEA /sebmarchand@(NA) as soon as you see them. Fixes are expected to be trivial. This commit was generated automatically, by running the following script: tools/clang/rewrite_ra _ptr_fields/rewrite-multiple-platforms.sh on commit fe74bc434e5b7e92d13a328362fcb6df15d8847e For more information, see MiraclePtr One Pager [1], the PSA at chromium-dev@ [2], and the raw_pt documentation in //base/memory/raw_ptr.md. FYI This CL does not enable MiraclePtr protection and we expect no behavior change from this. [1] https://docs.google.com/document/d/1pnnOAIz_DMWDI4oIOFoMAqLnf_MZ2GsrJNb_dbQ3ZBg/edit?usp=sha ing [2] https://groups.google.com/a/chromium.org/g/chromium-dev/c/vAEeVifyf78/m/SkBUc6PhBAAJ Bug: 1272324, 1073933