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

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

Issue 2312093003: Generated bindings for IDL callback functions (Closed)
Patch Set: Did rebase-update 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 51%
copy from third_party/WebKit/Source/bindings/templates/callback_interface.h
copy to third_party/WebKit/Source/bindings/templates/callback_function.h
index b94d2e920cb90bb073b841fba1085c0874c35972..759f14bc73bd266ef7032869ecd3ff089e889ccb 100644
--- a/third_party/WebKit/Source/bindings/templates/callback_interface.h
+++ b/third_party/WebKit/Source/bindings/templates/callback_function.h
@@ -10,29 +10,35 @@
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)
{
- return new {{v8_class}}(callback, scriptState);
+ return new {{v8_class}}(callback, scriptState);
}
- ~{{v8_class}}() override;
+ {{v8_class}}(v8::Local<v8::Function>, ScriptState*);
+ ~{{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(', ')}});
+ {% if rvalue_cpp_type != 'void' %}
+ {{rvalue_cpp_type}} getValue();
+ {% endif %}
+private:
ScopedPersistent<v8::Function> m_callback;
RefPtr<ScriptState> m_scriptState;
+ {% if rvalue_cpp_type != 'void' %}
+ {{member_cpp_type}} returnValue;
+ {% endif %}
};
-}
+} // namespace blink
#endif // {{v8_class}}_h
{% endfilter %}{# format_blink_cpp_source_code #}

Powered by Google App Engine
This is Rietveld 408576698