summaryrefslogtreecommitdiffstats
path: root/PRESUBMIT.py
diff options
context:
space:
mode:
authorjoaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-04 14:21:27 +0000
committerjoaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-04 14:21:27 +0000
commit10e38b62dec4cd25b15439ea33df703d1285fc88 (patch)
tree762d382eed1c8cb4db4778b9199d1003c2795daf /PRESUBMIT.py
parent385e26d28934bd5654da21f316733176e33e61e6 (diff)
downloadchromium_src-10e38b62dec4cd25b15439ea33df703d1285fc88.zip
chromium_src-10e38b62dec4cd25b15439ea33df703d1285fc88.tar.gz
chromium_src-10e38b62dec4cd25b15439ea33df703d1285fc88.tar.bz2
Added a base::Callback interface to FilePathWatcher.
BUG=130980 TEST=browser_tests:FilePathWatcher* are green Review URL: https://chromiumcodereview.appspot.com/10519003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140285 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'PRESUBMIT.py')
-rw-r--r--PRESUBMIT.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 0bb8ac8..71342f1 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -200,6 +200,23 @@ def _CheckNoScopedAllowIO(input_api, output_api):
'instead.\n' + '\n'.join(problems))]
+def _CheckNoFilePathWatcherDelegate(input_api, output_api):
+ """Make sure that FilePathWatcher::Delegate is not used."""
+ problems = []
+
+ file_filter = lambda f: f.LocalPath().endswith(('.cc', '.h'))
+ for f in input_api.AffectedFiles(file_filter=file_filter):
+ for line_num, line in f.ChangedContents():
+ if 'FilePathWatcher::Delegate' in line:
+ problems.append(' %s:%d' % (f.LocalPath(), line_num))
+
+ if not problems:
+ return []
+ return [output_api.PresubmitPromptWarning('New code should not use '
+ 'FilePathWatcher::Delegate. Use the callback interface instead.\n' +
+ '\n'.join(problems))]
+
+
def _CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
results = []
@@ -214,6 +231,7 @@ def _CommonChecks(input_api, output_api):
results.extend(_CheckNoDEPSGIT(input_api, output_api))
results.extend(_CheckNoFRIEND_TEST(input_api, output_api))
results.extend(_CheckNoScopedAllowIO(input_api, output_api))
+ results.extend(_CheckNoFilePathWatcherDelegate(input_api, output_api))
return results