[go: nahoru, domu]

Reland^2 "Automated T* -> raw_ptr<T> rewrite 'refresh'"

It reverts the revert commit 89730423d1288fbd719f41205617ae79e1180c75
*and* undoes the rewrites in lock_impl.h (see PS2), which caused
crbug.com/1520734, possibly crbug.com/1518884 and regressions in
crbug.com/1519816 (and merged issues).

Original change's description:
> Automated T* -> raw_ptr<T> rewrite "refresh"
>
> PS1: automated rewrite
> PS2-PS5,PS7: unrewrite to fix compilation
> PS6,PS22: unrewrite non-automated exclusions
> PS8-PS20: apply DanglingUntriaged
> PS21: unrewrite to undo binary size increase
> PS23: remove no-longer-needed RAW_PTR_EXCLUSION, #includes & comments
>
> The code has changed since the "big rewrite" so some exclusions no
> longer apply. But also, the rewriter changed too:
> - No longer applies constexpr-related exclusions (raw_ptr<> support
>   was added)
> - union exclusion has been waived for std::optional and absl::variant,
>   since they invoke raw_ptr<>'s ctor/dtor correctly
> - Certain paths under //base are no longer need to be excluded, as
>   PartitionAlloc/raw_ptr no longer depends on them
>
> This CL also tries to popularize a better format of exclusion reasoning
> comments, e.g.:
>   // RAW_PTR_EXCLUSION: #addr-of, #global-scope
>   // RAW_PTR_EXCLUSION: Performance reasons ...
>   // RAW_PTR_EXCLUSION: #addr-of; Also: Another reason
> One comment per block of fields will suffice, if the reason is the
> same throughout, and no other comments are added in between.
> This format has advantages, like brevity (no more "not a raw_ptr<>
> because" blurb), and improved scriptability.
>
> Bug: 1446392
> Change-Id: I784ff0e461b2105bc01ad7b8570bb462613b24ce
> DanglingUntriaged-notes: automated rewrite.
> AX-Relnotes: n/a.
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5190661
> Reviewed-by: Keishi Hattori <keishi@chromium.org>
> Commit-Queue: Bartek Nowierski <bartekn@chromium.org>
> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
> Owners-Override: Keishi Hattori <keishi@chromium.org>
> Code-Coverage: findit-for-me@appspot.gserviceaccount.com <findit-for-me@appspot.gserviceaccount.com>
> Cr-Commit-Position: refs/heads/main@{#1247373}

Bug: 1446392
Change-Id: I2a2e8d97763d4ac8b7528359587689fd48e300dc
DanglingUntriaged-notes: automated rewrite.
AX-Relnotes: n/a.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5232280
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Auto-Submit: Bartek Nowierski <bartekn@chromium.org>
Owners-Override: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1252024}
diff --git a/cc/paint/paint_canvas.h b/cc/paint/paint_canvas.h
index 601f5344..2b86174f 100644
--- a/cc/paint/paint_canvas.h
+++ b/cc/paint/paint_canvas.h
@@ -7,7 +7,6 @@
 
 #include "base/compiler_specific.h"
 #include "base/memory/raw_ptr.h"
-#include "base/memory/raw_ptr_exclusion.h"
 #include "base/memory/ref_counted.h"
 #include "build/build_config.h"
 #include "cc/paint/node_id.h"
@@ -244,9 +243,8 @@
 
  private:
   raw_ptr<printing::MetafileSkia> metafile_ = nullptr;
-  // This field is not a raw_ptr<> because it was filtered by the rewriter for:
-  // #constexpr-ctor-field-initializer
-  RAW_PTR_EXCLUSION paint_preview::PaintPreviewTracker* tracker_ = nullptr;
+  raw_ptr<paint_preview::PaintPreviewTracker, DanglingUntriaged> tracker_ =
+      nullptr;
 };
 
 class CC_PAINT_EXPORT PaintCanvasAutoRestore {