Index: third_party/WebKit/Source/bindings/scripts/utilities.py |
diff --git a/third_party/WebKit/Source/bindings/scripts/utilities.py b/third_party/WebKit/Source/bindings/scripts/utilities.py |
index 98d42660595d63a766a5fb217003b9fc139be894..b75da4387174562aa453d9f5676ebf68c912d8d6 100644 |
--- a/third_party/WebKit/Source/bindings/scripts/utilities.py |
+++ b/third_party/WebKit/Source/bindings/scripts/utilities.py |
@@ -344,9 +344,12 @@ def write_pickle_file(pickle_filename, data): |
# Leading and trailing context (e.g. following '{') used to avoid false matches. |
################################################################################ |
-def is_callback_interface_from_idl(file_contents): |
+def is_non_legacy_callback_interface_from_idl(file_contents): |
+ """Returns True if the specified IDL is a non-legacy callback interface.""" |
match = re.search(r'callback\s+interface\s+\w+\s*{', file_contents) |
- return bool(match) |
+ # Having constants means it's a legacy callback interface. |
+ # https://heycam.github.io/webidl/#legacy-callback-interface-object |
+ return bool(match) and not re.search(r'\s+const\b', file_contents) |
def should_generate_impl_file_from_idl(file_contents): |