Index: third_party/WebKit/Source/bindings/scripts/code_generator_v8.py |
diff --git a/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py b/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py |
index 9c44520231c0d4613846461908a67855d20126ae..f77b32a2b6033cdae354b8bbc0ebc7058ab87ed6 100644 |
--- a/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py |
+++ b/third_party/WebKit/Source/bindings/scripts/code_generator_v8.py |
@@ -181,7 +181,14 @@ class CodeGeneratorV8(CodeGeneratorV8Base): |
include_paths = interface_info.get('dependencies_include_paths') |
# Select appropriate Jinja template and contents function |
- if interface.is_callback: |
+ # |
+ # A callback interface with constants needs a special handling. |
+ # https://heycam.github.io/webidl/#legacy-callback-interface-object |
+ if interface.is_callback and len(interface.constants) > 0: |
+ header_template_filename = 'legacy_callback_interface.h.tmpl' |
+ cpp_template_filename = 'legacy_callback_interface.cpp.tmpl' |
+ interface_context = v8_callback_interface.legacy_callback_interface_context |
+ elif interface.is_callback: |
header_template_filename = 'callback_interface.h.tmpl' |
cpp_template_filename = 'callback_interface.cpp.tmpl' |
interface_context = v8_callback_interface.callback_interface_context |