Index: third_party/WebKit/Source/bindings/scripts/v8_callback_interface.py |
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_callback_interface.py b/third_party/WebKit/Source/bindings/scripts/v8_callback_interface.py |
index 8fbf18af19b93d0494c6adb358c5160f60aa13be..d87500f47e29a6673db0a7b82410a600d3680760 100644 |
--- a/third_party/WebKit/Source/bindings/scripts/v8_callback_interface.py |
+++ b/third_party/WebKit/Source/bindings/scripts/v8_callback_interface.py |
@@ -35,6 +35,7 @@ Design doc: http://www.chromium.org/developers/design-documents/idl-compiler |
from idl_types import IdlTypeBase |
from v8_globals import includes |
+from v8_interface import constant_context |
import v8_types |
import v8_utilities |
@@ -50,6 +51,13 @@ CALLBACK_INTERFACE_CPP_INCLUDES = frozenset([ |
'platform/wtf/GetPtr.h', |
'platform/wtf/RefPtr.h', |
]) |
+LEGACY_CALLBACK_INTERFACE_CPP_INCLUDES = frozenset([ |
+ 'bindings/core/v8/ScriptController.h', |
+ 'bindings/core/v8/V8BindingForCore.h', |
+ 'bindings/core/v8/V8DOMConfiguration.h', |
+ 'core/dom/ExecutionContext.h', |
+ 'platform/wtf/Assertions.h', |
+]) |
def cpp_type(idl_type): |
@@ -82,6 +90,20 @@ def callback_interface_context(callback_interface, _): |
} |
+def legacy_callback_interface_context(callback_interface, _): |
+ includes.clear() |
+ includes.update(LEGACY_CALLBACK_INTERFACE_CPP_INCLUDES) |
+ return { |
+ # TODO(tkent): Fix crbug.com/630986, and add 'methods'. |
bashi
2017/04/28 06:28:34
Feel free to change to TODO(bashi)
|
+ 'cpp_class': callback_interface.name, |
+ 'header_includes': set(CALLBACK_INTERFACE_H_INCLUDES), |
+ 'interface_name': callback_interface.name, |
+ 'constants': [constant_context(constant, callback_interface) |
bashi
2017/04/28 06:28:34
nit: alphabetical order
tkent
2017/04/28 09:22:01
Done.
|
+ for constant in callback_interface.constants], |
+ 'v8_class': v8_utilities.v8_class_name(callback_interface), |
+ } |
+ |
+ |
def add_includes_for_operation(operation): |
operation.idl_type.add_includes_for_type() |
for argument in operation.arguments: |