Chromium Code Reviews| 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 #} |