diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-05-24 11:40:17 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-05-24 12:42:11 +0000 |
commit | 5d87695f37678f96492b258bbab36486c59866b4 (patch) | |
tree | be9783bbaf04fb930c4d74ca9c00b5e7954c8bc6 /chromium/cc/PRESUBMIT.py | |
parent | 6c11fb357ec39bf087b8b632e2b1e375aef1b38b (diff) | |
download | qtwebengine-chromium-5d87695f37678f96492b258bbab36486c59866b4.tar.gz |
BASELINE: Update Chromium to 75.0.3770.56
Change-Id: I86d2007fd27a45d5797eee06f4c9369b8b50ac4f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/cc/PRESUBMIT.py')
-rw-r--r-- | chromium/cc/PRESUBMIT.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chromium/cc/PRESUBMIT.py b/chromium/cc/PRESUBMIT.py index 89f5675b100..0b6761a28f8 100644 --- a/chromium/cc/PRESUBMIT.py +++ b/chromium/cc/PRESUBMIT.py @@ -275,6 +275,27 @@ def CheckForUseOfWrongClock(input_api, else: return [] +def CheckForDisallowMacros(input_api, output_api, white_list=CC_SOURCE_FILES, black_list=None): + black_list = tuple(black_list or input_api.DEFAULT_BLACK_LIST) + source_file_filter = lambda x: input_api.FilterSourceFile(x, white_list, black_list) + + disallow_macro_files = [] + + for f in input_api.AffectedSourceFiles(source_file_filter): + contents = input_api.ReadFile(f, 'rb') + # DISALLOW macros are not allowed, use deleted constructors instead. + if re.search(r"\bDISALLOW_COPY\(", contents) or \ + re.search(r"\bDISALLOW_ASSIGN\(", contents) or \ + re.search(r"\bDISALLOW_COPY_AND_ASSIGN\(", contents) or \ + re.search(r"\bDISALLOW_IMPLICIT_CONSTRUCTORS\(", contents): + disallow_macro_files.append(f.LocalPath()) + + if disallow_macro_files: + return [output_api.PresubmitError( + 'The following files use DISALLOW* macros. In cc, please use deleted constructors/operators instead.', + items=disallow_macro_files)] + return [] + def CheckChangeOnUpload(input_api, output_api): results = [] results += CheckAsserts(input_api, output_api) @@ -286,4 +307,5 @@ def CheckChangeOnUpload(input_api, output_api): results += CheckNamespace(input_api, output_api) results += CheckForUseOfWrongClock(input_api, output_api) results += FindUselessIfdefs(input_api, output_api) + results += CheckForDisallowMacros(input_api, output_api) return results |