Commit 61f12810 authored by Eriko Kurimoto's avatar Eriko Kurimoto Committed by Commit Bot

Allow mojom-forward.h in public directories

This CL allows developers to use header files ending with 'mojom-forward.h'
in public directories.
Traditionally, we use 'mojom-shared.h' files, but we now have 'mojom-forward.h'
filed and it is better to use forward header files.
This is discussed here:
https://chromium.slack.com/archives/CGGGVPSQ4/p1580370782044400

Bug: n/a
Change-Id: I2bd1bd3d304d8a46e8df5bfd3ebc0d49f5497d22
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2032686Reviewed-by: default avatarHiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Reviewed-by: default avatarTakuto Ikuta <tikuta@chromium.org>
Reviewed-by: default avatarMakoto Shimazu <shimazu@chromium.org>
Commit-Queue: Eriko Kurimoto <elkurin@google.com>
Cr-Commit-Position: refs/heads/master@{#737241}
parent 139c1efd
......@@ -58,7 +58,7 @@ def _CheckForWrongMojomIncludes(input_api, output_api):
error_list = None
match = pattern.match(line)
if (match and match.group(1) not in allowed_interfaces):
if match.group(2) != '-shared':
if match.group(2) not in ('-shared', '-forward'):
if f.LocalPath().startswith(public_folder):
error_list = public_blink_mojom_errors
elif match.group(2) not in ('-blink', '-blink-forward', '-blink-test-utils'):
......@@ -73,13 +73,13 @@ def _CheckForWrongMojomIncludes(input_api, output_api):
if non_blink_mojom_errors:
results.append(output_api.PresubmitError(
'Files that include non-Blink variant mojoms found. '
'You must include .mojom-blink.h or .mojom-shared.h instead:',
'You must include .mojom-blink.h, .mojom-forward.h or .mojom-shared.h instead:',
non_blink_mojom_errors))
if public_blink_mojom_errors:
results.append(output_api.PresubmitError(
'Public blink headers using Blink variant mojoms found. '
'You must include .mojom-shared.h instead:',
'You must include .mojom-forward.h or .mojom-shared.h instead:',
public_blink_mojom_errors))
return results
......
......@@ -117,7 +117,7 @@ class PresubmitTest(unittest.TestCase):
MockOutputApi())
self.assertEquals(
'Public blink headers using Blink variant mojoms found. ' +
'You must include .mojom-shared.h instead:',
'You must include .mojom-forward.h or .mojom-shared.h instead:',
errors[0].message)
def testCheckInternalHeaderWithBlinkMojo(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment