| Index: media/PRESUBMIT.py
|
| diff --git a/media/PRESUBMIT.py b/media/PRESUBMIT.py
|
| index 993de38a7d0cb23b45d472c30d0284ecbfd82ad1..2c3bb52d7a778347b0420f99760059999a1937b5 100644
|
| --- a/media/PRESUBMIT.py
|
| +++ b/media/PRESUBMIT.py
|
| @@ -167,11 +167,30 @@ def _CheckPassByValue(input_api, output_api):
|
| return []
|
|
|
|
|
| +def _CheckForUseOfLazyInstance(input_api, output_api):
|
| + """Check that base::LazyInstance is not used."""
|
| +
|
| + problems = []
|
| +
|
| + lazy_instance_re = re.compile(r'(^|\W)base::LazyInstance<')
|
| +
|
| + for f in input_api.AffectedSourceFiles(_FilterFile):
|
| + for line_number, line in f.ChangedContents():
|
| + if lazy_instance_re.search(line):
|
| + problems.append('%s:%d' % (f, line_number))
|
| +
|
| + if problems:
|
| + return [output_api.PresubmitError(
|
| + 'base::LazyInstance is deprecated; use a thread safe static.', problems)]
|
| + return []
|
| +
|
| +
|
| def _CheckChange(input_api, output_api):
|
| results = []
|
| results.extend(_CheckForUseOfWrongClock(input_api, output_api))
|
| results.extend(_CheckPassByValue(input_api, output_api))
|
| results.extend(_CheckForHistogramOffByOne(input_api, output_api))
|
| + results.extend(_CheckForUseOfLazyInstance(input_api, output_api))
|
| return results
|
|
|
|
|
|
|