commit | e98d214c48dd94a2b4363b384e952a32258b9487 | [log] [tgz] |
---|---|---|
author | Arthur Sonzogni <[email protected]> | Thu Jun 01 15:02:25 2023 |
committer | Chromium LUCI CQ <[email protected]> | Thu Jun 01 15:02:25 2023 |
tree | 4ba4f7003f749ba46ea7268a3e7c704322443bcb | |
parent | 0847bf86459cd51bb1299a994100fd412493dd11 [diff] [blame] |
DanglingPointer: annotate for unittests base+linux [1/N] The DanglingPointerDetector is configured only when the test enters the ContentMain function. See https://crbug.com/1400059 I would like to configure it no matter the kind of test. For this to happen, we need to annotate every pre-existing dangling pointers. This patch annotates the ones you can find by running targets depending on the GoogleTest library. Statistic: This adds 1776 new DanglingUntriaged. Among them: - 1288 are in unittests. - 488 are in implementation. To produce those numbers, I used the command: ```bash git diff annotate-linux origin/main -- "*test*" | grep "DanglingUntriaged" | wc -l ``` This patch has been generated by: 1. Apply the "auto-annotator" patch: https://chromium-review.googlesource.com/c/chromium/src/+/4474553 2. Compile the compiler again: ```bash ./tools/clang/scripts/build.py ``` 3. List and run all the targets. You can use a bash script like: https://docs.google.com/document/d/1AMMERcqy0eafFWopUCHYsIKIKEp3J8DFxqW9UIbzIHo 4. Concatenate output, filter by "Found dangling ptr", sort, remove duplicate. 5. Apply the rewriter script from: https://github.com/ArthurSonzogni/chrome-dangling-ptr-apply-edit 6. Revert the "auto-annotate" patch. 7. Apply `git cl format` AX-Relnotes: n/a. Bug: chromium:1400059 Change-Id: I217d5c0b925da5176fc53baf95919a3690f1e9a3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4570424 Reviewed-by: danakj <[email protected]> Owners-Override: danakj <[email protected]> Commit-Queue: Arthur Sonzogni <[email protected]> Cr-Commit-Position: refs/heads/main@{#1151859}
diff --git a/components/visitedlink/test/visitedlink_unittest.cc b/components/visitedlink/test/visitedlink_unittest.cc index 10061132..e00784c 100644 --- a/components/visitedlink/test/visitedlink_unittest.cc +++ b/components/visitedlink/test/visitedlink_unittest.cc
@@ -734,8 +734,8 @@ void DeleteRenderProcessHosts() { processes_.clear(); } private: - raw_ptr<content::RenderProcessHostCreationObserver> creation_observer_ = - nullptr; + raw_ptr<content::RenderProcessHostCreationObserver, DanglingUntriaged> + creation_observer_ = nullptr; std::list<std::unique_ptr<VisitRelayingRenderProcessHost>> processes_; std::unique_ptr<VisitCountingContext> context_;