blob: b9f4f74e26e91fa7a0ea175346d3fe487c243750 [file] [log] [blame]
abarth@webkit.org1a445092010-04-27 04:49:45 +00001/*
2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef JSTestObj_h
22#define JSTestObj_h
23
weinig@apple.com09b024c2014-06-19 23:42:24 +000024#include "JSDOMWrapper.h"
commit-queue@webkit.org64d3f852011-07-26 21:56:13 +000025#include "TestObj.h"
abarth@webkit.org1a445092010-04-27 04:49:45 +000026
27namespace WebCore {
28
commit-queue@webkit.org271fab22011-05-26 06:15:19 +000029class JSTestObj : public JSDOMWrapper {
abarth@webkit.org1a445092010-04-27 04:49:45 +000030public:
commit-queue@webkit.org6c25c522011-08-09 20:46:17 +000031 typedef JSDOMWrapper Base;
commit-queue@webkit.org64d3f852011-07-26 21:56:13 +000032 static JSTestObj* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl)
33 {
ggaren@apple.com9a9a4b52013-04-18 19:32:17 +000034 JSTestObj* ptr = new (NotNull, JSC::allocateCell<JSTestObj>(globalObject->vm().heap)) JSTestObj(structure, globalObject, impl);
35 ptr->finishCreation(globalObject->vm());
mhahnenberg@apple.com5e109722011-09-14 18:55:25 +000036 return ptr;
commit-queue@webkit.org64d3f852011-07-26 21:56:13 +000037 }
38
timothy@apple.com97f14362013-09-26 21:45:22 +000039 static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
weinig@apple.com09b024c2014-06-19 23:42:24 +000040 static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*);
mark.lam@apple.comfc274cb2013-08-01 21:13:11 +000041 static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
haraken@chromium.org895abdd2012-01-03 15:46:42 +000042 static void destroy(JSC::JSCell*);
haraken@chromium.org313f2462012-02-13 02:12:57 +000043 ~JSTestObj();
fpizlo@apple.com10ae2d02013-08-14 02:41:47 +000044 DECLARE_INFO;
abarth@webkit.org1a445092010-04-27 04:49:45 +000045
ggaren@apple.com9a9a4b52013-04-18 19:32:17 +000046 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
abarth@webkit.org1a445092010-04-27 04:49:45 +000047 {
fpizlo@apple.com10ae2d02013-08-14 02:41:47 +000048 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
abarth@webkit.org1a445092010-04-27 04:49:45 +000049 }
50
timothy@apple.com97f14362013-09-26 21:45:22 +000051 static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*);
oliver@apple.com8c798d22011-09-11 21:11:11 +000052 JSC::WriteBarrier<JSC::Unknown> m_cachedAttribute1;
53 JSC::WriteBarrier<JSC::Unknown> m_cachedAttribute2;
mhahnenberg@apple.com982c9ea2011-09-23 19:40:09 +000054 static void visitChildren(JSCell*, JSC::SlotVisitor&);
oliver@apple.com8c798d22011-09-11 21:11:11 +000055
abarth@webkit.org1a445092010-04-27 04:49:45 +000056
57 // Custom attributes
58 JSC::JSValue customAttr(JSC::ExecState*) const;
59 void setCustomAttr(JSC::ExecState*, JSC::JSValue);
60
61 // Custom functions
darin@apple.com3a116982010-05-31 17:23:54 +000062 JSC::JSValue customMethod(JSC::ExecState*);
63 JSC::JSValue customMethodWithArgs(JSC::ExecState*);
jonlee@apple.com64973bc2012-03-09 00:46:38 +000064 static JSC::JSValue classMethod2(JSC::ExecState*);
akling@apple.com51269d92013-10-10 12:01:51 +000065 TestObj& impl() const { return *m_impl; }
haraken@chromium.orgc059ae92011-11-17 03:13:47 +000066 void releaseImpl() { m_impl->deref(); m_impl = 0; }
abarth@webkit.org1a445092010-04-27 04:49:45 +000067
ch.dumez@sisa.samsung.com01be9142013-05-11 19:07:55 +000068 void releaseImplIfNotNull()
69 {
70 if (m_impl) {
71 m_impl->deref();
72 m_impl = 0;
73 }
74 }
haraken@chromium.org895abdd2012-01-03 15:46:42 +000075
abarth@webkit.org1a445092010-04-27 04:49:45 +000076private:
haraken@chromium.orgc059ae92011-11-17 03:13:47 +000077 TestObj* m_impl;
abarth@webkit.org1a445092010-04-27 04:49:45 +000078protected:
commit-queue@webkit.org64d3f852011-07-26 21:56:13 +000079 JSTestObj(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestObj>);
akling@apple.comefa2b7b2014-03-28 18:19:10 +000080
81 void finishCreation(JSC::VM& vm)
82 {
83 Base::finishCreation(vm);
84 ASSERT(inherits(info()));
85 }
86
berto@igalia.comb6f83682014-01-18 23:31:06 +000087 static const unsigned StructureFlags = JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | Base::StructureFlags;
abarth@webkit.org1a445092010-04-27 04:49:45 +000088};
89
mhahnenberg@apple.com72a567c2011-11-16 05:10:42 +000090class JSTestObjOwner : public JSC::WeakHandleOwner {
abarth@webkit.orgad2669e2012-11-18 21:55:52 +000091public:
mhahnenberg@apple.com72a567c2011-11-16 05:10:42 +000092 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
93 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
94};
95
andersca@apple.comcb5c2d62013-10-02 18:23:56 +000096inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestObj*)
mhahnenberg@apple.com72a567c2011-11-16 05:10:42 +000097{
svillar@igalia.com5b31eef2014-03-14 08:30:55 +000098 DEPRECATED_DEFINE_STATIC_LOCAL(JSTestObjOwner, jsTestObjOwner, ());
mhahnenberg@apple.com72a567c2011-11-16 05:10:42 +000099 return &jsTestObjOwner;
100}
101
andersca@apple.comcb5c2d62013-10-02 18:23:56 +0000102inline void* wrapperContext(DOMWrapperWorld& world, TestObj*)
mhahnenberg@apple.com72a567c2011-11-16 05:10:42 +0000103{
andersca@apple.comcb5c2d62013-10-02 18:23:56 +0000104 return &world;
mhahnenberg@apple.com72a567c2011-11-16 05:10:42 +0000105}
106
abarth@webkit.org1a445092010-04-27 04:49:45 +0000107JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestObj*);
108TestObj* toTestObj(JSC::JSValue);
109
abarth@webkit.org1a445092010-04-27 04:49:45 +0000110
111} // namespace WebCore
112
113#endif