[go: nahoru, domu]

Automatically annotate dangling ExperimentalAsh pointers [9/N]

This patch is:
- Automated. See [automation] section.
- Not affecting users, only Chrome's CQ. See [no-op] section.

This is a split affecting:
- ash/
- chrome/browser/ui/ash/

Context:
--------
@bartekn is going to remove the `ExperimentalAsh` raw_ptr annotation.
This was a performance experiment to enable/disable MiraclePtr on a
subset of new pointers added for ChromeOS ash (non-lacros).

Before removing it, he needs to enable it by default in code. Enabling
MiraclePtr for them, causes the DanglingPointerDetector to be enforced.
To pass the CQ, we need to annotate pre-existing dangling pointer with
`DanglingUntriaged`. After enabling ExperimentalAsh feature, it won't be
allowed anymore for those pointers to become dangling.

Automation:
-----------
1. Enable the `PartitionAllocBackupRefPtrForAsh` feature flag.
2. Apply the 'annotator' CL: https://chromium-review.googlesource.com/c/chromium/src/+/4474553
3. Run all the gtests. See https://docs.google.com/document/d/1AMMERcqy0eafFWopUCHYsIKIKEp3J8DFxqW9UIbzIHo
4. Concatenate all the output_*, `filter`, `sort -nr`, `uniq`.
5. Run https://github.com/ArthurSonzogni/chrome-dangling-ptr-apply-edit
6. Run `git cl format`
7. Cherry-pick the patch created from (5)

no-op:
------
The DanglingPointerDetector is not enabled against users. It only
affects tests and chromium developers.

Cq-Include-Trybots: luci.chrome.try:chromeos-betty-pi-arc-chrome;luci.chrome.try:linux-chromeos-chrome
AX-Relnotes: n/a.
Bug: chromium:1441101
Change-Id: I346841ef3e72f8e7aca16a41f60fb60c46834e06
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4780711
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1184666}
diff --git a/ash/system/pcie_peripheral/pcie_peripheral_notification_controller_unittest.cc b/ash/system/pcie_peripheral/pcie_peripheral_notification_controller_unittest.cc
index 1a2e51d..95b3668a 100644
--- a/ash/system/pcie_peripheral/pcie_peripheral_notification_controller_unittest.cc
+++ b/ash/system/pcie_peripheral/pcie_peripheral_notification_controller_unittest.cc
@@ -144,7 +144,8 @@
   }
 
  private:
-  raw_ptr<MockNewWindowDelegate, ExperimentalAsh> new_window_delegate_primary_;
+  raw_ptr<MockNewWindowDelegate, DanglingUntriaged | ExperimentalAsh>
+      new_window_delegate_primary_;
   std::unique_ptr<TestNewWindowDelegateProvider> delegate_provider_;
 };