blob: c44b1e4f71bf9333248068d7bd71be44bfc31b2c [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
darin@apple.com795dcb42016-04-30 19:16:00 +000021#pragma once
abarth@webkit.org1a445092010-04-27 04:49:45 +000022
cdumez@apple.com9abc7602016-10-05 16:09:20 +000023#include "JSDOMConvert.h"
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"
akling@apple.come11d4cd2015-02-27 19:52:11 +000026#include <wtf/NeverDestroyed.h>
abarth@webkit.org1a445092010-04-27 04:49:45 +000027
28namespace WebCore {
29
youenn.fablet@crf.canon.fr28808aa2015-10-14 19:18:36 +000030class JSTestObj : public JSDOMWrapper<TestObj> {
abarth@webkit.org1a445092010-04-27 04:49:45 +000031public:
darin@apple.com07eaa7c2016-10-02 21:28:31 +000032 using Base = JSDOMWrapper<TestObj>;
akling@apple.com45497d92015-01-29 19:41:12 +000033 static JSTestObj* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<TestObj>&& impl)
commit-queue@webkit.org64d3f852011-07-26 21:56:13 +000034 {
aestes@apple.com13aae082016-01-02 08:03:08 +000035 JSTestObj* ptr = new (NotNull, JSC::allocateCell<JSTestObj>(globalObject->vm().heap)) JSTestObj(structure, *globalObject, WTFMove(impl));
ggaren@apple.com9a9a4b52013-04-18 19:32:17 +000036 ptr->finishCreation(globalObject->vm());
mhahnenberg@apple.com5e109722011-09-14 18:55:25 +000037 return ptr;
commit-queue@webkit.org64d3f852011-07-26 21:56:13 +000038 }
39
timothy@apple.com97f14362013-09-26 21:45:22 +000040 static JSC::JSObject* createPrototype(JSC::VM&, JSC::JSGlobalObject*);
sbarati@apple.comfa857522016-03-07 01:00:33 +000041 static JSC::JSObject* prototype(JSC::VM&, JSC::JSGlobalObject*);
commit-queue@webkit.org9faee6a2015-02-18 22:39:03 +000042 static TestObj* toWrapped(JSC::JSValue);
mark.lam@apple.comfc274cb2013-08-01 21:13:11 +000043 static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&);
cdumez@apple.com391cd8b2016-02-25 02:39:19 +000044 static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
haraken@chromium.org895abdd2012-01-03 15:46:42 +000045 static void destroy(JSC::JSCell*);
weinig@apple.com6d2baf42014-06-21 23:27:22 +000046
fpizlo@apple.com10ae2d02013-08-14 02:41:47 +000047 DECLARE_INFO;
abarth@webkit.org1a445092010-04-27 04:49:45 +000048
ggaren@apple.com9a9a4b52013-04-18 19:32:17 +000049 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
abarth@webkit.org1a445092010-04-27 04:49:45 +000050 {
fpizlo@apple.com10ae2d02013-08-14 02:41:47 +000051 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
abarth@webkit.org1a445092010-04-27 04:49:45 +000052 }
53
cdumez@apple.com391cd8b2016-02-25 02:39:19 +000054 static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode());
cdumez@apple.com33818582016-02-10 21:51:18 +000055 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
youenn.fablet@crf.canon.fr4706f6f2015-10-01 08:12:40 +000056 mutable JSC::WriteBarrier<JSC::Unknown> m_cachedAttribute1;
57 mutable JSC::WriteBarrier<JSC::Unknown> m_cachedAttribute2;
mhahnenberg@apple.com982c9ea2011-09-23 19:40:09 +000058 static void visitChildren(JSCell*, JSC::SlotVisitor&);
oliver@apple.com8c798d22011-09-11 21:11:11 +000059
abarth@webkit.org1a445092010-04-27 04:49:45 +000060
61 // Custom attributes
cdumez@apple.coma9ef89e2015-09-21 02:42:29 +000062 JSC::JSValue customAttr(JSC::ExecState&) const;
63 void setCustomAttr(JSC::ExecState&, JSC::JSValue);
abarth@webkit.org1a445092010-04-27 04:49:45 +000064
65 // Custom functions
cdumez@apple.coma9ef89e2015-09-21 02:42:29 +000066 JSC::JSValue customMethod(JSC::ExecState&);
67 JSC::JSValue customMethodWithArgs(JSC::ExecState&);
68 static JSC::JSValue classMethod2(JSC::ExecState&);
commit-queue@webkit.org4960dbe2016-09-16 07:51:37 +000069 JSC::JSValue testCustomPromiseFunction(JSC::ExecState&);
akling@apple.com1ba586c2015-04-13 20:53:32 +000070public:
barraclough@apple.com6a0cbf82016-06-06 19:11:17 +000071 static const unsigned StructureFlags = JSC::HasStaticPropertyTable | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames | Base::StructureFlags;
abarth@webkit.org1a445092010-04-27 04:49:45 +000072protected:
youenn.fablet@crf.canon.fredad4b12015-10-08 07:30:23 +000073 JSTestObj(JSC::Structure*, JSDOMGlobalObject&, Ref<TestObj>&&);
akling@apple.comefa2b7b2014-03-28 18:19:10 +000074
cdumez@apple.comd8b596d2016-11-11 22:53:24 +000075 void finishCreation(JSC::VM&);
abarth@webkit.org1a445092010-04-27 04:49:45 +000076};
77
mhahnenberg@apple.com72a567c2011-11-16 05:10:42 +000078class JSTestObjOwner : public JSC::WeakHandleOwner {
abarth@webkit.orgad2669e2012-11-18 21:55:52 +000079public:
commit-queue@webkit.orgd5d496b2015-09-22 12:21:31 +000080 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
81 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
mhahnenberg@apple.com72a567c2011-11-16 05:10:42 +000082};
83
andersca@apple.comcb5c2d62013-10-02 18:23:56 +000084inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, TestObj*)
mhahnenberg@apple.com72a567c2011-11-16 05:10:42 +000085{
akling@apple.come11d4cd2015-02-27 19:52:11 +000086 static NeverDestroyed<JSTestObjOwner> owner;
87 return &owner.get();
mhahnenberg@apple.com72a567c2011-11-16 05:10:42 +000088}
89
cdumez@apple.com90417592016-02-12 16:49:01 +000090inline void* wrapperKey(TestObj* wrappableObject)
cdumez@apple.comcb67d2a2016-02-12 07:28:32 +000091{
cdumez@apple.com90417592016-02-12 16:49:01 +000092 return wrappableObject;
cdumez@apple.comcb67d2a2016-02-12 07:28:32 +000093}
94
cdumez@apple.comba2ca322016-05-12 16:07:13 +000095JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestObj&);
96inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestObj* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
cdumez@apple.com29444e92016-05-15 23:30:11 +000097JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<TestObj>&&);
98inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<TestObj>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
abarth@webkit.org1a445092010-04-27 04:49:45 +000099
commit-queue@webkit.org8ef5cd12016-09-05 17:25:52 +0000100template<> struct JSDOMWrapperConverterTraits<TestObj> {
101 using WrapperClass = JSTestObj;
cdumez@apple.com6c6373f2016-10-22 20:46:34 +0000102 using ToWrappedReturnType = TestObj*;
commit-queue@webkit.org8ef5cd12016-09-05 17:25:52 +0000103};
weinig@apple.com41559162016-10-24 05:02:05 +0000104template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::EnumType);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000105
weinig@apple.com0b03d932016-10-11 17:33:45 +0000106template<> Optional<TestObj::EnumType> parseEnumeration<TestObj::EnumType>(JSC::ExecState&, JSC::JSValue);
107template<> TestObj::EnumType convertEnumeration<TestObj::EnumType>(JSC::ExecState&, JSC::JSValue);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000108template<> const char* expectedEnumerationValues<TestObj::EnumType>();
109
weinig@apple.com41559162016-10-24 05:02:05 +0000110template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::Optional);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000111
weinig@apple.com0b03d932016-10-11 17:33:45 +0000112template<> Optional<TestObj::Optional> parseEnumeration<TestObj::Optional>(JSC::ExecState&, JSC::JSValue);
113template<> TestObj::Optional convertEnumeration<TestObj::Optional>(JSC::ExecState&, JSC::JSValue);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000114template<> const char* expectedEnumerationValues<TestObj::Optional>();
115
weinig@apple.com41559162016-10-24 05:02:05 +0000116template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, AlternateEnumName);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000117
weinig@apple.com0b03d932016-10-11 17:33:45 +0000118template<> Optional<AlternateEnumName> parseEnumeration<AlternateEnumName>(JSC::ExecState&, JSC::JSValue);
119template<> AlternateEnumName convertEnumeration<AlternateEnumName>(JSC::ExecState&, JSC::JSValue);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000120template<> const char* expectedEnumerationValues<AlternateEnumName>();
121
122#if ENABLE(Condition1)
123
weinig@apple.com41559162016-10-24 05:02:05 +0000124template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::EnumA);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000125
weinig@apple.com0b03d932016-10-11 17:33:45 +0000126template<> Optional<TestObj::EnumA> parseEnumeration<TestObj::EnumA>(JSC::ExecState&, JSC::JSValue);
127template<> TestObj::EnumA convertEnumeration<TestObj::EnumA>(JSC::ExecState&, JSC::JSValue);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000128template<> const char* expectedEnumerationValues<TestObj::EnumA>();
129
130#endif
131
132#if ENABLE(Condition1) && ENABLE(Condition2)
133
weinig@apple.com41559162016-10-24 05:02:05 +0000134template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::EnumB);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000135
weinig@apple.com0b03d932016-10-11 17:33:45 +0000136template<> Optional<TestObj::EnumB> parseEnumeration<TestObj::EnumB>(JSC::ExecState&, JSC::JSValue);
137template<> TestObj::EnumB convertEnumeration<TestObj::EnumB>(JSC::ExecState&, JSC::JSValue);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000138template<> const char* expectedEnumerationValues<TestObj::EnumB>();
139
140#endif
141
142#if ENABLE(Condition1) || ENABLE(Condition2)
143
weinig@apple.com41559162016-10-24 05:02:05 +0000144template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::EnumC);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000145
weinig@apple.com0b03d932016-10-11 17:33:45 +0000146template<> Optional<TestObj::EnumC> parseEnumeration<TestObj::EnumC>(JSC::ExecState&, JSC::JSValue);
147template<> TestObj::EnumC convertEnumeration<TestObj::EnumC>(JSC::ExecState&, JSC::JSValue);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000148template<> const char* expectedEnumerationValues<TestObj::EnumC>();
149
150#endif
151
weinig@apple.com41559162016-10-24 05:02:05 +0000152template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::Kind);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000153
weinig@apple.com0b03d932016-10-11 17:33:45 +0000154template<> Optional<TestObj::Kind> parseEnumeration<TestObj::Kind>(JSC::ExecState&, JSC::JSValue);
155template<> TestObj::Kind convertEnumeration<TestObj::Kind>(JSC::ExecState&, JSC::JSValue);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000156template<> const char* expectedEnumerationValues<TestObj::Kind>();
157
weinig@apple.com41559162016-10-24 05:02:05 +0000158template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::Size);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000159
weinig@apple.com0b03d932016-10-11 17:33:45 +0000160template<> Optional<TestObj::Size> parseEnumeration<TestObj::Size>(JSC::ExecState&, JSC::JSValue);
161template<> TestObj::Size convertEnumeration<TestObj::Size>(JSC::ExecState&, JSC::JSValue);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000162template<> const char* expectedEnumerationValues<TestObj::Size>();
163
weinig@apple.com41559162016-10-24 05:02:05 +0000164template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, TestObj::Confidence);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000165
weinig@apple.com0b03d932016-10-11 17:33:45 +0000166template<> Optional<TestObj::Confidence> parseEnumeration<TestObj::Confidence>(JSC::ExecState&, JSC::JSValue);
167template<> TestObj::Confidence convertEnumeration<TestObj::Confidence>(JSC::ExecState&, JSC::JSValue);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000168template<> const char* expectedEnumerationValues<TestObj::Confidence>();
169
cdumez@apple.com73fb59c2016-10-18 23:18:55 +0000170template<> TestObj::Dictionary convertDictionary<TestObj::Dictionary>(JSC::ExecState&, JSC::JSValue);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000171
cdumez@apple.com73fb59c2016-10-18 23:18:55 +0000172template<> TestObj::DictionaryThatShouldNotTolerateNull convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>(JSC::ExecState&, JSC::JSValue);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000173
cdumez@apple.com73fb59c2016-10-18 23:18:55 +0000174template<> TestObj::DictionaryThatShouldTolerateNull convertDictionary<TestObj::DictionaryThatShouldTolerateNull>(JSC::ExecState&, JSC::JSValue);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000175
cdumez@apple.com73fb59c2016-10-18 23:18:55 +0000176template<> AlternateDictionaryName convertDictionary<AlternateDictionaryName>(JSC::ExecState&, JSC::JSValue);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000177
cdumez@apple.com73fb59c2016-10-18 23:18:55 +0000178template<> TestObj::ParentDictionary convertDictionary<TestObj::ParentDictionary>(JSC::ExecState&, JSC::JSValue);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000179
cdumez@apple.com73fb59c2016-10-18 23:18:55 +0000180template<> TestObj::ChildDictionary convertDictionary<TestObj::ChildDictionary>(JSC::ExecState&, JSC::JSValue);
cdumez@apple.com9abc7602016-10-05 16:09:20 +0000181
commit-queue@webkit.orga000dd12016-10-24 18:12:01 +0000182#if ENABLE(Condition1)
183
184template<> TestObj::ConditionalDictionaryA convertDictionary<TestObj::ConditionalDictionaryA>(JSC::ExecState&, JSC::JSValue);
185
186#endif
187
188#if ENABLE(Condition1) && ENABLE(Condition2)
189
190template<> TestObj::ConditionalDictionaryB convertDictionary<TestObj::ConditionalDictionaryB>(JSC::ExecState&, JSC::JSValue);
191
192#endif
193
194#if ENABLE(Condition1) || ENABLE(Condition2)
195
196template<> TestObj::ConditionalDictionaryC convertDictionary<TestObj::ConditionalDictionaryC>(JSC::ExecState&, JSC::JSValue);
197
198#endif
199
abarth@webkit.org1a445092010-04-27 04:49:45 +0000200
201} // namespace WebCore