56
53
/* Hash table for constructor */
58
static const HashTableValue JSMediaErrorConstructorTableValues[4] =
55
static const HashTableValue JSMediaErrorConstructorTableValues[5] =
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 },
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 };
70
{ 8, 7, JSMediaErrorConstructorTableValues, 0 };
68
{ 9, 7, JSMediaErrorConstructorTableValues, 0 };
73
class JSMediaErrorConstructor : public DOMObject {
71
class JSMediaErrorConstructor : public DOMConstructorObject {
75
JSMediaErrorConstructor(ExecState* exec)
76
: DOMObject(JSMediaErrorConstructor::createStructure(exec->lexicalGlobalObject()->objectPrototype()))
73
JSMediaErrorConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
74
: DOMConstructorObject(JSMediaErrorConstructor::createStructure(globalObject->objectPrototype()), globalObject)
78
putDirect(exec->propertyNames().prototype, JSMediaErrorPrototype::self(exec, exec->lexicalGlobalObject()), None);
76
putDirect(exec->propertyNames().prototype, JSMediaErrorPrototype::self(exec, globalObject), None);
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;
84
static PassRefPtr<Structure> createStructure(JSValuePtr proto)
83
static PassRefPtr<Structure> createStructure(JSValue proto)
86
85
return Structure::create(proto, TypeInfo(ObjectType, ImplementsHasInstance));
94
93
return getStaticValueSlot<JSMediaErrorConstructor, DOMObject>(exec, &JSMediaErrorConstructorTable, this, propertyName, slot);
96
bool JSMediaErrorConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
98
return getStaticValueDescriptor<JSMediaErrorConstructor, DOMObject>(exec, &JSMediaErrorConstructorTable, this, propertyName, descriptor);
97
101
/* Hash table for prototype */
99
static const HashTableValue JSMediaErrorPrototypeTableValues[4] =
103
static const HashTableValue JSMediaErrorPrototypeTableValues[5] =
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 },
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 };
111
{ 8, 7, JSMediaErrorPrototypeTableValues, 0 };
116
{ 9, 7, JSMediaErrorPrototypeTableValues, 0 };
114
119
const ClassInfo JSMediaErrorPrototype::s_info = { "MediaErrorPrototype", 0, &JSMediaErrorPrototypeTable, 0 };
123
128
return getStaticValueSlot<JSMediaErrorPrototype, JSObject>(exec, &JSMediaErrorPrototypeTable, this, propertyName, slot);
131
bool JSMediaErrorPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
133
return getStaticValueDescriptor<JSMediaErrorPrototype, JSObject>(exec, &JSMediaErrorPrototypeTable, this, propertyName, descriptor);
126
136
const ClassInfo JSMediaError::s_info = { "MediaError", 0, &JSMediaErrorTable, 0 };
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)
134
144
JSMediaError::~JSMediaError()
136
forgetDOMObject(*Heap::heap(this)->globalData(), m_impl.get());
146
forgetDOMObject(*Heap::heap(this)->globalData(), impl());
140
149
JSObject* JSMediaError::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
147
156
return getStaticValueSlot<JSMediaError, Base>(exec, &JSMediaErrorTable, this, propertyName, slot);
150
JSValuePtr jsMediaErrorCode(ExecState* exec, const Identifier&, const PropertySlot& slot)
152
MediaError* imp = static_cast<MediaError*>(static_cast<JSMediaError*>(asObject(slot.slotBase()))->impl());
159
bool JSMediaError::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
161
return getStaticValueDescriptor<JSMediaError, Base>(exec, &JSMediaErrorTable, this, propertyName, descriptor);
164
JSValue jsMediaErrorCode(ExecState* exec, const Identifier&, const PropertySlot& slot)
166
JSMediaError* castedThis = static_cast<JSMediaError*>(asObject(slot.slotBase()));
168
MediaError* imp = static_cast<MediaError*>(castedThis->impl());
153
169
return jsNumber(exec, imp->code());
156
JSValuePtr jsMediaErrorConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)
172
JSValue jsMediaErrorConstructor(ExecState* exec, const Identifier&, const PropertySlot& slot)
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());
160
JSValuePtr JSMediaError::getConstructor(ExecState* exec)
177
JSValue JSMediaError::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
162
return getDOMConstructor<JSMediaErrorConstructor>(exec);
179
return getDOMConstructor<JSMediaErrorConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
165
182
// Constant getters
167
JSValuePtr jsMediaErrorMEDIA_ERR_ABORTED(ExecState* exec, const Identifier&, const PropertySlot&)
184
JSValue jsMediaErrorMEDIA_ERR_ABORTED(ExecState* exec, const Identifier&, const PropertySlot&)
169
186
return jsNumber(exec, static_cast<int>(1));
172
JSValuePtr jsMediaErrorMEDIA_ERR_NETWORK(ExecState* exec, const Identifier&, const PropertySlot&)
189
JSValue jsMediaErrorMEDIA_ERR_NETWORK(ExecState* exec, const Identifier&, const PropertySlot&)
174
191
return jsNumber(exec, static_cast<int>(2));
177
JSValuePtr jsMediaErrorMEDIA_ERR_DECODE(ExecState* exec, const Identifier&, const PropertySlot&)
194
JSValue jsMediaErrorMEDIA_ERR_DECODE(ExecState* exec, const Identifier&, const PropertySlot&)
179
196
return jsNumber(exec, static_cast<int>(3));
182
JSC::JSValuePtr toJS(JSC::ExecState* exec, MediaError* object)
184
return getDOMObjectWrapper<JSMediaError>(exec, object);
186
MediaError* toMediaError(JSC::JSValuePtr value)
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&)
201
return jsNumber(exec, static_cast<int>(4));
204
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, MediaError* object)
206
return getDOMObjectWrapper<JSMediaError>(exec, globalObject, object);
208
MediaError* toMediaError(JSC::JSValue value)
210
return value.inherits(&JSMediaError::s_info) ? static_cast<JSMediaError*>(asObject(value))->impl() : 0;