1{% filter format_blink_cpp_source_code %}
2
3{% include 'copyright_block.txt' %}
4#ifndef {{header_guard}}
5#define {{header_guard}}
6
7{% for filename in header_includes %}
8#include "{{filename}}"
9{% endfor %}
10
11namespace blink {
12
13{% if optional_features %}
14class ScriptState;
15{% endif %}
16
17class {{v8_class_or_partial}} {
18  STATIC_ONLY({{v8_class_or_partial}});
19 public:
20  static void Initialize();
21  {% for method in methods if method.is_custom %}
22  static void {{method.camel_case_name}}MethodCustom(const v8::FunctionCallbackInfo<v8::Value>&);
23  {% endfor %}
24  {% for attribute in attributes %}
25  {% if attribute.has_custom_getter %}{# FIXME: and not attribute.implemented_by #}
26  static void {{attribute.camel_case_name}}AttributeGetterCustom(const v8::PropertyCallbackInfo<v8::Value>&);
27  {% endif %}
28  {% if attribute.has_custom_setter %}{# FIXME: and not attribute.implemented_by #}
29  static void {{attribute.camel_case_name}}AttributeSetterCustom(v8::Local<v8::Value>, const v8::PropertyCallbackInfo<void>&);
30  {% endif %}
31  {% endfor %}
32  {% if install_conditional_features_func %}
33  static void InstallConditionalFeatures(
34      v8::Local<v8::Context>,
35      const DOMWrapperWorld&,
36      v8::Local<v8::Object> instance,
37      v8::Local<v8::Object> prototype,
38      v8::Local<v8::Function> interface,
39      v8::Local<v8::FunctionTemplate> interface_template);
40  {% endif %}
41
42  {% for feature in optional_features %}
43  static void Install{{feature.name}}(ScriptState*, v8::Local<v8::Object> instance);
44  static void Install{{feature.name}}(v8::Isolate*, const DOMWrapperWorld&, v8::Local<v8::Object> instance, v8::Local<v8::Object> prototype, v8::Local<v8::Function> interface);
45  {% if not feature.needs_instance %}
46  static void Install{{feature.name}}(ScriptState*);
47  {% endif %}
48  {% endfor %}
49
50  static void InstallRuntimeEnabledFeaturesOnTemplate(
51      v8::Isolate*,
52      const DOMWrapperWorld&,
53      v8::Local<v8::FunctionTemplate> interface_template);
54
55  // Callback functions
56  {% for attribute in attributes %}
57  {% if attribute.is_cached_accessor %}
58  {{exported}}static v8::Local<v8::Private> {{attribute.camel_case_name}}CachedPropertyKey(v8::Isolate* isolate);
59  {% endif %}
60  {% for world_suffix in attribute.world_suffixes %}
61  {% if not attribute.constructor_type %}
62  {{exported}}static void {{attribute.camel_case_name}}AttributeGetterCallback{{world_suffix}}(
63    {%- if attribute.is_data_type_property %}
64    v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info
65    {%- else %}
66    const v8::FunctionCallbackInfo<v8::Value>& info
67    {%- endif %});
68  {% else %}
69  {{exported}}static void {{attribute.camel_case_name}}ConstructorGetterCallback{{world_suffix}}(v8::Local<v8::Name> property, const v8::PropertyCallbackInfo<v8::Value>& info);
70  {% endif %}
71  {% if attribute.has_setter %}
72  {{exported}}static void {{attribute.camel_case_name}}AttributeSetterCallback{{world_suffix}}(
73    {%- if attribute.is_data_type_property %}
74    v8::Local<v8::Name>, v8::Local<v8::Value> v8_value, const v8::PropertyCallbackInfo<void>& info
75    {%- else %}
76    const v8::FunctionCallbackInfo<v8::Value>& info
77    {%- endif %});
78  {% endif %}
79  {% endfor %}
80  {% endfor %}
81
82  {% for method in methods %}
83  {% for world_suffix in method.world_suffixes %}
84  {% if not method.overload_index or method.overloads %}
85  {# Document about the following condition: #}
86  {# https://docs.google.com/document/d/1qBC7Therp437Jbt_QYAtNYMZs6zQ_7_tnMkNUG_ACqs/edit?usp=sharing #}
87  {% if (method.overloads and method.overloads.visible and
88         (not method.overloads.has_partial_overloads or not is_partial)) or
89        (not method.overloads and method.visible) %}
90  {# A single callback is generated for overloaded methods #}
91  {# with considering partial overloads #}
92  {{exported}}static void {{method.camel_case_name}}MethodCallback{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info);
93  {% endif %}
94  {% endif %}
95  {% if method.is_cross_origin and method.visible %}
96  {{exported}}static void {{method.camel_case_name}}OriginSafeMethodGetterCallback{{world_suffix}}(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info);
97  {% endif %}
98  {% endfor %}
99  {% endfor %}
100  {% if iterator_method %}
101  {{exported}}static void {{iterator_method.camel_case_name}}MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info);
102  {% endif %}
103
104 private:
105  {% if needs_runtime_enabled_installer %}
106  static void InstallRuntimeEnabledFeaturesImpl(
107      v8::Isolate*,
108      const DOMWrapperWorld&,
109      v8::Local<v8::Object> instance,
110      v8::Local<v8::Object> prototype,
111      v8::Local<v8::Function> interface);
112
113  {% endif %}
114  static void Install{{v8_class}}Template(v8::Isolate*, const DOMWrapperWorld&, v8::Local<v8::FunctionTemplate> interface_template);
115};
116
117}  // namespace blink
118
119#endif  // {{header_guard}}
120
121{% endfilter %}{# format_blink_cpp_source_code #}
122