Commit 8552274e authored by raphael.kubo.da.costa's avatar raphael.kubo.da.costa Committed by Commit bot

bindings: Correctly expand all class/header dependencies in unions.

Prior to this CL, an IDL construct like this:

    void func((boolean or sequence<Element>) arg);

would generate two union files, BooleanOrElementSequence.cpp and
BooleanOrElementSequence.h. BooleanOrElementSequence.h contains declarations
such as:

    const HeapVector<Member<Element>>& getAsElementSequence() const;
    HeapVector<Member<Element>> m_elementSequence;

However, it does not forward-declare Element, nor does it include
Element.h (or V8Element.h). Only BooleanOrElementSequence.cpp includes
V8Element.h, leading to build failures.

This affected any types inside unions that require forward declarations
and additional headers to be included which were inside a container type,
such as a record or a sequence. For instance, the constructs below were all
problematic:
* (boolean or sequence<Element>)
* (float or sequence<(boolean or long)>)
* (double or record<ByteString, Element>)

Solve this by expanding v8_union._update_includes_and_forward_decls() and
making it more similar to code_generator_v8's depending_union_type() and
TypedefResolver:
* If we're parsing a container type (ie. a record or a sequence), we call
  the function recursively to make sure all headers/forward declarations are
  taken care of.
* If we're parsing a union type, the union was inside a container type (as
  otherwise it would have been broken up by us looping through flattened
  union members), in which case we forward-declare the union and include its
  header in the outer union's .cpp file.

BUG=701410
R=bashi@chromium.org,haraken@chromium.org,yukishiino@chromium.org

Review-Url: https://codereview.chromium.org/2750003003
Cr-Commit-Position: refs/heads/master@{#457381}
parent 5fd99fad
...@@ -300,7 +300,7 @@ class CodeGeneratorUnionType(CodeGeneratorBase): ...@@ -300,7 +300,7 @@ class CodeGeneratorUnionType(CodeGeneratorBase):
header_template = self.jinja_env.get_template('union_container.h.tmpl') header_template = self.jinja_env.get_template('union_container.h.tmpl')
cpp_template = self.jinja_env.get_template('union_container.cpp.tmpl') cpp_template = self.jinja_env.get_template('union_container.cpp.tmpl')
template_context = v8_union.container_context( template_context = v8_union.container_context(
union_type, self.info_provider.interfaces_info) union_type, self.info_provider)
template_context['header_includes'].append( template_context['header_includes'].append(
self.info_provider.include_path_for_export) self.info_provider.include_path_for_export)
template_context['header_includes'] = normalize_and_sort_includes( template_context['header_includes'] = normalize_and_sort_includes(
......
...@@ -34,7 +34,7 @@ header_forward_decls = set() ...@@ -34,7 +34,7 @@ header_forward_decls = set()
header_includes = set() header_includes = set()
def container_context(union_type, interfaces_info): def container_context(union_type, info_provider):
cpp_includes.clear() cpp_includes.clear()
header_forward_decls.clear() header_forward_decls.clear()
header_includes.clear() header_includes.clear()
...@@ -55,7 +55,7 @@ def container_context(union_type, interfaces_info): ...@@ -55,7 +55,7 @@ def container_context(union_type, interfaces_info):
record_type = None record_type = None
string_type = None string_type = None
for member in sorted(union_type.flattened_member_types, key=lambda m: m.name): for member in sorted(union_type.flattened_member_types, key=lambda m: m.name):
context = member_context(member, interfaces_info) context = member_context(member, info_provider)
members.append(context) members.append(context)
if member.base_type == 'ArrayBuffer': if member.base_type == 'ArrayBuffer':
if array_buffer_type: if array_buffer_type:
...@@ -123,7 +123,8 @@ def container_context(union_type, interfaces_info): ...@@ -123,7 +123,8 @@ def container_context(union_type, interfaces_info):
} }
def _update_includes_and_forward_decls(member, interface_info): def _update_includes_and_forward_decls(member, info_provider):
interface_info = info_provider.interfaces_info.get(member.name, None)
if interface_info: if interface_info:
cpp_includes.update(interface_info.get( cpp_includes.update(interface_info.get(
'dependencies_include_paths', [])) 'dependencies_include_paths', []))
...@@ -135,16 +136,22 @@ def _update_includes_and_forward_decls(member, interface_info): ...@@ -135,16 +136,22 @@ def _update_includes_and_forward_decls(member, interface_info):
header_forward_decls.add(member.implemented_as) header_forward_decls.add(member.implemented_as)
else: else:
if member.is_record_type: if member.is_record_type:
# The headers for both T and U must be present when _update_includes_and_forward_decls(member.key_type, info_provider)
# Vector<std::pair<T, U>> is declared. _update_includes_and_forward_decls(member.value_type, info_provider)
header_includes.update(member.includes_for_type()) elif member.is_array_or_sequence_type:
_update_includes_and_forward_decls(member.element_type, info_provider)
else: else:
cpp_includes.update(member.includes_for_type()) if member.is_union_type:
# Reaching this block means we have a union that is inside a
# record or sequence.
header_forward_decls.add(member.name)
cpp_includes.update([info_provider.include_path_for_union_types(member)])
else:
cpp_includes.update(member.includes_for_type())
def member_context(member, interfaces_info): def member_context(member, info_provider):
interface_info = interfaces_info.get(member.name, None) _update_includes_and_forward_decls(member, info_provider)
_update_includes_and_forward_decls(member, interface_info)
if member.is_nullable: if member.is_nullable:
member = member.inner_type member = member.inner_type
return { return {
......
...@@ -331,6 +331,10 @@ interface TestObject { ...@@ -331,6 +331,10 @@ interface TestObject {
void voidMethodDoubleOrNullOrDOMStringArg((double? or DOMString) arg); void voidMethodDoubleOrNullOrDOMStringArg((double? or DOMString) arg);
void voidMethodDOMStringOrArrayBufferOrArrayBufferViewArg((DOMString or ArrayBuffer or ArrayBufferView) arg); void voidMethodDOMStringOrArrayBufferOrArrayBufferViewArg((DOMString or ArrayBuffer or ArrayBufferView) arg);
void voidMethodArrayBufferOrArrayBufferViewOrDictionaryArg((ArrayBuffer or ArrayBufferView or Dictionary) arg); void voidMethodArrayBufferOrArrayBufferViewOrDictionaryArg((ArrayBuffer or ArrayBufferView or Dictionary) arg);
// Unions with types that need extra includes/forward declarations in container types
void voidMethodBooleanOrElementSequenceArg((BooleanType or sequence<Element>) arg);
void voidMethodDoubleOrLongOrBooleanSequenceArg((double or sequence<(long or boolean)>) arg);
void voidMethodElementSequenceOrByteStringDoubleOrStringRecord((sequence<Element> or record<ByteString, (double or DOMString)>) arg);
// Array of Union types // Array of Union types
void voidMethodArrayOfDoubleOrDOMStringArg((double or DOMString)... arg); void voidMethodArrayOfDoubleOrDOMStringArg((double or DOMString)... arg);
// Currently only used on interface type arguments // Currently only used on interface type arguments
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file has been auto-generated by code_generator_v8.py.
// DO NOT MODIFY!
// This file has been generated from the Jinja2 template in
// third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl
// clang-format off
#include "BooleanOrElementSequence.h"
#include "bindings/core/v8/IDLTypes.h"
#include "bindings/core/v8/NativeValueTraitsImpl.h"
#include "bindings/core/v8/ToV8.h"
#include "bindings/core/v8/V8Element.h"
#include "core/animation/ElementAnimation.h"
#include "core/dom/ChildNode.h"
#include "core/dom/ElementFullscreen.h"
#include "core/dom/NonDocumentTypeChildNode.h"
#include "core/dom/ParentNode.h"
namespace blink {
BooleanOrElementSequence::BooleanOrElementSequence() : m_type(SpecificTypeNone) {}
bool BooleanOrElementSequence::getAsBoolean() const {
DCHECK(isBoolean());
return m_boolean;
}
void BooleanOrElementSequence::setBoolean(bool value) {
DCHECK(isNull());
m_boolean = value;
m_type = SpecificTypeBoolean;
}
BooleanOrElementSequence BooleanOrElementSequence::fromBoolean(bool value) {
BooleanOrElementSequence container;
container.setBoolean(value);
return container;
}
const HeapVector<Member<Element>>& BooleanOrElementSequence::getAsElementSequence() const {
DCHECK(isElementSequence());
return m_elementSequence;
}
void BooleanOrElementSequence::setElementSequence(const HeapVector<Member<Element>>& value) {
DCHECK(isNull());
m_elementSequence = value;
m_type = SpecificTypeElementSequence;
}
BooleanOrElementSequence BooleanOrElementSequence::fromElementSequence(const HeapVector<Member<Element>>& value) {
BooleanOrElementSequence container;
container.setElementSequence(value);
return container;
}
BooleanOrElementSequence::BooleanOrElementSequence(const BooleanOrElementSequence&) = default;
BooleanOrElementSequence::~BooleanOrElementSequence() = default;
BooleanOrElementSequence& BooleanOrElementSequence::operator=(const BooleanOrElementSequence&) = default;
DEFINE_TRACE(BooleanOrElementSequence) {
visitor->trace(m_elementSequence);
}
void V8BooleanOrElementSequence::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, BooleanOrElementSequence& impl, UnionTypeConversionMode conversionMode, ExceptionState& exceptionState) {
if (v8Value.IsEmpty())
return;
if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull(v8Value))
return;
if (v8Value->IsArray()) {
HeapVector<Member<Element>> cppValue = toMemberNativeArray<Element>(v8Value, 0, isolate, exceptionState);
if (exceptionState.hadException())
return;
impl.setElementSequence(cppValue);
return;
}
if (v8Value->IsBoolean()) {
impl.setBoolean(v8Value.As<v8::Boolean>()->Value());
return;
}
{
impl.setBoolean(v8Value->BooleanValue());
return;
}
}
v8::Local<v8::Value> ToV8(const BooleanOrElementSequence& impl, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) {
switch (impl.m_type) {
case BooleanOrElementSequence::SpecificTypeNone:
return v8::Null(isolate);
case BooleanOrElementSequence::SpecificTypeBoolean:
return v8Boolean(impl.getAsBoolean(), isolate);
case BooleanOrElementSequence::SpecificTypeElementSequence:
return ToV8(impl.getAsElementSequence(), creationContext, isolate);
default:
NOTREACHED();
}
return v8::Local<v8::Value>();
}
BooleanOrElementSequence NativeValueTraits<BooleanOrElementSequence>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) {
BooleanOrElementSequence impl;
V8BooleanOrElementSequence::toImpl(isolate, value, impl, UnionTypeConversionMode::NotNullable, exceptionState);
return impl;
}
} // namespace blink
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file has been auto-generated by code_generator_v8.py.
// DO NOT MODIFY!
// This file has been generated from the Jinja2 template in
// third_party/WebKit/Source/bindings/templates/union_container.h.tmpl
// clang-format off
#ifndef BooleanOrElementSequence_h
#define BooleanOrElementSequence_h
#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/NativeValueTraits.h"
#include "bindings/core/v8/V8Binding.h"
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
namespace blink {
class Element;
class CORE_EXPORT BooleanOrElementSequence final {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
public:
BooleanOrElementSequence();
bool isNull() const { return m_type == SpecificTypeNone; }
bool isBoolean() const { return m_type == SpecificTypeBoolean; }
bool getAsBoolean() const;
void setBoolean(bool);
static BooleanOrElementSequence fromBoolean(bool);
bool isElementSequence() const { return m_type == SpecificTypeElementSequence; }
const HeapVector<Member<Element>>& getAsElementSequence() const;
void setElementSequence(const HeapVector<Member<Element>>&);
static BooleanOrElementSequence fromElementSequence(const HeapVector<Member<Element>>&);
BooleanOrElementSequence(const BooleanOrElementSequence&);
~BooleanOrElementSequence();
BooleanOrElementSequence& operator=(const BooleanOrElementSequence&);
DECLARE_TRACE();
private:
enum SpecificTypes {
SpecificTypeNone,
SpecificTypeBoolean,
SpecificTypeElementSequence,
};
SpecificTypes m_type;
bool m_boolean;
HeapVector<Member<Element>> m_elementSequence;
friend CORE_EXPORT v8::Local<v8::Value> ToV8(const BooleanOrElementSequence&, v8::Local<v8::Object>, v8::Isolate*);
};
class V8BooleanOrElementSequence final {
public:
CORE_EXPORT static void toImpl(v8::Isolate*, v8::Local<v8::Value>, BooleanOrElementSequence&, UnionTypeConversionMode, ExceptionState&);
};
CORE_EXPORT v8::Local<v8::Value> ToV8(const BooleanOrElementSequence&, v8::Local<v8::Object>, v8::Isolate*);
template <class CallbackInfo>
inline void v8SetReturnValue(const CallbackInfo& callbackInfo, BooleanOrElementSequence& impl) {
v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
}
template <class CallbackInfo>
inline void v8SetReturnValue(const CallbackInfo& callbackInfo, BooleanOrElementSequence& impl, v8::Local<v8::Object> creationContext) {
v8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIsolate()));
}
template <>
struct NativeValueTraits<BooleanOrElementSequence> : public NativeValueTraitsBase<BooleanOrElementSequence> {
CORE_EXPORT static BooleanOrElementSequence nativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&);
};
template <>
struct V8TypeOf<BooleanOrElementSequence> {
typedef V8BooleanOrElementSequence Type;
};
} // namespace blink
// We need to set canInitializeWithMemset=true because HeapVector supports
// items that can initialize with memset or have a vtable. It is safe to
// set canInitializeWithMemset=true for a union type object in practice.
// See https://codereview.chromium.org/1118993002/#msg5 for more details.
WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::BooleanOrElementSequence);
#endif // BooleanOrElementSequence_h
...@@ -14,9 +14,7 @@ ...@@ -14,9 +14,7 @@
#include "bindings/core/v8/Dictionary.h" #include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/IDLTypes.h"
#include "bindings/core/v8/NativeValueTraits.h" #include "bindings/core/v8/NativeValueTraits.h"
#include "bindings/core/v8/NativeValueTraitsImpl.h"
#include "bindings/core/v8/V8Binding.h" #include "bindings/core/v8/V8Binding.h"
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file has been auto-generated by code_generator_v8.py.
// DO NOT MODIFY!
// This file has been generated from the Jinja2 template in
// third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl
// clang-format off
#include "DoubleOrLongOrBooleanSequence.h"
#include "bindings/core/v8/IDLTypes.h"
#include "bindings/core/v8/LongOrBoolean.h"
#include "bindings/core/v8/NativeValueTraitsImpl.h"
#include "bindings/core/v8/ToV8.h"
namespace blink {
DoubleOrLongOrBooleanSequence::DoubleOrLongOrBooleanSequence() : m_type(SpecificTypeNone) {}
double DoubleOrLongOrBooleanSequence::getAsDouble() const {
DCHECK(isDouble());
return m_double;
}
void DoubleOrLongOrBooleanSequence::setDouble(double value) {
DCHECK(isNull());
m_double = value;
m_type = SpecificTypeDouble;
}
DoubleOrLongOrBooleanSequence DoubleOrLongOrBooleanSequence::fromDouble(double value) {
DoubleOrLongOrBooleanSequence container;
container.setDouble(value);
return container;
}
const HeapVector<LongOrBoolean>& DoubleOrLongOrBooleanSequence::getAsLongOrBooleanSequence() const {
DCHECK(isLongOrBooleanSequence());
return m_longOrBooleanSequence;
}
void DoubleOrLongOrBooleanSequence::setLongOrBooleanSequence(const HeapVector<LongOrBoolean>& value) {
DCHECK(isNull());
m_longOrBooleanSequence = value;
m_type = SpecificTypeLongOrBooleanSequence;
}
DoubleOrLongOrBooleanSequence DoubleOrLongOrBooleanSequence::fromLongOrBooleanSequence(const HeapVector<LongOrBoolean>& value) {
DoubleOrLongOrBooleanSequence container;
container.setLongOrBooleanSequence(value);
return container;
}
DoubleOrLongOrBooleanSequence::DoubleOrLongOrBooleanSequence(const DoubleOrLongOrBooleanSequence&) = default;
DoubleOrLongOrBooleanSequence::~DoubleOrLongOrBooleanSequence() = default;
DoubleOrLongOrBooleanSequence& DoubleOrLongOrBooleanSequence::operator=(const DoubleOrLongOrBooleanSequence&) = default;
DEFINE_TRACE(DoubleOrLongOrBooleanSequence) {
visitor->trace(m_longOrBooleanSequence);
}
void V8DoubleOrLongOrBooleanSequence::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, DoubleOrLongOrBooleanSequence& impl, UnionTypeConversionMode conversionMode, ExceptionState& exceptionState) {
if (v8Value.IsEmpty())
return;
if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull(v8Value))
return;
if (v8Value->IsArray()) {
HeapVector<LongOrBoolean> cppValue = toImplArray<HeapVector<LongOrBoolean>>(v8Value, 0, isolate, exceptionState);
if (exceptionState.hadException())
return;
impl.setLongOrBooleanSequence(cppValue);
return;
}
if (v8Value->IsNumber()) {
double cppValue = NativeValueTraits<IDLDouble>::nativeValue(isolate, v8Value, exceptionState);
if (exceptionState.hadException())
return;
impl.setDouble(cppValue);
return;
}
{
double cppValue = NativeValueTraits<IDLDouble>::nativeValue(isolate, v8Value, exceptionState);
if (exceptionState.hadException())
return;
impl.setDouble(cppValue);
return;
}
}
v8::Local<v8::Value> ToV8(const DoubleOrLongOrBooleanSequence& impl, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) {
switch (impl.m_type) {
case DoubleOrLongOrBooleanSequence::SpecificTypeNone:
return v8::Null(isolate);
case DoubleOrLongOrBooleanSequence::SpecificTypeDouble:
return v8::Number::New(isolate, impl.getAsDouble());
case DoubleOrLongOrBooleanSequence::SpecificTypeLongOrBooleanSequence:
return ToV8(impl.getAsLongOrBooleanSequence(), creationContext, isolate);
default:
NOTREACHED();
}
return v8::Local<v8::Value>();
}
DoubleOrLongOrBooleanSequence NativeValueTraits<DoubleOrLongOrBooleanSequence>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) {
DoubleOrLongOrBooleanSequence impl;
V8DoubleOrLongOrBooleanSequence::toImpl(isolate, value, impl, UnionTypeConversionMode::NotNullable, exceptionState);
return impl;
}
} // namespace blink
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file has been auto-generated by code_generator_v8.py.
// DO NOT MODIFY!
// This file has been generated from the Jinja2 template in
// third_party/WebKit/Source/bindings/templates/union_container.h.tmpl
// clang-format off
#ifndef DoubleOrLongOrBooleanSequence_h
#define DoubleOrLongOrBooleanSequence_h
#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/NativeValueTraits.h"
#include "bindings/core/v8/V8Binding.h"
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
namespace blink {
class LongOrBoolean;
class CORE_EXPORT DoubleOrLongOrBooleanSequence final {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
public:
DoubleOrLongOrBooleanSequence();
bool isNull() const { return m_type == SpecificTypeNone; }
bool isDouble() const { return m_type == SpecificTypeDouble; }
double getAsDouble() const;
void setDouble(double);
static DoubleOrLongOrBooleanSequence fromDouble(double);
bool isLongOrBooleanSequence() const { return m_type == SpecificTypeLongOrBooleanSequence; }
const HeapVector<LongOrBoolean>& getAsLongOrBooleanSequence() const;
void setLongOrBooleanSequence(const HeapVector<LongOrBoolean>&);
static DoubleOrLongOrBooleanSequence fromLongOrBooleanSequence(const HeapVector<LongOrBoolean>&);
DoubleOrLongOrBooleanSequence(const DoubleOrLongOrBooleanSequence&);
~DoubleOrLongOrBooleanSequence();
DoubleOrLongOrBooleanSequence& operator=(const DoubleOrLongOrBooleanSequence&);
DECLARE_TRACE();
private:
enum SpecificTypes {
SpecificTypeNone,
SpecificTypeDouble,
SpecificTypeLongOrBooleanSequence,
};
SpecificTypes m_type;
double m_double;
HeapVector<LongOrBoolean> m_longOrBooleanSequence;
friend CORE_EXPORT v8::Local<v8::Value> ToV8(const DoubleOrLongOrBooleanSequence&, v8::Local<v8::Object>, v8::Isolate*);
};
class V8DoubleOrLongOrBooleanSequence final {
public:
CORE_EXPORT static void toImpl(v8::Isolate*, v8::Local<v8::Value>, DoubleOrLongOrBooleanSequence&, UnionTypeConversionMode, ExceptionState&);
};
CORE_EXPORT v8::Local<v8::Value> ToV8(const DoubleOrLongOrBooleanSequence&, v8::Local<v8::Object>, v8::Isolate*);
template <class CallbackInfo>
inline void v8SetReturnValue(const CallbackInfo& callbackInfo, DoubleOrLongOrBooleanSequence& impl) {
v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
}
template <class CallbackInfo>
inline void v8SetReturnValue(const CallbackInfo& callbackInfo, DoubleOrLongOrBooleanSequence& impl, v8::Local<v8::Object> creationContext) {
v8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIsolate()));
}
template <>
struct NativeValueTraits<DoubleOrLongOrBooleanSequence> : public NativeValueTraitsBase<DoubleOrLongOrBooleanSequence> {
CORE_EXPORT static DoubleOrLongOrBooleanSequence nativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&);
};
template <>
struct V8TypeOf<DoubleOrLongOrBooleanSequence> {
typedef V8DoubleOrLongOrBooleanSequence Type;
};
} // namespace blink
// We need to set canInitializeWithMemset=true because HeapVector supports
// items that can initialize with memset or have a vtable. It is safe to
// set canInitializeWithMemset=true for a union type object in practice.
// See https://codereview.chromium.org/1118993002/#msg5 for more details.
WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::DoubleOrLongOrBooleanSequence);
#endif // DoubleOrLongOrBooleanSequence_h
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
// clang-format off // clang-format off
#include "DoubleOrStringOrDoubleOrStringSequence.h" #include "DoubleOrStringOrDoubleOrStringSequence.h"
#include "bindings/core/v8/DoubleOrString.h"
#include "bindings/core/v8/IDLTypes.h" #include "bindings/core/v8/IDLTypes.h"
#include "bindings/core/v8/NativeValueTraitsImpl.h" #include "bindings/core/v8/NativeValueTraitsImpl.h"
#include "bindings/core/v8/ToV8.h" #include "bindings/core/v8/ToV8.h"
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
namespace blink { namespace blink {
class DoubleOrString;
class CORE_EXPORT DoubleOrStringOrDoubleOrStringSequence final { class CORE_EXPORT DoubleOrStringOrDoubleOrStringSequence final {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
public: public:
......
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file has been auto-generated by code_generator_v8.py.
// DO NOT MODIFY!
// This file has been generated from the Jinja2 template in
// third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl
// clang-format off
#include "ElementSequenceOrByteStringDoubleOrStringRecord.h"
#include "bindings/core/v8/DoubleOrString.h"
#include "bindings/core/v8/IDLTypes.h"
#include "bindings/core/v8/NativeValueTraitsImpl.h"
#include "bindings/core/v8/ToV8.h"
#include "bindings/core/v8/V8Element.h"
#include "core/animation/ElementAnimation.h"
#include "core/dom/ChildNode.h"
#include "core/dom/ElementFullscreen.h"
#include "core/dom/NonDocumentTypeChildNode.h"
#include "core/dom/ParentNode.h"
namespace blink {
ElementSequenceOrByteStringDoubleOrStringRecord::ElementSequenceOrByteStringDoubleOrStringRecord() : m_type(SpecificTypeNone) {}
const HeapVector<std::pair<String, DoubleOrString>>& ElementSequenceOrByteStringDoubleOrStringRecord::getAsByteStringDoubleOrStringRecord() const {
DCHECK(isByteStringDoubleOrStringRecord());
return m_byteStringDoubleOrStringRecord;
}
void ElementSequenceOrByteStringDoubleOrStringRecord::setByteStringDoubleOrStringRecord(const HeapVector<std::pair<String, DoubleOrString>>& value) {
DCHECK(isNull());
m_byteStringDoubleOrStringRecord = value;
m_type = SpecificTypeByteStringDoubleOrStringRecord;
}
ElementSequenceOrByteStringDoubleOrStringRecord ElementSequenceOrByteStringDoubleOrStringRecord::fromByteStringDoubleOrStringRecord(const HeapVector<std::pair<String, DoubleOrString>>& value) {
ElementSequenceOrByteStringDoubleOrStringRecord container;
container.setByteStringDoubleOrStringRecord(value);
return container;
}
const HeapVector<Member<Element>>& ElementSequenceOrByteStringDoubleOrStringRecord::getAsElementSequence() const {
DCHECK(isElementSequence());
return m_elementSequence;
}
void ElementSequenceOrByteStringDoubleOrStringRecord::setElementSequence(const HeapVector<Member<Element>>& value) {
DCHECK(isNull());
m_elementSequence = value;
m_type = SpecificTypeElementSequence;
}
ElementSequenceOrByteStringDoubleOrStringRecord ElementSequenceOrByteStringDoubleOrStringRecord::fromElementSequence(const HeapVector<Member<Element>>& value) {
ElementSequenceOrByteStringDoubleOrStringRecord container;
container.setElementSequence(value);
return container;
}
ElementSequenceOrByteStringDoubleOrStringRecord::ElementSequenceOrByteStringDoubleOrStringRecord(const ElementSequenceOrByteStringDoubleOrStringRecord&) = default;
ElementSequenceOrByteStringDoubleOrStringRecord::~ElementSequenceOrByteStringDoubleOrStringRecord() = default;
ElementSequenceOrByteStringDoubleOrStringRecord& ElementSequenceOrByteStringDoubleOrStringRecord::operator=(const ElementSequenceOrByteStringDoubleOrStringRecord&) = default;
DEFINE_TRACE(ElementSequenceOrByteStringDoubleOrStringRecord) {
visitor->trace(m_byteStringDoubleOrStringRecord);
visitor->trace(m_elementSequence);
}
void V8ElementSequenceOrByteStringDoubleOrStringRecord::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, ElementSequenceOrByteStringDoubleOrStringRecord& impl, UnionTypeConversionMode conversionMode, ExceptionState& exceptionState) {
if (v8Value.IsEmpty())
return;
if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull(v8Value))
return;
if (v8Value->IsArray()) {
HeapVector<Member<Element>> cppValue = toMemberNativeArray<Element>(v8Value, 0, isolate, exceptionState);
if (exceptionState.hadException())
return;
impl.setElementSequence(cppValue);
return;
}
if (v8Value->IsObject()) {
HeapVector<std::pair<String, DoubleOrString>> cppValue = NativeValueTraits<IDLRecord<IDLByteString, DoubleOrString>>::nativeValue(isolate, v8Value, exceptionState);
if (exceptionState.hadException())
return;
impl.setByteStringDoubleOrStringRecord(cppValue);
return;
}
exceptionState.throwTypeError("The provided value is not of type '(sequence<Element> or record<ByteString, (double or DOMString)>)'");
}
v8::Local<v8::Value> ToV8(const ElementSequenceOrByteStringDoubleOrStringRecord& impl, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) {
switch (impl.m_type) {
case ElementSequenceOrByteStringDoubleOrStringRecord::SpecificTypeNone:
return v8::Null(isolate);
case ElementSequenceOrByteStringDoubleOrStringRecord::SpecificTypeByteStringDoubleOrStringRecord:
return ToV8(impl.getAsByteStringDoubleOrStringRecord(), creationContext, isolate);
case ElementSequenceOrByteStringDoubleOrStringRecord::SpecificTypeElementSequence:
return ToV8(impl.getAsElementSequence(), creationContext, isolate);
default:
NOTREACHED();
}
return v8::Local<v8::Value>();
}
ElementSequenceOrByteStringDoubleOrStringRecord NativeValueTraits<ElementSequenceOrByteStringDoubleOrStringRecord>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) {
ElementSequenceOrByteStringDoubleOrStringRecord impl;
V8ElementSequenceOrByteStringDoubleOrStringRecord::toImpl(isolate, value, impl, UnionTypeConversionMode::NotNullable, exceptionState);
return impl;
}
} // namespace blink
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file has been auto-generated by code_generator_v8.py.
// DO NOT MODIFY!
// This file has been generated from the Jinja2 template in
// third_party/WebKit/Source/bindings/templates/union_container.h.tmpl
// clang-format off
#ifndef ElementSequenceOrByteStringDoubleOrStringRecord_h
#define ElementSequenceOrByteStringDoubleOrStringRecord_h
#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/NativeValueTraits.h"
#include "bindings/core/v8/V8Binding.h"
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
namespace blink {
class DoubleOrString;
class Element;
class CORE_EXPORT ElementSequenceOrByteStringDoubleOrStringRecord final {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
public:
ElementSequenceOrByteStringDoubleOrStringRecord();
bool isNull() const { return m_type == SpecificTypeNone; }
bool isByteStringDoubleOrStringRecord() const { return m_type == SpecificTypeByteStringDoubleOrStringRecord; }
const HeapVector<std::pair<String, DoubleOrString>>& getAsByteStringDoubleOrStringRecord() const;
void setByteStringDoubleOrStringRecord(const HeapVector<std::pair<String, DoubleOrString>>&);
static ElementSequenceOrByteStringDoubleOrStringRecord fromByteStringDoubleOrStringRecord(const HeapVector<std::pair<String, DoubleOrString>>&);
bool isElementSequence() const { return m_type == SpecificTypeElementSequence; }
const HeapVector<Member<Element>>& getAsElementSequence() const;
void setElementSequence(const HeapVector<Member<Element>>&);
static ElementSequenceOrByteStringDoubleOrStringRecord fromElementSequence(const HeapVector<Member<Element>>&);
ElementSequenceOrByteStringDoubleOrStringRecord(const ElementSequenceOrByteStringDoubleOrStringRecord&);
~ElementSequenceOrByteStringDoubleOrStringRecord();
ElementSequenceOrByteStringDoubleOrStringRecord& operator=(const ElementSequenceOrByteStringDoubleOrStringRecord&);
DECLARE_TRACE();
private:
enum SpecificTypes {
SpecificTypeNone,
SpecificTypeByteStringDoubleOrStringRecord,
SpecificTypeElementSequence,
};
SpecificTypes m_type;
HeapVector<std::pair<String, DoubleOrString>> m_byteStringDoubleOrStringRecord;
HeapVector<Member<Element>> m_elementSequence;
friend CORE_EXPORT v8::Local<v8::Value> ToV8(const ElementSequenceOrByteStringDoubleOrStringRecord&, v8::Local<v8::Object>, v8::Isolate*);
};
class V8ElementSequenceOrByteStringDoubleOrStringRecord final {
public:
CORE_EXPORT static void toImpl(v8::Isolate*, v8::Local<v8::Value>, ElementSequenceOrByteStringDoubleOrStringRecord&, UnionTypeConversionMode, ExceptionState&);
};
CORE_EXPORT v8::Local<v8::Value> ToV8(const ElementSequenceOrByteStringDoubleOrStringRecord&, v8::Local<v8::Object>, v8::Isolate*);
template <class CallbackInfo>
inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ElementSequenceOrByteStringDoubleOrStringRecord& impl) {
v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
}
template <class CallbackInfo>
inline void v8SetReturnValue(const CallbackInfo& callbackInfo, ElementSequenceOrByteStringDoubleOrStringRecord& impl, v8::Local<v8::Object> creationContext) {
v8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIsolate()));
}
template <>
struct NativeValueTraits<ElementSequenceOrByteStringDoubleOrStringRecord> : public NativeValueTraitsBase<ElementSequenceOrByteStringDoubleOrStringRecord> {
CORE_EXPORT static ElementSequenceOrByteStringDoubleOrStringRecord nativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&);
};
template <>
struct V8TypeOf<ElementSequenceOrByteStringDoubleOrStringRecord> {
typedef V8ElementSequenceOrByteStringDoubleOrStringRecord Type;
};
} // namespace blink
// We need to set canInitializeWithMemset=true because HeapVector supports
// items that can initialize with memset or have a vtable. It is safe to
// set canInitializeWithMemset=true for a union type object in practice.
// See https://codereview.chromium.org/1118993002/#msg5 for more details.
WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::ElementSequenceOrByteStringDoubleOrStringRecord);
#endif // ElementSequenceOrByteStringDoubleOrStringRecord_h
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file has been auto-generated by code_generator_v8.py.
// DO NOT MODIFY!
// This file has been generated from the Jinja2 template in
// third_party/WebKit/Source/bindings/templates/union_container.cpp.tmpl
// clang-format off
#include "LongOrBoolean.h"
#include "bindings/core/v8/IDLTypes.h"
#include "bindings/core/v8/NativeValueTraitsImpl.h"
#include "bindings/core/v8/ToV8.h"
namespace blink {
LongOrBoolean::LongOrBoolean() : m_type(SpecificTypeNone) {}
bool LongOrBoolean::getAsBoolean() const {
DCHECK(isBoolean());
return m_boolean;
}
void LongOrBoolean::setBoolean(bool value) {
DCHECK(isNull());
m_boolean = value;
m_type = SpecificTypeBoolean;
}
LongOrBoolean LongOrBoolean::fromBoolean(bool value) {
LongOrBoolean container;
container.setBoolean(value);
return container;
}
int32_t LongOrBoolean::getAsLong() const {
DCHECK(isLong());
return m_long;
}
void LongOrBoolean::setLong(int32_t value) {
DCHECK(isNull());
m_long = value;
m_type = SpecificTypeLong;
}
LongOrBoolean LongOrBoolean::fromLong(int32_t value) {
LongOrBoolean container;
container.setLong(value);
return container;
}
LongOrBoolean::LongOrBoolean(const LongOrBoolean&) = default;
LongOrBoolean::~LongOrBoolean() = default;
LongOrBoolean& LongOrBoolean::operator=(const LongOrBoolean&) = default;
DEFINE_TRACE(LongOrBoolean) {
}
void V8LongOrBoolean::toImpl(v8::Isolate* isolate, v8::Local<v8::Value> v8Value, LongOrBoolean& impl, UnionTypeConversionMode conversionMode, ExceptionState& exceptionState) {
if (v8Value.IsEmpty())
return;
if (conversionMode == UnionTypeConversionMode::Nullable && isUndefinedOrNull(v8Value))
return;
if (v8Value->IsBoolean()) {
impl.setBoolean(v8Value.As<v8::Boolean>()->Value());
return;
}
if (v8Value->IsNumber()) {
int32_t cppValue = NativeValueTraits<IDLLong>::nativeValue(isolate, v8Value, exceptionState, NormalConversion);
if (exceptionState.hadException())
return;
impl.setLong(cppValue);
return;
}
{
int32_t cppValue = NativeValueTraits<IDLLong>::nativeValue(isolate, v8Value, exceptionState, NormalConversion);
if (exceptionState.hadException())
return;
impl.setLong(cppValue);
return;
}
}
v8::Local<v8::Value> ToV8(const LongOrBoolean& impl, v8::Local<v8::Object> creationContext, v8::Isolate* isolate) {
switch (impl.m_type) {
case LongOrBoolean::SpecificTypeNone:
return v8::Null(isolate);
case LongOrBoolean::SpecificTypeBoolean:
return v8Boolean(impl.getAsBoolean(), isolate);
case LongOrBoolean::SpecificTypeLong:
return v8::Integer::New(isolate, impl.getAsLong());
default:
NOTREACHED();
}
return v8::Local<v8::Value>();
}
LongOrBoolean NativeValueTraits<LongOrBoolean>::nativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exceptionState) {
LongOrBoolean impl;
V8LongOrBoolean::toImpl(isolate, value, impl, UnionTypeConversionMode::NotNullable, exceptionState);
return impl;
}
} // namespace blink
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file has been auto-generated by code_generator_v8.py.
// DO NOT MODIFY!
// This file has been generated from the Jinja2 template in
// third_party/WebKit/Source/bindings/templates/union_container.h.tmpl
// clang-format off
#ifndef LongOrBoolean_h
#define LongOrBoolean_h
#include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/NativeValueTraits.h"
#include "bindings/core/v8/V8Binding.h"
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
namespace blink {
class CORE_EXPORT LongOrBoolean final {
DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
public:
LongOrBoolean();
bool isNull() const { return m_type == SpecificTypeNone; }
bool isBoolean() const { return m_type == SpecificTypeBoolean; }
bool getAsBoolean() const;
void setBoolean(bool);
static LongOrBoolean fromBoolean(bool);
bool isLong() const { return m_type == SpecificTypeLong; }
int32_t getAsLong() const;
void setLong(int32_t);
static LongOrBoolean fromLong(int32_t);
LongOrBoolean(const LongOrBoolean&);
~LongOrBoolean();
LongOrBoolean& operator=(const LongOrBoolean&);
DECLARE_TRACE();
private:
enum SpecificTypes {
SpecificTypeNone,
SpecificTypeBoolean,
SpecificTypeLong,
};
SpecificTypes m_type;
bool m_boolean;
int32_t m_long;
friend CORE_EXPORT v8::Local<v8::Value> ToV8(const LongOrBoolean&, v8::Local<v8::Object>, v8::Isolate*);
};
class V8LongOrBoolean final {
public:
CORE_EXPORT static void toImpl(v8::Isolate*, v8::Local<v8::Value>, LongOrBoolean&, UnionTypeConversionMode, ExceptionState&);
};
CORE_EXPORT v8::Local<v8::Value> ToV8(const LongOrBoolean&, v8::Local<v8::Object>, v8::Isolate*);
template <class CallbackInfo>
inline void v8SetReturnValue(const CallbackInfo& callbackInfo, LongOrBoolean& impl) {
v8SetReturnValue(callbackInfo, ToV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
}
template <class CallbackInfo>
inline void v8SetReturnValue(const CallbackInfo& callbackInfo, LongOrBoolean& impl, v8::Local<v8::Object> creationContext) {
v8SetReturnValue(callbackInfo, ToV8(impl, creationContext, callbackInfo.GetIsolate()));
}
template <>
struct NativeValueTraits<LongOrBoolean> : public NativeValueTraitsBase<LongOrBoolean> {
CORE_EXPORT static LongOrBoolean nativeValue(v8::Isolate*, v8::Local<v8::Value>, ExceptionState&);
};
template <>
struct V8TypeOf<LongOrBoolean> {
typedef V8LongOrBoolean Type;
};
} // namespace blink
// We need to set canInitializeWithMemset=true because HeapVector supports
// items that can initialize with memset or have a vtable. It is safe to
// set canInitializeWithMemset=true for a union type object in practice.
// See https://codereview.chromium.org/1118993002/#msg5 for more details.
WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::LongOrBoolean);
#endif // LongOrBoolean_h
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
// clang-format off // clang-format off
#include "NodeOrLongSequenceOrEventOrXMLHttpRequestOrStringOrStringByteStringOrNodeListRecord.h" #include "NodeOrLongSequenceOrEventOrXMLHttpRequestOrStringOrStringByteStringOrNodeListRecord.h"
#include "bindings/core/v8/ByteStringOrNodeList.h"
#include "bindings/core/v8/IDLTypes.h" #include "bindings/core/v8/IDLTypes.h"
#include "bindings/core/v8/NativeValueTraitsImpl.h" #include "bindings/core/v8/NativeValueTraitsImpl.h"
#include "bindings/core/v8/ToV8.h" #include "bindings/core/v8/ToV8.h"
......
...@@ -14,20 +14,14 @@ ...@@ -14,20 +14,14 @@
#include "bindings/core/v8/Dictionary.h" #include "bindings/core/v8/Dictionary.h"
#include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/ExceptionState.h"
#include "bindings/core/v8/IDLTypes.h"
#include "bindings/core/v8/NativeValueTraits.h" #include "bindings/core/v8/NativeValueTraits.h"
#include "bindings/core/v8/NativeValueTraitsImpl.h"
#include "bindings/core/v8/V8Binding.h" #include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8NodeList.h"
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "core/dom/NameNodeList.h"
#include "core/dom/NodeList.h"
#include "core/dom/StaticNodeList.h"
#include "core/html/LabelsNodeList.h"
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
namespace blink { namespace blink {
class ByteStringOrNodeList;
class Event; class Event;
class Node; class Node;
class XMLHttpRequest; class XMLHttpRequest;
......
...@@ -4770,6 +4770,60 @@ static void voidMethodArrayBufferOrArrayBufferViewOrDictionaryArgMethod(const v8 ...@@ -4770,6 +4770,60 @@ static void voidMethodArrayBufferOrArrayBufferViewOrDictionaryArgMethod(const v8
impl->voidMethodArrayBufferOrArrayBufferViewOrDictionaryArg(arg); impl->voidMethodArrayBufferOrArrayBufferViewOrDictionaryArg(arg);
} }
static void voidMethodBooleanOrElementSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "voidMethodBooleanOrElementSequenceArg");
TestObject* impl = V8TestObject::toImpl(info.Holder());
if (UNLIKELY(info.Length() < 1)) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
return;
}
BooleanOrElementSequence arg;
V8BooleanOrElementSequence::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversionMode::NotNullable, exceptionState);
if (exceptionState.hadException())
return;
impl->voidMethodBooleanOrElementSequenceArg(arg);
}
static void voidMethodDoubleOrLongOrBooleanSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "voidMethodDoubleOrLongOrBooleanSequenceArg");
TestObject* impl = V8TestObject::toImpl(info.Holder());
if (UNLIKELY(info.Length() < 1)) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
return;
}
DoubleOrLongOrBooleanSequence arg;
V8DoubleOrLongOrBooleanSequence::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversionMode::NotNullable, exceptionState);
if (exceptionState.hadException())
return;
impl->voidMethodDoubleOrLongOrBooleanSequenceArg(arg);
}
static void voidMethodElementSequenceOrByteStringDoubleOrStringRecordMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "voidMethodElementSequenceOrByteStringDoubleOrStringRecord");
TestObject* impl = V8TestObject::toImpl(info.Holder());
if (UNLIKELY(info.Length() < 1)) {
exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
return;
}
ElementSequenceOrByteStringDoubleOrStringRecord arg;
V8ElementSequenceOrByteStringDoubleOrStringRecord::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversionMode::NotNullable, exceptionState);
if (exceptionState.hadException())
return;
impl->voidMethodElementSequenceOrByteStringDoubleOrStringRecord(arg);
}
static void voidMethodArrayOfDoubleOrDOMStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { static void voidMethodArrayOfDoubleOrDOMStringArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "voidMethodArrayOfDoubleOrDOMStringArg"); ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "TestObject", "voidMethodArrayOfDoubleOrDOMStringArg");
...@@ -10545,6 +10599,18 @@ void V8TestObject::voidMethodArrayBufferOrArrayBufferViewOrDictionaryArgMethodCa ...@@ -10545,6 +10599,18 @@ void V8TestObject::voidMethodArrayBufferOrArrayBufferViewOrDictionaryArgMethodCa
TestObjectV8Internal::voidMethodArrayBufferOrArrayBufferViewOrDictionaryArgMethod(info); TestObjectV8Internal::voidMethodArrayBufferOrArrayBufferViewOrDictionaryArgMethod(info);
} }
void V8TestObject::voidMethodBooleanOrElementSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestObjectV8Internal::voidMethodBooleanOrElementSequenceArgMethod(info);
}
void V8TestObject::voidMethodDoubleOrLongOrBooleanSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestObjectV8Internal::voidMethodDoubleOrLongOrBooleanSequenceArgMethod(info);
}
void V8TestObject::voidMethodElementSequenceOrByteStringDoubleOrStringRecordMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestObjectV8Internal::voidMethodElementSequenceOrByteStringDoubleOrStringRecordMethod(info);
}
void V8TestObject::voidMethodArrayOfDoubleOrDOMStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { void V8TestObject::voidMethodArrayOfDoubleOrDOMStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
TestObjectV8Internal::voidMethodArrayOfDoubleOrDOMStringArgMethod(info); TestObjectV8Internal::voidMethodArrayOfDoubleOrDOMStringArgMethod(info);
} }
...@@ -11506,6 +11572,9 @@ const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = { ...@@ -11506,6 +11572,9 @@ const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = {
{"voidMethodDoubleOrNullOrDOMStringArg", V8TestObject::voidMethodDoubleOrNullOrDOMStringArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess}, {"voidMethodDoubleOrNullOrDOMStringArg", V8TestObject::voidMethodDoubleOrNullOrDOMStringArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess},
{"voidMethodDOMStringOrArrayBufferOrArrayBufferViewArg", V8TestObject::voidMethodDOMStringOrArrayBufferOrArrayBufferViewArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess}, {"voidMethodDOMStringOrArrayBufferOrArrayBufferViewArg", V8TestObject::voidMethodDOMStringOrArrayBufferOrArrayBufferViewArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess},
{"voidMethodArrayBufferOrArrayBufferViewOrDictionaryArg", V8TestObject::voidMethodArrayBufferOrArrayBufferViewOrDictionaryArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess}, {"voidMethodArrayBufferOrArrayBufferViewOrDictionaryArg", V8TestObject::voidMethodArrayBufferOrArrayBufferViewOrDictionaryArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess},
{"voidMethodBooleanOrElementSequenceArg", V8TestObject::voidMethodBooleanOrElementSequenceArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess},
{"voidMethodDoubleOrLongOrBooleanSequenceArg", V8TestObject::voidMethodDoubleOrLongOrBooleanSequenceArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess},
{"voidMethodElementSequenceOrByteStringDoubleOrStringRecord", V8TestObject::voidMethodElementSequenceOrByteStringDoubleOrStringRecordMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess},
{"voidMethodArrayOfDoubleOrDOMStringArg", V8TestObject::voidMethodArrayOfDoubleOrDOMStringArgMethodCallback, nullptr, 0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess}, {"voidMethodArrayOfDoubleOrDOMStringArg", V8TestObject::voidMethodArrayOfDoubleOrDOMStringArgMethodCallback, nullptr, 0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess},
{"voidMethodTestInterfaceEmptyOrNullArg", V8TestObject::voidMethodTestInterfaceEmptyOrNullArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess}, {"voidMethodTestInterfaceEmptyOrNullArg", V8TestObject::voidMethodTestInterfaceEmptyOrNullArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess},
{"voidMethodTestCallbackInterfaceArg", V8TestObject::voidMethodTestCallbackInterfaceArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess}, {"voidMethodTestCallbackInterfaceArg", V8TestObject::voidMethodTestCallbackInterfaceArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess},
......
...@@ -13,9 +13,12 @@ ...@@ -13,9 +13,12 @@
#define V8TestObject_h #define V8TestObject_h
#include "bindings/core/v8/ArrayBufferOrArrayBufferViewOrDictionary.h" #include "bindings/core/v8/ArrayBufferOrArrayBufferViewOrDictionary.h"
#include "bindings/core/v8/BooleanOrElementSequence.h"
#include "bindings/core/v8/BooleanOrStringOrUnrestrictedDouble.h" #include "bindings/core/v8/BooleanOrStringOrUnrestrictedDouble.h"
#include "bindings/core/v8/DoubleOrLongOrBooleanSequence.h"
#include "bindings/core/v8/DoubleOrString.h" #include "bindings/core/v8/DoubleOrString.h"
#include "bindings/core/v8/DoubleOrStringOrDoubleOrStringSequence.h" #include "bindings/core/v8/DoubleOrStringOrDoubleOrStringSequence.h"
#include "bindings/core/v8/ElementSequenceOrByteStringDoubleOrStringRecord.h"
#include "bindings/core/v8/GeneratedCodeHelper.h" #include "bindings/core/v8/GeneratedCodeHelper.h"
#include "bindings/core/v8/NativeValueTraits.h" #include "bindings/core/v8/NativeValueTraits.h"
#include "bindings/core/v8/ScriptWrappable.h" #include "bindings/core/v8/ScriptWrappable.h"
...@@ -462,6 +465,9 @@ class V8TestObject { ...@@ -462,6 +465,9 @@ class V8TestObject {
CORE_EXPORT static void voidMethodDoubleOrNullOrDOMStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); CORE_EXPORT static void voidMethodDoubleOrNullOrDOMStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&);
CORE_EXPORT static void voidMethodDOMStringOrArrayBufferOrArrayBufferViewArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); CORE_EXPORT static void voidMethodDOMStringOrArrayBufferOrArrayBufferViewArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&);
CORE_EXPORT static void voidMethodArrayBufferOrArrayBufferViewOrDictionaryArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); CORE_EXPORT static void voidMethodArrayBufferOrArrayBufferViewOrDictionaryArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&);
CORE_EXPORT static void voidMethodBooleanOrElementSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&);
CORE_EXPORT static void voidMethodDoubleOrLongOrBooleanSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&);
CORE_EXPORT static void voidMethodElementSequenceOrByteStringDoubleOrStringRecordMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&);
CORE_EXPORT static void voidMethodArrayOfDoubleOrDOMStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); CORE_EXPORT static void voidMethodArrayOfDoubleOrDOMStringArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&);
CORE_EXPORT static void voidMethodTestInterfaceEmptyOrNullArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); CORE_EXPORT static void voidMethodTestInterfaceEmptyOrNullArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&);
CORE_EXPORT static void voidMethodTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); CORE_EXPORT static void voidMethodTestCallbackInterfaceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment