summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/bindings/templates/callback_interface.h.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/bindings/templates/callback_interface.h.tmpl')
-rw-r--r--chromium/third_party/blink/renderer/bindings/templates/callback_interface.h.tmpl27
1 files changed, 12 insertions, 15 deletions
diff --git a/chromium/third_party/blink/renderer/bindings/templates/callback_interface.h.tmpl b/chromium/third_party/blink/renderer/bindings/templates/callback_interface.h.tmpl
index 50c2951dd58..2fdb7be87fb 100644
--- a/chromium/third_party/blink/renderer/bindings/templates/callback_interface.h.tmpl
+++ b/chromium/third_party/blink/renderer/bindings/templates/callback_interface.h.tmpl
@@ -1,9 +1,8 @@
{% filter format_blink_cpp_source_code %}
{% include 'copyright_block.txt' %}
-
-#ifndef {{v8_class}}_h
-#define {{v8_class}}_h
+#ifndef {{header_guard}}
+#define {{header_guard}}
{% for filename in header_includes %}
#include "{{filename}}"
@@ -20,7 +19,7 @@ class {{exported}}{{v8_class}} final : public CallbackInterfaceBase {
{% if is_legacy_callback_interface %}
// Support of "legacy callback interface"
static v8::Local<v8::FunctionTemplate> DomTemplate(v8::Isolate*, const DOMWrapperWorld&);
- static const WrapperTypeInfo wrapperTypeInfo;
+ static const WrapperTypeInfo wrapper_type_info;
// Constants
{% for constant in constants %}
static constexpr {{constant.cpp_type}} {{constant.name}} = {{constant.value}};
@@ -33,6 +32,14 @@ class {{exported}}{{v8_class}} final : public CallbackInterfaceBase {
// See also crbug.com/886588
static {{v8_class}}* CreateOrNull(v8::Local<v8::Object> callback_object);
+{% set single_operation_enum_value =
+ 'kSingleOperation' if is_single_operation_callback_interface else
+ 'kNotSingleOperation' %}
+ explicit {{v8_class}}(
+ v8::Local<v8::Object> callback_object,
+ v8::Local<v8::Context> callback_object_creation_context)
+ : CallbackInterfaceBase(callback_object, callback_object_creation_context,
+ {{single_operation_enum_value}}) {}
~{{v8_class}}() override = default;
// NameClient overrides:
@@ -65,16 +72,6 @@ class {{exported}}{{v8_class}} final : public CallbackInterfaceBase {
// This function may throw unlike InvokeAndReportException.
v8::Maybe<{{methods[0].cpp_type}}> InvokeWithoutRunnabilityCheck({{methods[0].argument_declarations | join(', ')}}) WARN_UNUSED_RESULT;
{% endif %}
-
- private:
-{% set single_operation_enum_value =
- 'kSingleOperation' if is_single_operation_callback_interface else
- 'kNotSingleOperation' %}
- explicit {{v8_class}}(
- v8::Local<v8::Object> callback_object,
- v8::Local<v8::Context> callback_object_creation_context)
- : CallbackInterfaceBase(callback_object, callback_object_creation_context,
- {{single_operation_enum_value}}) {}
};
template <>
@@ -113,6 +110,6 @@ Persistent<{{v8_class}}> WrapPersistent({{v8_class}}*) = delete;
} // namespace blink
-#endif // {{v8_class}}_h
+#endif // {{header_guard}}
{% endfilter %}{# format_blink_cpp_source_code #}