| 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..c557976480d1299aa352b02b84c20f1885b4c488
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/bindings/templates/callback_function.h
|
| @@ -0,0 +1,40 @@
|
| +{% 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 {{exported}}{{v8_class}} final : public GarbageCollectedFinalized<{{v8_class}}>, public ActiveDOMCallback {
|
| + USING_GARBAGE_COLLECTED_MIXIN({{v8_class}});
|
| +
|
| +public:
|
| + static {{v8_class}}* create(v8::Local<v8::Function> callback, v8::Local<v8::Object> owner, ScriptState* scriptState)
|
| + {
|
| + return new {{v8_class}}(callback, owner, scriptState);
|
| + }
|
| +
|
| + {{exported}}{{v8_class}}(v8::Local<v8::Function>, v8::Local<v8::Object>, ScriptState*);
|
| + ~{{v8_class}}() override;
|
| +
|
| + DECLARE_VIRTUAL_TRACE();
|
| +
|
| + bool call({{argument_declarations | join(', ')}});
|
| + ExecutionContext* getExecutionContext() const { return ContextLifecycleObserver::getExecutionContext(); }
|
| + {{rvalue_cpp_type}} getValue();
|
| +
|
| +private:
|
| + ScopedPersistent<v8::Function> m_callback;
|
| + RefPtr<ScriptState> m_scriptState;
|
| + {{member_cpp_type}} returnValue;
|
| +};
|
| +
|
| +} // namespace blink
|
| +#endif // {{v8_class}}_h
|
| +
|
| +{% endfilter %}{# format_blink_cpp_source_code #}
|
|
|