2 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 #ifndef TypeConversions_h
27 #define TypeConversions_h
29 #include "bindings/core/v8/ScriptWrappable.h"
30 #include "wtf/FastMalloc.h"
31 #include "wtf/PassRefPtr.h"
32 #include "wtf/RefCounted.h"
36 class TypeConversions final : public GarbageCollectedFinalized<TypeConversions>, public ScriptWrappable {
37 DEFINE_WRAPPERTYPEINFO();
39 static TypeConversions* create()
41 return new TypeConversions();
44 long testLong() { return m_long; }
45 void setTestLong(long value) { m_long = value; }
46 unsigned long testUnsignedLong() { return m_unsignedLong; }
47 void setTestUnsignedLong(unsigned long value) { m_unsignedLong = value; }
49 long long testLongLong() { return m_longLong; }
50 void setTestLongLong(long long value) { m_longLong = value; }
51 unsigned long long testUnsignedLongLong() { return m_unsignedLongLong; }
52 void setTestUnsignedLongLong(unsigned long long value) { m_unsignedLongLong = value; }
54 int8_t testByte() { return m_byte; }
55 void setTestByte(int8_t value) { m_byte = value; }
56 uint8_t testOctet() { return m_octet; }
57 void setTestOctet(uint8_t value) { m_octet = value; }
59 int16_t testShort() { return m_short; }
60 void setTestShort(int16_t value) { m_short = value; }
61 uint16_t testUnsignedShort() { return m_unsignedShort; }
62 void setTestUnsignedShort(uint16_t value) { m_unsignedShort = value; }
64 const String& testByteString() const { return m_byteString; }
65 void setTestByteString(const String& value) { m_byteString = value; }
67 const String& testUSVString() const { return m_usvString; }
68 void setTestUSVString(const String& value) { m_usvString = value; }
70 void trace(Visitor*) { }
77 , m_unsignedLongLong(0)
85 unsigned long m_unsignedLong;
87 unsigned long long m_unsignedLongLong;
91 uint16_t m_unsignedShort;
98 #endif // TypeConversions_h