Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: PRESUBMIT.py

Issue 10519003: Added a base::Callback interface to FilePathWatcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/files/file_path_watcher.h » ('j') | base/files/file_path_watcher.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 0bb8ac8b69e43ab0407404e3851f651142808ccb..71342f19ff02ecc752e401ebc6f1d5071e33df65 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
« no previous file with comments | « no previous file | base/files/file_path_watcher.h » ('j') | base/files/file_path_watcher.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698