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

Unified Diff: third_party/WebKit/Source/bindings/templates/callback_interface.h.tmpl

Issue 2837923003: Make NodeFilter a legacy callback interface. (Closed)
Patch Set: . 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/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

Powered by Google App Engine
This is Rietveld 408576698