Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / templates / callback_interface.h
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // This file has been auto-generated by {{code_generator}}. DO NOT MODIFY!
6
7 #ifndef {{v8_class}}_h
8 #define {{v8_class}}_h
9
10 {% filter conditional(conditional_string) %}
11 {% for filename in header_includes %}
12 #include "{{filename}}"
13 {% endfor %}
14
15 namespace WebCore {
16
17 class ExecutionContext;
18
19 class {{v8_class}} FINAL : public {{cpp_class}}, public ActiveDOMCallback {
20 public:
21     static PassOwnPtr<{{v8_class}}> create(v8::Handle<v8::Function> callback, ExecutionContext* context)
22     {
23         ASSERT(context);
24         return adoptPtr(new {{v8_class}}(callback, context));
25     }
26
27     virtual ~{{v8_class}}();
28
29 {% for method in methods %}
30     virtual {{method.cpp_type}} {{method.name}}({{method.argument_declarations | join(', ')}}) OVERRIDE;
31 {% endfor %}
32 private:
33     {{v8_class}}(v8::Handle<v8::Function>, ExecutionContext*);
34
35     ScopedPersistent<v8::Function> m_callback;
36     RefPtr<ScriptState> m_scriptState;
37 };
38
39 }
40 {% endfilter %}
41 #endif // {{v8_class}}_h