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

Unified Diff: media/PRESUBMIT.py

Issue 2668813002: Remove LazyInstance usage from media/ (Closed)
Patch Set: Fix presubmit comments. Created 3 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 | « content/renderer/media/webrtc/rtc_stats.cc ('k') | media/audio/audio_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « content/renderer/media/webrtc/rtc_stats.cc ('k') | media/audio/audio_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698