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

Unified Diff: third_party/WebKit/Source/bindings/templates/callback_function.h

Issue 2312093003: Generated bindings for IDL callback functions (Closed)
Patch Set: Addressed comments Created 4 years, 3 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_function.h
diff --git a/third_party/WebKit/Source/bindings/templates/callback_interface.h b/third_party/WebKit/Source/bindings/templates/callback_function.h
similarity index 52%
copy from third_party/WebKit/Source/bindings/templates/callback_interface.h
copy to third_party/WebKit/Source/bindings/templates/callback_function.h
index b94d2e920cb90bb073b841fba1085c0874c35972..5168e90f74b2b3bdd4ceb8bb6e9280c54cd2138c 100644
--- a/third_party/WebKit/Source/bindings/templates/callback_interface.h
+++ b/third_party/WebKit/Source/bindings/templates/callback_function.h
@@ -10,29 +10,28 @@
namespace blink {
-class {{v8_class}} final : public {{cpp_class}}, public ActiveDOMCallback {
- USING_GARBAGE_COLLECTED_MIXIN({{v8_class}});
+class ScriptState;
+
+class {{exported}}{{v8_class}} final : public GarbageCollectedFinalized<{{v8_class}}>{
+
public:
static {{v8_class}}* create(v8::Local<v8::Function> callback, ScriptState* scriptState)
peria 2016/09/15 01:14:32 if you don't need scriptState itself, please use "
lkawai 2016/09/16 05:05:50 Done.
{
- return new {{v8_class}}(callback, scriptState);
+ return new {{v8_class}}(callback, scriptState);
}
- ~{{v8_class}}() override;
+ {{v8_class}}(v8::Local<v8::Function>, ScriptState*);
peria 2016/09/15 01:14:32 If you have a create() method, I recommend to keep
lkawai 2016/09/16 05:05:50 Done.
+ ~{{v8_class}}() = default;
DECLARE_VIRTUAL_TRACE();
-{% for method in methods %}
- {{method.cpp_type}} {{method.name}}({{method.argument_declarations | join(', ')}}) override;
-{% endfor %}
-private:
- {{exported}}{{v8_class}}(v8::Local<v8::Function>, ScriptState*);
+ bool call({{argument_declarations | join(', ')}});
+private:
ScopedPersistent<v8::Function> m_callback;
- RefPtr<ScriptState> m_scriptState;
};
-}
+} // namespace blink
#endif // {{v8_class}}_h
{% endfilter %}{# format_blink_cpp_source_code #}

Powered by Google App Engine
This is Rietveld 408576698