Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: third_party/WebKit/Source/bindings/scripts/code_generator_v8.py

Issue 2837923003: Make NodeFilter a legacy callback interface. (Closed)
Patch Set: templates.gni, etc. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698