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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 {% filter format_blink_cpp_source_code %}
2
3 {% include 'copyright_block.txt' %}
4
5 #ifndef {{v8_class}}_h
6 #define {{v8_class}}_h
7
8 {% for filename in header_includes %}
9 #include "{{filename}}"
10 {% endfor %}
11
12 namespace blink {
13
14 class ScriptState;
15
16 class {{exported}}{{v8_class}} final : public GarbageCollectedFinalized<{{v8_cla ss}}> {
17
18 public:
19 static {{v8_class}}* create(v8::Isolate* isolate, v8::Local<v8::Function> ca llback)
20 {
21 return new {{v8_class}}(isolate, callback);
22 }
23
24 ~{{v8_class}}() = default;
25
26 DECLARE_TRACE();
27
28 bool call({{argument_declarations | join(', ')}});
29
30 v8::Local<v8::Function> v8Value(v8::Isolate* isolate)
31 {
32 return m_callback.newLocal(isolate);
33 }
34
35 void setWrapperReference(v8::Isolate* isolate, const v8::Persistent<v8::Obje ct>& wrapper)
36 {
37 DCHECK(!m_callback.isEmpty());
38 m_callback.setReference(wrapper, isolate);
39 }
40
41 private:
42 {{v8_class}}(v8::Isolate* isolate, v8::Local<v8::Function>);
43 ScopedPersistent<v8::Function> m_callback;
44 };
45
46 } // namespace blink
47
48 #endif // {{v8_class}}_h
49
50 {% endfilter %}{# format_blink_cpp_source_code #}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698