[go: nahoru, domu]

[BRP] Manual rewrite to raw_ptr on Mac

- This is a follow-up of https://crrev.com/c/4568700
- Add RAW_PTR_EXCLUSION to fields excluded from the automatic rewrite
- `content::ContentMainParams::autorelease_pool` is a manual rewrite
  to `raw_ptr` because `absl::optional` is safe with `raw_ptr`.

Change-Id: I6dcf846ed442df594a9102bd016c87cfe4af948c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4570453
Reviewed-by: Keishi Hattori <keishi@chromium.org>
Owners-Override: Keishi Hattori <keishi@chromium.org>
Commit-Queue: Mikihito Matsuura <mikt@google.com>
Cr-Commit-Position: refs/heads/main@{#1151142}
diff --git a/printing/printing_context_mac.h b/printing/printing_context_mac.h
index 53b106a1..59c6989 100644
--- a/printing/printing_context_mac.h
+++ b/printing/printing_context_mac.h
@@ -9,6 +9,7 @@
 #include <string>
 
 #include "base/mac/scoped_nsobject.h"
+#include "base/memory/raw_ptr_exclusion.h"
 #include "base/strings/string_piece.h"
 #include "printing/mojom/print.mojom.h"
 #include "printing/print_job_constants.h"
@@ -110,7 +111,9 @@
 
   // The current page's context; only valid between NewPage and PageDone call
   // pairs.
-  CGContext* context_;
+  // This field is not a raw_ptr<> because it was filtered by the rewriter
+  // for: #addr-of
+  RAW_PTR_EXCLUSION CGContext* context_;
 };
 
 }  // namespace printing