Reland: Deprecate mojo::DataPipe

This is the first step in eliminating mojo::DataPipe. Marking it as
deprecated with a comment and adding a DLOG (that only logs once per
process launch) will hopefully stop it from being used in new code.

Previous change was reverted due to log spam.

Bug: 944990
Change-Id: I492f7ac2038db31ce4af6a31a0b1a80570c46aef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1544798
Auto-Submit: Carlos Knippschild <[email protected]>
Reviewed-by: Andrew Grieve <[email protected]>
Reviewed-by: Ken Rockot <[email protected]>
Commit-Queue: Ken Rockot <[email protected]>
Cr-Commit-Position: refs/heads/master@{#648821}
diff --git a/PRESUBMIT_test.py b/PRESUBMIT_test.py
index 34456b1..a650950 100755
--- a/PRESUBMIT_test.py
+++ b/PRESUBMIT_test.py
@@ -1772,6 +1772,20 @@
     self.assertTrue('another/ios_file.mm' in errors[0].message)
     self.assertTrue('some/mac/file.mm' not in errors[0].message)
 
+  def testBannedMojoFunctions(self):
+    input_api = MockInputApi()
+    input_api.files = [
+      MockFile('some/cpp/problematic/file.cc',
+               ['mojo::DataPipe();']),
+      MockFile('some/cpp/ok/file.cc',
+               ['CreateDataPipe();']),
+    ]
+
+    errors = PRESUBMIT._CheckNoBannedFunctions(input_api, MockOutputApi())
+    self.assertEqual(1, len(errors))
+    self.assertTrue('some/cpp/problematic/file.cc' in errors[0].message)
+    self.assertTrue('some/cpp/ok/file.cc' not in errors[0].message)
+
 
 class NoProductionCodeUsingTestOnlyFunctionsTest(unittest.TestCase):
   def testTruePositives(self):