summaryrefslogtreecommitdiff
path: root/chromium/PRESUBMIT.py
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-08-28 15:28:34 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-08-28 13:54:51 +0000
commit2a19c63448c84c1805fb1a585c3651318bb86ca7 (patch)
treeeb17888e8531aa6ee5e85721bd553b832a7e5156 /chromium/PRESUBMIT.py
parentb014812705fc80bff0a5c120dfcef88f349816dc (diff)
downloadqtwebengine-chromium-2a19c63448c84c1805fb1a585c3651318bb86ca7.tar.gz
BASELINE: Update Chromium to 69.0.3497.70
Change-Id: I2b7b56e4e7a8b26656930def0d4575dc32b900a0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/PRESUBMIT.py')
-rw-r--r--chromium/PRESUBMIT.py60
1 files changed, 44 insertions, 16 deletions
diff --git a/chromium/PRESUBMIT.py b/chromium/PRESUBMIT.py
index 0a40f6ea53c..e6173fc1062 100644
--- a/chromium/PRESUBMIT.py
+++ b/chromium/PRESUBMIT.py
@@ -585,9 +585,14 @@ _IPC_ENUM_TRAITS_DEPRECATED = (
'See http://www.chromium.org/Home/chromium-security/education/'
'security-tips-for-ipc')
+_LONG_PATH_ERROR = (
+ 'Some files included in this CL have file names that are too long (> 200'
+ ' characters). If committed, these files will cause issues on Windows. See'
+ ' https://crbug.com/612667 for more details.'
+)
+
_JAVA_MULTIPLE_DEFINITION_EXCLUDED_PATHS = [
r".*[\\\/]BuildHooksAndroidImpl\.java",
- r".*[\\\/]ClassRegisterImpl\.java",
r".*[\\\/]LicenseContentProvider\.java",
r".*[\\\/]PlatformServiceBridgeImpl.java",
]
@@ -650,8 +655,11 @@ _ALL_PYDEPS_FILES = _ANDROID_SPECIFIC_PYDEPS_FILES + _GENERIC_PYDEPS_FILES
_KNOWN_ROBOTS = set(
'%s-chromium-autoroll@skia-buildbots.google.com.iam.gserviceaccount.com' % s
for s in ('afdo', 'angle', 'catapult', 'chromite', 'depot-tools',
- 'fuchsia-sdk', 'nacl', 'pdfium', 'skia', 'src-internal', 'webrtc')
- ) | set('%s@appspot.gserviceaccount.com' % s for s in ('findit-for-me',))
+ 'fuchsia-sdk', 'nacl', 'pdfium', 'perfetto', 'skia',
+ 'src-internal', 'webrtc')
+ ) | set('%s@appspot.gserviceaccount.com' % s for s in ('findit-for-me',)
+ ) | set('%s@chops-service-accounts.iam.gserviceaccount.com' % s
+ for s in ('v8-ci-autoroll-builder',))
def _CheckNoProductionCodeUsingTestOnlyFunctions(input_api, output_api):
@@ -1855,6 +1863,7 @@ def _GetOwnersFilesToCheckForIpcOwners(input_api):
# matching the above patterns, which trigger false positives.
exclude_paths = [
'third_party/crashpad/*',
+ 'third_party/third_party/blink/renderer/platform/bindings/*',
'third_party/win_build_output/*',
]
@@ -2827,6 +2836,7 @@ def _CommonChecks(input_api, output_api):
results.extend(_CheckNoDeprecatedJs(input_api, output_api))
results.extend(_CheckParseErrors(input_api, output_api))
results.extend(_CheckForIPCRules(input_api, output_api))
+ results.extend(_CheckForLongPathnames(input_api, output_api))
results.extend(_CheckForIncludeGuards(input_api, output_api))
results.extend(_CheckForWindowsLineEndings(input_api, output_api))
results.extend(_CheckSingletonInHeaders(input_api, output_api))
@@ -3036,20 +3046,45 @@ def _CheckForIPCRules(input_api, output_api):
return []
+def _CheckForLongPathnames(input_api, output_api):
+ """Check to make sure no files being submitted have long paths.
+ This causes issues on Windows.
+ """
+ problems = []
+ for f in input_api.AffectedSourceFiles(None):
+ local_path = f.LocalPath()
+ # Windows has a path limit of 260 characters. Limit path length to 200 so
+ # that we have some extra for the prefix on dev machines and the bots.
+ if len(local_path) > 200:
+ problems.append(local_path)
+
+ if problems:
+ return [output_api.PresubmitError(_LONG_PATH_ERROR, problems)]
+ else:
+ return []
+
+
def _CheckForIncludeGuards(input_api, output_api):
"""Check that header files have proper guards against multiple inclusion.
If a file should not have such guards (and it probably should) then it
should include the string "no-include-guard-because-multiply-included".
"""
- def is_header_file(f):
- return f.LocalPath().endswith('.h')
+ def is_chromium_header_file(f):
+ # We only check header files under the control of the Chromium
+ # project. That is, those outside third_party apart from
+ # third_party/blink.
+ file_with_path = input_api.os_path.normpath(f.LocalPath())
+ return (file_with_path.endswith('.h') and
+ (not file_with_path.startswith('third_party') or
+ file_with_path.startswith(
+ input_api.os_path.join('third_party', 'blink'))))
def replace_special_with_underscore(string):
return input_api.re.sub(r'[\\/.-]', '_', string)
errors = []
- for f in input_api.AffectedSourceFiles(is_header_file):
+ for f in input_api.AffectedSourceFiles(is_chromium_header_file):
guard_name = None
guard_line_number = None
seen_guard_end = False
@@ -3098,16 +3133,9 @@ def _CheckForIncludeGuards(input_api, output_api):
guard_line_number = line_number
# We allow existing files to use include guards whose names
- # don't match the chromium style guide, but new files
- # (outside third_party) should get it right. The only part
- # of third_party we check is blink.
- should_check_strict_guard_name = (
- not f.OldContents() and
- (not file_with_path.startswith('third_party') or
- file_with_path.startswith(
- input_api.os_path.join('third_party', 'blink'))))
-
- if should_check_strict_guard_name:
+ # don't match the chromium style guide, but new files should
+ # get it right.
+ if not f.OldContents():
if guard_name != expected_guard:
errors.append(output_api.PresubmitPromptWarning(
'Header using the wrong include guard name %s' % guard_name,