Index: third_party/WebKit/Source/bindings/templates/callback_interface.h.tmpl |
diff --git a/third_party/WebKit/Source/bindings/templates/callback_interface.h.tmpl b/third_party/WebKit/Source/bindings/templates/callback_interface.h.tmpl |
index a38934ce1fe8f30d668ef498f0f7969f0c561a0f..bfd1c9f0d1361dee9ded77430192de1738b650f8 100644 |
--- a/third_party/WebKit/Source/bindings/templates/callback_interface.h.tmpl |
+++ b/third_party/WebKit/Source/bindings/templates/callback_interface.h.tmpl |
@@ -10,6 +10,22 @@ |
namespace blink { |
+{% if is_legacy %} |
+{# TODO(tkent): Merge two class declaration templates. |
+ Even if this is a legacy callback interface, we should generate a class |
+ to call a v8::Function or a method of a v8::Object. We don't do so now due |
+ to crbug.com/630986. |
+#} |
+class {{v8_class}} { |
Yuki
2017/04/27 12:18:29
nit: final?
tkent
2017/04/28 06:13:36
Done.
|
+ STATIC_ONLY({{v8_class}}); |
+ public: |
+ static v8::Local<v8::FunctionTemplate> DomTemplate(v8::Isolate*, const DOMWrapperWorld&); |
Yuki
2017/04/27 12:18:29
nit: {{exported}}
due to the snapshot project.
peria
2017/04/27 13:14:49
It is OK to keep callback interfaces' DomTemplate(
|
+ static const WrapperTypeInfo wrapperTypeInfo; |
Yuki
2017/04/27 12:18:29
nit: {{exported}}
due to the snapshot project.
peria
2017/04/27 13:14:49
Yes, please put it.
tkent
2017/04/28 06:13:37
Done.
|
+ static const int internalFieldCount = kV8DefaultWrapperInternalFieldCount; |
+}; |
+ |
+{% else %} {# is_legacy #} |
+ |
class {{v8_class}} final : public {{cpp_class}} { |
public: |
static {{v8_class}}* Create(v8::Local<v8::Function> callback, ScriptState* scriptState) { |
@@ -30,6 +46,7 @@ class {{v8_class}} final : public {{cpp_class}} { |
ScopedPersistent<v8::Function> m_callback; |
RefPtr<ScriptState> m_scriptState; |
}; |
+{% endif %} {# is_legacy #} |
} |
#endif // {{v8_class}}_h |