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..e7480a23e5d5e87d5a8c28ba171f08c96368344d 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 |
@@ -45,6 +46,7 @@ CALLBACK_INTERFACE_H_INCLUDES = frozenset([ |
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', |
'platform/wtf/GetPtr.h', |
@@ -73,12 +75,18 @@ IdlTypeBase.callback_cpp_type = property(cpp_type) |
def callback_interface_context(callback_interface, _): |
includes.clear() |
includes.update(CALLBACK_INTERFACE_CPP_INCLUDES) |
+ is_legacy = len(callback_interface.constants) > 0 |
return { |
'cpp_class': callback_interface.name, |
'v8_class': v8_utilities.v8_class_name(callback_interface), |
'header_includes': set(CALLBACK_INTERFACE_H_INCLUDES), |
- 'methods': [method_context(operation) |
- for operation in callback_interface.operations], |
+ 'methods': [] if is_legacy else [method_context(operation) |
bashi
2017/04/27 08:49:49
nit: We use alphabetical ordering in dicts.
bashi
2017/04/27 08:49:49
Why do we need to set an empty list when |is_legac
tkent
2017/04/27 09:15:12
Because method_context() crashes due to unsupporte
bashi
2017/04/27 23:12:32
Could you put the error log here? I'd prefer fixin
tkent
2017/04/28 00:09:43
Obviously, it's an intentional exception.
def met
bashi
2017/04/28 00:59:09
I see. Thank you for the explanation. Given that w
|
+ for operation in callback_interface.operations], |
+ 'is_legacy': is_legacy, |
+ # For legacy callback interface |
+ 'interface_name': callback_interface.name, |
+ 'constants': [constant_context(constant, callback_interface) |
+ for constant in callback_interface.constants], |
} |