Add a note to URLFetcher that it shouldn't be use in content embedders.
Also add a presubmit warning to trigger on new/modified uses of
URLFetcher.
Bug: 746977, 598073
Change-Id: I962a9f9bdb0c8c533f5cc4e7ca5a919f917a89ca
Reviewed-on: https://chromium-review.googlesource.com/984512
Reviewed-by: Helen Li <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Commit-Queue: Matt Menke <[email protected]>
Cr-Commit-Position: refs/heads/master@{#546605}
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 199158e6..4cbe910 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -543,6 +543,24 @@
r'^third_party/sqlite/.*\.(c|cc|h)$',
),
),
+ (
+ 'net::URLFetcher',
+ (
+ 'net::URLFetcher should no longer be used in content embedders. ',
+ 'Instead, use network::SimpleURLLoader instead, which supports ',
+ 'an out-of-process network stack. ',
+ 'net::URLFetcher may still be used in binaries that do not embed',
+ 'content.',
+ ),
+ True,
+ (
+ r'^ios[\\\/].*\.(cc|h)$',
+ r'.*[\\\/]ios[\\\/].*\.(cc|h)$',
+ r'.*_ios\.(cc|h)$',
+ r'^net[\\\/].*\.(cc|h)$',
+ r'.*[\\\/]tools[\\\/].*\.(cc|h)$',
+ ),
+ ),
)