| Index: Source/bindings/templates/union.h
|
| diff --git a/Source/bindings/templates/union.h b/Source/bindings/templates/union.h
|
| index 77f70e996654ea5757e4f84fbae58d70f43287f3..58e81c1918db5576a24269a8701491952835b178 100644
|
| --- a/Source/bindings/templates/union.h
|
| +++ b/Source/bindings/templates/union.h
|
| @@ -7,13 +7,56 @@
|
| #ifndef {{macro_guard}}
|
| #define {{macro_guard}}
|
|
|
| +{% for filename in header_includes %}
|
| +#include "{{filename}}"
|
| +{% endfor %}
|
| +
|
| namespace blink {
|
|
|
| +{% for decl in header_forward_decls %}
|
| +class {{decl}};
|
| +{% endfor %}
|
| +
|
| {% for container in containers %}
|
| class {{container.cpp_class}} final {
|
| - // FIXME: Implement
|
| + ALLOW_ONLY_INLINE_ALLOCATION();
|
| +public:
|
| + {{container.cpp_class}}();
|
| + bool isNull() const { return m_specificType == SpecificTypeNone; }
|
| +
|
| + {% for member in container.members %}
|
| + bool is{{member.type_name}}() const { return m_specificType == {{member.specific_type_enum}}; }
|
| + {{member.rvalue_cpp_type}} getAs{{member.type_name}}();
|
| + void set{{member.type_name}}({{member.rvalue_cpp_type}});
|
| +
|
| + {% endfor %}
|
| +private:
|
| + enum SpecificTypes {
|
| + SpecificTypeNone,
|
| + {% for member in container.members %}
|
| + {{member.specific_type_enum}},
|
| + {% endfor %}
|
| + };
|
| + SpecificTypes m_specificType;
|
| +
|
| + {% for member in container.members %}
|
| + {{member.cpp_type}} m_{{member.cpp_name}};
|
| + {% endfor %}
|
| +};
|
| +
|
| +class V8{{container.cpp_class}} {
|
| +public:
|
| + static void toImpl(v8::Isolate*, v8::Handle<v8::Value>, {{container.cpp_class}}&, ExceptionState&);
|
| };
|
|
|
| +v8::Handle<v8::Value> toV8({{container.cpp_class}}&, v8::Handle<v8::Object>, v8::Isolate*);
|
| +
|
| +template <class CallbackInfo>
|
| +inline void v8SetReturnValue(const CallbackInfo& callbackInfo, {{container.cpp_class}}& impl)
|
| +{
|
| + v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
|
| +}
|
| +
|
| {% endfor %}
|
| } // namespace blink
|
|
|
|
|