abarth@webkit.org | 1a44509 | 2010-04-27 04:49:45 +0000 | [diff] [blame] | 1 | /* |
| 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.com | 09b024c | 2014-06-19 23:42:24 +0000 | [diff] [blame^] | 24 | #include "JSDOMWrapper.h" |
commit-queue@webkit.org | 64d3f85 | 2011-07-26 21:56:13 +0000 | [diff] [blame] | 25 | #include "TestObj.h" |
abarth@webkit.org | 1a44509 | 2010-04-27 04:49:45 +0000 | [diff] [blame] | 26 | |
| 27 | namespace WebCore { |
| 28 | |
commit-queue@webkit.org | 271fab2 | 2011-05-26 06:15:19 +0000 | [diff] [blame] | 29 | class JSTestObj : public JSDOMWrapper { |
abarth@webkit.org | 1a44509 | 2010-04-27 04:49:45 +0000 | [diff] [blame] | 30 | public: |
commit-queue@webkit.org | 6c25c52 | 2011-08-09 20:46:17 +0000 | [diff] [blame] | 31 | typedef JSDOMWrapper Base; |
commit-queue@webkit.org | 64d3f85 | 2011-07-26 21:56:13 +0000 | [diff] [blame] | 32 | static JSTestObj* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestObj> impl) |
| 33 | { |
ggaren@apple.com | 9a9a4b5 | 2013-04-18 19:32:17 +0000 | [diff] [blame] | 34 | JSTestObj* ptr = new (NotNull, JSC::allocateCell<JSTestObj>(globalObject->vm().heap)) JSTestObj(structure, globalObject, impl); |
| 35 | ptr->finishCreation(globalObject->vm()); |
mhahnenberg@apple.com | 5e10972 | 2011-09-14 18:55:25 +0000 | [diff] [blame] | 36 | return ptr; |
commit-queue@webkit.org | 64d3f85 | 2011-07-26 21:56:13 +0000 | [diff] [blame] | 37 | } |
| 38 | |
timothy@apple.com | 97f1436 | 2013-09-26 21:45:22 +0000 | [diff] [blame] | 39 | static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*); |
weinig@apple.com | 09b024c | 2014-06-19 23:42:24 +0000 | [diff] [blame^] | 40 | static JSC::JSObject* getPrototype(JSC::VM&, JSC::JSGlobalObject*); |
mark.lam@apple.com | fc274cb | 2013-08-01 21:13:11 +0000 | [diff] [blame] | 41 | static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&); |
haraken@chromium.org | 895abdd | 2012-01-03 15:46:42 +0000 | [diff] [blame] | 42 | static void destroy(JSC::JSCell*); |
haraken@chromium.org | 313f246 | 2012-02-13 02:12:57 +0000 | [diff] [blame] | 43 | ~JSTestObj(); |
fpizlo@apple.com | 10ae2d0 | 2013-08-14 02:41:47 +0000 | [diff] [blame] | 44 | DECLARE_INFO; |
abarth@webkit.org | 1a44509 | 2010-04-27 04:49:45 +0000 | [diff] [blame] | 45 | |
ggaren@apple.com | 9a9a4b5 | 2013-04-18 19:32:17 +0000 | [diff] [blame] | 46 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
abarth@webkit.org | 1a44509 | 2010-04-27 04:49:45 +0000 | [diff] [blame] | 47 | { |
fpizlo@apple.com | 10ae2d0 | 2013-08-14 02:41:47 +0000 | [diff] [blame] | 48 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
abarth@webkit.org | 1a44509 | 2010-04-27 04:49:45 +0000 | [diff] [blame] | 49 | } |
| 50 | |
timothy@apple.com | 97f1436 | 2013-09-26 21:45:22 +0000 | [diff] [blame] | 51 | static JSC::JSValue getConstructor(JSC::VM&, JSC::JSGlobalObject*); |
oliver@apple.com | 8c798d2 | 2011-09-11 21:11:11 +0000 | [diff] [blame] | 52 | JSC::WriteBarrier<JSC::Unknown> m_cachedAttribute1; |
| 53 | JSC::WriteBarrier<JSC::Unknown> m_cachedAttribute2; |
mhahnenberg@apple.com | 982c9ea | 2011-09-23 19:40:09 +0000 | [diff] [blame] | 54 | static void visitChildren(JSCell*, JSC::SlotVisitor&); |
oliver@apple.com | 8c798d2 | 2011-09-11 21:11:11 +0000 | [diff] [blame] | 55 | |
abarth@webkit.org | 1a44509 | 2010-04-27 04:49:45 +0000 | [diff] [blame] | 56 | |
| 57 | // Custom attributes |
| 58 | JSC::JSValue customAttr(JSC::ExecState*) const; |
| 59 | void setCustomAttr(JSC::ExecState*, JSC::JSValue); |
| 60 | |
| 61 | // Custom functions |
darin@apple.com | 3a11698 | 2010-05-31 17:23:54 +0000 | [diff] [blame] | 62 | JSC::JSValue customMethod(JSC::ExecState*); |
| 63 | JSC::JSValue customMethodWithArgs(JSC::ExecState*); |
jonlee@apple.com | 64973bc | 2012-03-09 00:46:38 +0000 | [diff] [blame] | 64 | static JSC::JSValue classMethod2(JSC::ExecState*); |
akling@apple.com | 51269d9 | 2013-10-10 12:01:51 +0000 | [diff] [blame] | 65 | TestObj& impl() const { return *m_impl; } |
haraken@chromium.org | c059ae9 | 2011-11-17 03:13:47 +0000 | [diff] [blame] | 66 | void releaseImpl() { m_impl->deref(); m_impl = 0; } |
abarth@webkit.org | 1a44509 | 2010-04-27 04:49:45 +0000 | [diff] [blame] | 67 | |
ch.dumez@sisa.samsung.com | 01be914 | 2013-05-11 19:07:55 +0000 | [diff] [blame] | 68 | void releaseImplIfNotNull() |
| 69 | { |
| 70 | if (m_impl) { |
| 71 | m_impl->deref(); |
| 72 | m_impl = 0; |
| 73 | } |
| 74 | } |
haraken@chromium.org | 895abdd | 2012-01-03 15:46:42 +0000 | [diff] [blame] | 75 | |
abarth@webkit.org | 1a44509 | 2010-04-27 04:49:45 +0000 | [diff] [blame] | 76 | private: |
haraken@chromium.org | c059ae9 | 2011-11-17 03:13:47 +0000 | [diff] [blame] | 77 | TestObj* m_impl; |
abarth@webkit.org | 1a44509 | 2010-04-27 04:49:45 +0000 | [diff] [blame] | 78 | protected: |
commit-queue@webkit.org | 64d3f85 | 2011-07-26 21:56:13 +0000 | [diff] [blame] | 79 | JSTestObj(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestObj>); |
akling@apple.com | efa2b7b | 2014-03-28 18:19:10 +0000 | [diff] [blame] | 80 | |
| 81 | void finishCreation(JSC::VM& vm) |
| 82 | { |
| 83 | Base::finishCreation(vm); |
| 84 | ASSERT(inherits(info())); |
| 85 | } |
| 86 | |
berto@igalia.com | b6f8368 | 2014-01-18 23:31:06 +0000 | [diff] [blame] | 87 | static const unsigned StructureFlags = JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | Base::StructureFlags; |
abarth@webkit.org | 1a44509 | 2010-04-27 04:49:45 +0000 | [diff] [blame] | 88 | }; |
| 89 | |
mhahnenberg@apple.com | 72a567c | 2011-11-16 05:10:42 +0000 | [diff] [blame] | 90 | class JSTestObjOwner : public JSC::WeakHandleOwner { |
abarth@webkit.org | ad2669e | 2012-11-18 21:55:52 +0000 | [diff] [blame] | 91 | public: |
mhahnenberg@apple.com | 72a567c | 2011-11-16 05:10:42 +0000 | [diff] [blame] | 92 | 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.com | cb5c2d6 | 2013-10-02 18:23:56 +0000 | [diff] [blame] | 96 | inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestObj*) |
mhahnenberg@apple.com | 72a567c | 2011-11-16 05:10:42 +0000 | [diff] [blame] | 97 | { |
svillar@igalia.com | 5b31eef | 2014-03-14 08:30:55 +0000 | [diff] [blame] | 98 | DEPRECATED_DEFINE_STATIC_LOCAL(JSTestObjOwner, jsTestObjOwner, ()); |
mhahnenberg@apple.com | 72a567c | 2011-11-16 05:10:42 +0000 | [diff] [blame] | 99 | return &jsTestObjOwner; |
| 100 | } |
| 101 | |
andersca@apple.com | cb5c2d6 | 2013-10-02 18:23:56 +0000 | [diff] [blame] | 102 | inline void* wrapperContext(DOMWrapperWorld& world, TestObj*) |
mhahnenberg@apple.com | 72a567c | 2011-11-16 05:10:42 +0000 | [diff] [blame] | 103 | { |
andersca@apple.com | cb5c2d6 | 2013-10-02 18:23:56 +0000 | [diff] [blame] | 104 | return &world; |
mhahnenberg@apple.com | 72a567c | 2011-11-16 05:10:42 +0000 | [diff] [blame] | 105 | } |
| 106 | |
abarth@webkit.org | 1a44509 | 2010-04-27 04:49:45 +0000 | [diff] [blame] | 107 | JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestObj*); |
| 108 | TestObj* toTestObj(JSC::JSValue); |
| 109 | |
abarth@webkit.org | 1a44509 | 2010-04-27 04:49:45 +0000 | [diff] [blame] | 110 | |
| 111 | } // namespace WebCore |
| 112 | |
| 113 | #endif |