PRESUBMIT.py: Ban base::raw_ptr and base::raw_ref
This is a follow-up to:
https://chromium-review.googlesource.com/c/chromium/src/+/4773481
The shorter form without "base::" was the one meant to be used.
This patch add a BanRule in the PRESUBMIT to avoid regressions.
Bug: chromium:1472306
Change-Id: Ib0e7fdd5e9b1fd6abffa4dc07b48dbfa7f2846e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4793572
Commit-Queue: Arthur Sonzogni <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Reviewed-by: Bartek Nowierski <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Owners-Override: Lei Zhang <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1185327}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 838d7d1..7a61bf8 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -1623,6 +1623,28 @@
r'^third_party/blink/renderer/core/script/script_loader\.cc',
),
),
+ BanRule(
+ pattern = r'base::raw_ptr<',
+ explanation = (
+ 'Do not use base::raw_ptr, use raw_ptr.',
+ ),
+ treat_as_error = True,
+ excluded_paths = (
+ '^base/',
+ '^tools/',
+ ),
+ ),
+ BanRule(
+ pattern = r'base:raw_ref<',
+ explanation = (
+ 'Do not use base::raw_ref, use raw_ref.',
+ ),
+ treat_as_error = True,
+ excluded_paths = (
+ '^base/',
+ '^tools/',
+ ),
+ ),
)
_BANNED_MOJOM_PATTERNS : Sequence[BanRule] = (