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

Side by Side Diff: third_party/WebKit/Source/bindings/templates/callback_function.h.tmpl

Issue 2434763002: [wrapper-tracing] Bring remoteplayback up to date (Closed)
Patch Set: Reset bingings results Created 4 years, 2 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
1 {% filter format_blink_cpp_source_code %} 1 {% filter format_blink_cpp_source_code %}
2 2
3 {% include 'copyright_block.txt' %} 3 {% include 'copyright_block.txt' %}
4 4
5 #ifndef {{cpp_class}}_h 5 #ifndef {{cpp_class}}_h
6 #define {{cpp_class}}_h 6 #define {{cpp_class}}_h
7 7
8 {% for filename in header_includes %} 8 {% for filename in header_includes %}
9 #include "{{filename}}" 9 #include "{{filename}}"
10 {% endfor %} 10 {% endfor %}
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class ScriptState; 14 class ScriptState;
15 {% for forward_declaration in forward_declarations %} 15 {% for forward_declaration in forward_declarations %}
16 class {{forward_declaration}}; 16 class {{forward_declaration}};
17 {% endfor %} 17 {% endfor %}
18 18
19 class {{exported}}{{cpp_class}} final : public GarbageCollectedFinalized<{{cpp_c lass}}> { 19 class {{exported}}{{cpp_class}} final : public GarbageCollectedFinalized<{{cpp_c lass}}>,
20 public TraceWrapperBase {
20 21
21 public: 22 public:
22 static {{cpp_class}}* create(v8::Isolate* isolate, v8::Local<v8::Function> c allback) 23 static {{cpp_class}}* create(v8::Isolate* isolate, v8::Local<v8::Function> c allback)
23 { 24 {
24 return new {{cpp_class}}(isolate, callback); 25 return new {{cpp_class}}(isolate, callback);
25 } 26 }
26 27
27 ~{{cpp_class}}() = default; 28 ~{{cpp_class}}() = default;
28 29
29 DECLARE_TRACE(); 30 DECLARE_TRACE();
31 DECLARE_TRACE_WRAPPERS();
30 32
31 bool call({{argument_declarations | join(', ')}}); 33 bool call({{argument_declarations | join(', ')}});
32 34
33 v8::Local<v8::Function> v8Value(v8::Isolate* isolate) 35 v8::Local<v8::Function> v8Value(v8::Isolate* isolate)
34 { 36 {
35 return m_callback.newLocal(isolate); 37 return m_callback.newLocal(isolate);
36 } 38 }
37 39
38 void setWrapperReference(v8::Isolate* isolate, const v8::Persistent<v8::Obje ct>& wrapper) 40 void setWrapperReference(v8::Isolate* isolate, const v8::Persistent<v8::Obje ct>& wrapper)
39 { 41 {
40 DCHECK(!m_callback.isEmpty()); 42 DCHECK(!m_callback.isEmpty());
41 m_callback.setReference(wrapper, isolate); 43 m_callback.setReference(wrapper, isolate);
42 } 44 }
43 45
44 private: 46 private:
45 {{cpp_class}}(v8::Isolate* isolate, v8::Local<v8::Function>); 47 {{cpp_class}}(v8::Isolate* isolate, v8::Local<v8::Function>);
46 ScopedPersistent<v8::Function> m_callback; 48 ScopedPersistent<v8::Function> m_callback;
47 }; 49 };
48 50
49 } // namespace blink 51 } // namespace blink
50 52
51 #endif // {{cpp_class}}_h 53 #endif // {{cpp_class}}_h
52 54
53 {% endfilter %}{# format_blink_cpp_source_code #} 55 {% endfilter %}{# format_blink_cpp_source_code #}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698