~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/generated/JSMediaError.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include "config.h"
22
22
 
23
 
 
24
23
#if ENABLE(VIDEO)
25
24
 
26
25
#include "JSMediaError.h"
27
26
 
28
 
#include <wtf/GetPtr.h>
29
 
 
30
27
#include "MediaError.h"
31
 
 
32
28
#include <runtime/JSNumberCell.h>
 
29
#include <wtf/GetPtr.h>
33
30
 
34
31
using namespace JSC;
35
32
 
36
33
namespace WebCore {
37
34
 
38
 
ASSERT_CLASS_FITS_IN_CELL(JSMediaError)
 
35
ASSERT_CLASS_FITS_IN_CELL(JSMediaError);
39
36
 
40
37
/* Hash table */
41
38
 
46
43
    { 0, 0, 0, 0 }
47
44
};
48
45
 
49
 
static const HashTable JSMediaErrorTable =
 
46
static JSC_CONST_HASHTABLE HashTable JSMediaErrorTable =
50
47
#if ENABLE(PERFECT_HASH_SIZE)
51
48
    { 15, JSMediaErrorTableValues, 0 };
52
49
#else
55
52
 
56
53
/* Hash table for constructor */
57
54
 
58
 
static const HashTableValue JSMediaErrorConstructorTableValues[4] =
 
55
static const HashTableValue JSMediaErrorConstructorTableValues[5] =
59
56
{
60
57
    { "MEDIA_ERR_ABORTED", DontDelete|ReadOnly, (intptr_t)jsMediaErrorMEDIA_ERR_ABORTED, (intptr_t)0 },
61
58
    { "MEDIA_ERR_NETWORK", DontDelete|ReadOnly, (intptr_t)jsMediaErrorMEDIA_ERR_NETWORK, (intptr_t)0 },
62
59
    { "MEDIA_ERR_DECODE", DontDelete|ReadOnly, (intptr_t)jsMediaErrorMEDIA_ERR_DECODE, (intptr_t)0 },
 
60
    { "MEDIA_ERR_SRC_NOT_SUPPORTED", DontDelete|ReadOnly, (intptr_t)jsMediaErrorMEDIA_ERR_SRC_NOT_SUPPORTED, (intptr_t)0 },
63
61
    { 0, 0, 0, 0 }
64
62
};
65
63
 
66
 
static const HashTable JSMediaErrorConstructorTable =
 
64
static JSC_CONST_HASHTABLE HashTable JSMediaErrorConstructorTable =
67
65
#if ENABLE(PERFECT_HASH_SIZE)
68
 
    { 3, JSMediaErrorConstructorTableValues, 0 };
 
66
    { 31, JSMediaErrorConstructorTableValues, 0 };
69
67
#else
70
 
    { 8, 7, JSMediaErrorConstructorTableValues, 0 };
 
68
    { 9, 7, JSMediaErrorConstructorTableValues, 0 };
71
69
#endif
72
70
 
73
 
class JSMediaErrorConstructor : public DOMObject {
 
71
class JSMediaErrorConstructor : public DOMConstructorObject {
74
72
public:
75
 
    JSMediaErrorConstructor(ExecState* exec)
76
 
        : DOMObject(JSMediaErrorConstructor::createStructure(exec->lexicalGlobalObject()->objectPrototype()))
 
73
    JSMediaErrorConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
 
74
        : DOMConstructorObject(JSMediaErrorConstructor::createStructure(globalObject->objectPrototype()), globalObject)
77
75
    {
78
 
        putDirect(exec->propertyNames().prototype, JSMediaErrorPrototype::self(exec, exec->lexicalGlobalObject()), None);
 
76
        putDirect(exec->propertyNames().prototype, JSMediaErrorPrototype::self(exec, globalObject), None);
79
77
    }
80
78
    virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
 
79
    virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
81
80
    virtual const ClassInfo* classInfo() const { return &s_info; }
82
81
    static const ClassInfo s_info;
83
82
 
84
 
    static PassRefPtr<Structure> createStructure(JSValuePtr proto) 
 
83
    static PassRefPtr<Structure> createStructure(JSValue proto) 
85
84
    { 
86
85
        return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance)); 
87
86
    }
94
93
    return getStaticValueSlot<JSMediaErrorConstructor, DOMObject>(exec, &JSMediaErrorConstructorTable, this, propertyName, slot);
95
94
}
96
95
 
 
96
bool JSMediaErrorConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 
97
{
 
98
    return getStaticValueDescriptor<JSMediaErrorConstructor, DOMObject>(exec, &JSMediaErrorConstructorTable, this, propertyName, descriptor);
 
99
}
 
100
 
97
101
/* Hash table for prototype */
98
102
 
99
 
static const HashTableValue JSMediaErrorPrototypeTableValues[4] =
 
103
static const HashTableValue JSMediaErrorPrototypeTableValues[5] =
100
104
{
101
105
    { "MEDIA_ERR_ABORTED", DontDelete|ReadOnly, (intptr_t)jsMediaErrorMEDIA_ERR_ABORTED, (intptr_t)0 },
102
106
    { "MEDIA_ERR_NETWORK", DontDelete|ReadOnly, (intptr_t)jsMediaErrorMEDIA_ERR_NETWORK, (intptr_t)0 },
103
107
    { "MEDIA_ERR_DECODE", DontDelete|ReadOnly, (intptr_t)jsMediaErrorMEDIA_ERR_DECODE, (intptr_t)0 },
 
108
    { "MEDIA_ERR_SRC_NOT_SUPPORTED", DontDelete|ReadOnly, (intptr_t)jsMediaErrorMEDIA_ERR_SRC_NOT_SUPPORTED, (intptr_t)0 },
104
109
    { 0, 0, 0, 0 }
105
110
};
106
111
 
107
 
static const HashTable JSMediaErrorPrototypeTable =
 
112
static JSC_CONST_HASHTABLE HashTable JSMediaErrorPrototypeTable =
108
113
#if ENABLE(PERFECT_HASH_SIZE)
109
 
    { 3, JSMediaErrorPrototypeTableValues, 0 };
 
114
    { 31, JSMediaErrorPrototypeTableValues, 0 };
110
115
#else
111
 
    { 8, 7, JSMediaErrorPrototypeTableValues, 0 };
 
116
    { 9, 7, JSMediaErrorPrototypeTableValues, 0 };
112
117
#endif
113
118
 
114
119
const ClassInfo JSMediaErrorPrototype::s_info = { "MediaErrorPrototype", 0, &JSMediaErrorPrototypeTable, 0 };
123
128
    return getStaticValueSlot<JSMediaErrorPrototype, JSObject>(exec, &JSMediaErrorPrototypeTable, this, propertyName, slot);
124
129
}
125
130
 
 
131
bool JSMediaErrorPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 
132
{
 
133
    return getStaticValueDescriptor<JSMediaErrorPrototype, JSObject>(exec, &JSMediaErrorPrototypeTable, this, propertyName, descriptor);
 
134
}
 
135
 
126
136
const ClassInfo JSMediaError::s_info = { "MediaError", 0, &JSMediaErrorTable, 0 };
127
137
 
128
 
JSMediaError::JSMediaError(PassRefPtr<Structure> structure, PassRefPtr<MediaError> impl)
129
 
    : DOMObject(structure)
 
138
JSMediaError::JSMediaError(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<MediaError> impl)
 
139
    : DOMObjectWithGlobalPointer(structure, globalObject)
130
140
    , m_impl(impl)
131
141
{
132
142
}
133
143
 
134
144
JSMediaError::~JSMediaError()
135
145
{
136
 
    forgetDOMObject(*Heap::heap(this)->globalData(), m_impl.get());
137
 
 
 
146
    forgetDOMObject(*Heap::heap(this)->globalData(), impl());
138
147
}
139
148
 
140
149
JSObject* JSMediaError::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
147
156
    return getStaticValueSlot<JSMediaError, Base>(exec, &JSMediaErrorTable, this, propertyName, slot);
148
157
}
149
158
 
150
 
JSValuePtr jsMediaErrorCode(ExecState* exec, const Identifier&, const PropertySlot& slot)
151
 
{
152
 
    MediaError* imp = static_cast<MediaError*>(static_cast<JSMediaError*>(asObject(slot.slotBase()))->impl());
 
159
bool JSMediaError::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
 
160
{
 
161
    return getStaticValueDescriptor<JSMediaError, Base>(exec, &JSMediaErrorTable, this, propertyName, descriptor);
 
162
}
 
163
 
 
164
JSValue jsMediaErrorCode(ExecState* exec, const Identifier&, const PropertySlot& slot)
 
165
{
 
166
    JSMediaError* castedThis = static_cast<JSMediaError*>(asObject(slot.slotBase()));
 
167
    UNUSED_PARAM(exec);
 
168
    MediaError* imp = static_cast<MediaError*>(castedThis->impl());
153
169
    return jsNumber(exec, imp->code());
154
170
}
155
171
 
156
 
JSValuePtr jsMediaErrorConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)
 
172
JSValue jsMediaErrorConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)
157
173
{
158
 
    return static_cast<JSMediaError*>(asObject(slot.slotBase()))->getConstructor(exec);
 
174
    JSMediaError* domObject = static_cast<JSMediaError*>(asObject(slot.slotBase()));
 
175
    return JSMediaError::getConstructor(exec, domObject->globalObject());
159
176
}
160
 
JSValuePtr JSMediaError::getConstructor(ExecState* exec)
 
177
JSValue JSMediaError::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
161
178
{
162
 
    return getDOMConstructor<JSMediaErrorConstructor>(exec);
 
179
    return getDOMConstructor<JSMediaErrorConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
163
180
}
164
181
 
165
182
// Constant getters
166
183
 
167
 
JSValuePtr jsMediaErrorMEDIA_ERR_ABORTED(ExecState* exec, const Identifier&, const PropertySlot&)
 
184
JSValue jsMediaErrorMEDIA_ERR_ABORTED(ExecState* exec, const Identifier&, const PropertySlot&)
168
185
{
169
186
    return jsNumber(exec, static_cast<int>(1));
170
187
}
171
188
 
172
 
JSValuePtr jsMediaErrorMEDIA_ERR_NETWORK(ExecState* exec, const Identifier&, const PropertySlot&)
 
189
JSValue jsMediaErrorMEDIA_ERR_NETWORK(ExecState* exec, const Identifier&, const PropertySlot&)
173
190
{
174
191
    return jsNumber(exec, static_cast<int>(2));
175
192
}
176
193
 
177
 
JSValuePtr jsMediaErrorMEDIA_ERR_DECODE(ExecState* exec, const Identifier&, const PropertySlot&)
 
194
JSValue jsMediaErrorMEDIA_ERR_DECODE(ExecState* exec, const Identifier&, const PropertySlot&)
178
195
{
179
196
    return jsNumber(exec, static_cast<int>(3));
180
197
}
181
198
 
182
 
JSC::JSValuePtr toJS(JSC::ExecState* exec, MediaError* object)
183
 
{
184
 
    return getDOMObjectWrapper<JSMediaError>(exec, object);
185
 
}
186
 
MediaError* toMediaError(JSC::JSValuePtr value)
187
 
{
188
 
    return value->isObject(&JSMediaError::s_info) ? static_cast<JSMediaError*>(asObject(value))->impl() : 0;
 
199
JSValue jsMediaErrorMEDIA_ERR_SRC_NOT_SUPPORTED(ExecState* exec, const Identifier&, const PropertySlot&)
 
200
{
 
201
    return jsNumber(exec, static_cast<int>(4));
 
202
}
 
203
 
 
204
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, MediaError* object)
 
205
{
 
206
    return getDOMObjectWrapper<JSMediaError>(exec, globalObject, object);
 
207
}
 
208
MediaError* toMediaError(JSC::JSValue value)
 
209
{
 
210
    return value.inherits(&JSMediaError::s_info) ? static_cast<JSMediaError*>(asObject(value))->impl() : 0;
189
211
}
190
212
 
191
213
}