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

Unified Diff: PRESUBMIT.py

Issue 9423025: PRESUBMIT doesn't need to check for old callback system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PRESUBMIT.py
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index e6ef99b612efef5db337604e25f2acb53409b30c..d0305eea199bf2f8dc333f80b3f85b4424a9e4fb 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -182,35 +182,6 @@ def _CheckNoFRIEND_TEST(input_api, output_api):
'FRIEND_TEST_ALL_PREFIXES() instead.\n' + '\n'.join(problems))]
-def _CheckNoNewOldCallback(input_api, output_api):
- """Checks to make sure we don't introduce new uses of old callbacks."""
-
- def HasOldCallbackKeywords(line):
- """Returns True if a line of text contains keywords that indicate the use
- of the old callback system.
- """
- return ('NewRunnableMethod' in line or
- 'NewCallback' in line or
- input_api.re.search(r'\bCallback\d<', line) or
- input_api.re.search(r'\bpublic Task\b', line) or
- 'public CancelableTask' in line)
-
- problems = []
- file_filter = lambda f: f.LocalPath().endswith(('.cc', '.h'))
- for f in input_api.AffectedFiles(file_filter=file_filter):
- if not any(HasOldCallbackKeywords(line) for line in f.NewContents()):
- continue
- for line_num, line in f.ChangedContents():
- if HasOldCallbackKeywords(line):
- problems.append(' %s:%d' % (f.LocalPath(), line_num))
-
- if not problems:
- return []
- return [output_api.PresubmitPromptWarning('The old callback system is '
- 'deprecated. If possible, use base::Bind and base::Callback instead.\n' +
- '\n'.join(problems))]
-
-
def _CommonChecks(input_api, output_api):
"""Checks common to both upload and commit."""
results = []
@@ -224,7 +195,6 @@ def _CommonChecks(input_api, output_api):
results.extend(_CheckNoNewWStrings(input_api, output_api))
results.extend(_CheckNoDEPSGIT(input_api, output_api))
results.extend(_CheckNoFRIEND_TEST(input_api, output_api))
- results.extend(_CheckNoNewOldCallback(input_api, output_api))
return results
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698