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

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_function.h b/third_party/WebKit/Source/bindings/templates/callback_function.h
new file mode 100644
index 0000000000000000000000000000000000000000..b72671a7ad76188e50f73da0a1e45f420b92c9e7
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/templates/callback_function.h
@@ -0,0 +1,37 @@
+{% filter format_blink_cpp_source_code %}
+
+{% include 'copyright_block.txt' %}
+#ifndef {{v8_class}}_h
+#define {{v8_class}}_h
+
+{% for filename in header_includes %}
+#include "{{filename}}"
+{% endfor %}
+
+namespace blink {
+
+class ScriptState;
+
+class {{exported}}{{v8_class}} final : public GarbageCollectedFinalized<{{v8_class}}>{
peria 2016/09/16 05:48:18 [style] put a space before '{'
lkawai 2016/09/16 10:03:20 Done.
+
+public:
+ static {{v8_class}}* create(v8::Isolate* isolate, v8::Local<v8::Function> callback)
+ {
+ return new {{v8_class}}(isolate, callback);
peria 2016/09/16 05:48:18 [style] 4 space indent
lkawai 2016/09/16 10:03:20 Done.
+ }
+
+ ~{{v8_class}}() = default;
+
+ DECLARE_VIRTUAL_TRACE();
peria 2016/09/16 05:48:18 DECLARE_TRACE(); JFYI: This class is a subclass o
lkawai 2016/09/16 10:03:19 Done.
+
+ bool call({{argument_declarations | join(', ')}});
+
+private:
+ {{v8_class}}(v8::Isolate* isolate, v8::Local<v8::Function>);
+ ScopedPersistent<v8::Function> m_callback;
+};
+
+} // namespace blink
+#endif // {{v8_class}}_h
+
+{% endfilter %}{# format_blink_cpp_source_code #}

Powered by Google App Engine
This is Rietveld 408576698