[mojo] Add presubmit check for TypeConverter
This change adds a check preventing new usages of mojo::ConvertTo since
TypeConverter is deprecated. The check excludes /third_party/blink and
content/renderer paths for now.
Bug: 621383
Change-Id: I63b36171447863cdd9ee0c42f973c2a8480ee4a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1549453
Commit-Queue: Oksana Zhuravlova <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Ken Rockot <[email protected]>
Cr-Commit-Position: refs/heads/master@{#660438}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 279ae36b..8a635b8 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -767,6 +767,20 @@
True,
(),
),
+ (
+ 'mojo::ConvertTo',
+ (
+ 'mojo::ConvertTo and TypeConverter are deprecated. Please consider',
+ 'StructTraits / UnionTraits / EnumTraits / ArrayTraits / MapTraits /',
+ 'StringTraits if you would like to convert between custom types and',
+ 'the wire format of mojom types.'
+ ),
+ True,
+ (
+ r'^third_party/blink/.*\.(cc|h)$',
+ r'^content/renderer/.*\.(cc|h)$',
+ ),
+ ),
)