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 | #include "config.h" |
22 | |
23 | #if ENABLE(WEB_AUTHN) |
24 | |
25 | #include "JSAuthenticatorAttestationResponse.h" |
26 | |
27 | #include "JSDOMAttribute.h" |
28 | #include "JSDOMBinding.h" |
29 | #include "JSDOMConstructorNotConstructable.h" |
30 | #include "JSDOMConvertBufferSource.h" |
31 | #include "JSDOMExceptionHandling.h" |
32 | #include "JSDOMGlobalObject.h" |
33 | #include "JSDOMWrapperCache.h" |
34 | #include "ScriptExecutionContext.h" |
35 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
36 | #include <JavaScriptCore/JSCInlines.h> |
37 | #include <wtf/GetPtr.h> |
38 | #include <wtf/PointerPreparations.h> |
39 | #include <wtf/URL.h> |
40 | |
41 | |
42 | namespace WebCore { |
43 | using namespace JSC; |
44 | |
45 | // Attributes |
46 | |
47 | JSC::EncodedJSValue jsAuthenticatorAttestationResponseConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
48 | bool setJSAuthenticatorAttestationResponseConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
49 | JSC::EncodedJSValue jsAuthenticatorAttestationResponseAttestationObject(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
50 | |
51 | class JSAuthenticatorAttestationResponsePrototype : public JSC::JSNonFinalObject { |
52 | public: |
53 | using Base = JSC::JSNonFinalObject; |
54 | static JSAuthenticatorAttestationResponsePrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
55 | { |
56 | JSAuthenticatorAttestationResponsePrototype* ptr = new (NotNull, JSC::allocateCell<JSAuthenticatorAttestationResponsePrototype>(vm.heap)) JSAuthenticatorAttestationResponsePrototype(vm, globalObject, structure); |
57 | ptr->finishCreation(vm); |
58 | return ptr; |
59 | } |
60 | |
61 | DECLARE_INFO; |
62 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
63 | { |
64 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
65 | } |
66 | |
67 | private: |
68 | JSAuthenticatorAttestationResponsePrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
69 | : JSC::JSNonFinalObject(vm, structure) |
70 | { |
71 | } |
72 | |
73 | void finishCreation(JSC::VM&); |
74 | }; |
75 | |
76 | using JSAuthenticatorAttestationResponseConstructor = JSDOMConstructorNotConstructable<JSAuthenticatorAttestationResponse>; |
77 | |
78 | template<> JSValue JSAuthenticatorAttestationResponseConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
79 | { |
80 | return JSAuthenticatorResponse::getConstructor(vm, &globalObject); |
81 | } |
82 | |
83 | template<> void JSAuthenticatorAttestationResponseConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
84 | { |
85 | putDirect(vm, vm.propertyNames->prototype, JSAuthenticatorAttestationResponse::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
86 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("AuthenticatorAttestationResponse"_s )), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
87 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
88 | } |
89 | |
90 | template<> const ClassInfo JSAuthenticatorAttestationResponseConstructor::s_info = { "AuthenticatorAttestationResponse" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSAuthenticatorAttestationResponseConstructor) }; |
91 | |
92 | /* Hash table for prototype */ |
93 | |
94 | static const HashTableValue JSAuthenticatorAttestationResponsePrototypeTableValues[] = |
95 | { |
96 | { "constructor" , static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAuthenticatorAttestationResponseConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSAuthenticatorAttestationResponseConstructor) } }, |
97 | { "attestationObject" , static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAuthenticatorAttestationResponseAttestationObject), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
98 | }; |
99 | |
100 | const ClassInfo JSAuthenticatorAttestationResponsePrototype::s_info = { "AuthenticatorAttestationResponsePrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSAuthenticatorAttestationResponsePrototype) }; |
101 | |
102 | void JSAuthenticatorAttestationResponsePrototype::finishCreation(VM& vm) |
103 | { |
104 | Base::finishCreation(vm); |
105 | reifyStaticProperties(vm, JSAuthenticatorAttestationResponse::info(), JSAuthenticatorAttestationResponsePrototypeTableValues, *this); |
106 | } |
107 | |
108 | const ClassInfo JSAuthenticatorAttestationResponse::s_info = { "AuthenticatorAttestationResponse" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSAuthenticatorAttestationResponse) }; |
109 | |
110 | JSAuthenticatorAttestationResponse::JSAuthenticatorAttestationResponse(Structure* structure, JSDOMGlobalObject& globalObject, Ref<AuthenticatorAttestationResponse>&& impl) |
111 | : JSAuthenticatorResponse(structure, globalObject, WTFMove(impl)) |
112 | { |
113 | } |
114 | |
115 | void JSAuthenticatorAttestationResponse::finishCreation(VM& vm) |
116 | { |
117 | Base::finishCreation(vm); |
118 | ASSERT(inherits(vm, info())); |
119 | |
120 | } |
121 | |
122 | JSObject* JSAuthenticatorAttestationResponse::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
123 | { |
124 | return JSAuthenticatorAttestationResponsePrototype::create(vm, &globalObject, JSAuthenticatorAttestationResponsePrototype::createStructure(vm, &globalObject, JSAuthenticatorResponse::prototype(vm, globalObject))); |
125 | } |
126 | |
127 | JSObject* JSAuthenticatorAttestationResponse::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
128 | { |
129 | return getDOMPrototype<JSAuthenticatorAttestationResponse>(vm, globalObject); |
130 | } |
131 | |
132 | JSValue JSAuthenticatorAttestationResponse::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
133 | { |
134 | return getDOMConstructor<JSAuthenticatorAttestationResponseConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
135 | } |
136 | |
137 | template<> inline JSAuthenticatorAttestationResponse* IDLAttribute<JSAuthenticatorAttestationResponse>::cast(ExecState& state, EncodedJSValue thisValue) |
138 | { |
139 | return jsDynamicCast<JSAuthenticatorAttestationResponse*>(state.vm(), JSValue::decode(thisValue)); |
140 | } |
141 | |
142 | EncodedJSValue jsAuthenticatorAttestationResponseConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
143 | { |
144 | VM& vm = state->vm(); |
145 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
146 | auto* prototype = jsDynamicCast<JSAuthenticatorAttestationResponsePrototype*>(vm, JSValue::decode(thisValue)); |
147 | if (UNLIKELY(!prototype)) |
148 | return throwVMTypeError(state, throwScope); |
149 | return JSValue::encode(JSAuthenticatorAttestationResponse::getConstructor(state->vm(), prototype->globalObject())); |
150 | } |
151 | |
152 | bool setJSAuthenticatorAttestationResponseConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
153 | { |
154 | VM& vm = state->vm(); |
155 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
156 | auto* prototype = jsDynamicCast<JSAuthenticatorAttestationResponsePrototype*>(vm, JSValue::decode(thisValue)); |
157 | if (UNLIKELY(!prototype)) { |
158 | throwVMTypeError(state, throwScope); |
159 | return false; |
160 | } |
161 | // Shadowing a built-in constructor |
162 | return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
163 | } |
164 | |
165 | static inline JSValue jsAuthenticatorAttestationResponseAttestationObjectGetter(ExecState& state, JSAuthenticatorAttestationResponse& thisObject, ThrowScope& throwScope) |
166 | { |
167 | UNUSED_PARAM(throwScope); |
168 | UNUSED_PARAM(state); |
169 | auto& impl = thisObject.wrapped(); |
170 | JSValue result = toJS<IDLArrayBuffer>(state, *thisObject.globalObject(), throwScope, impl.attestationObject()); |
171 | return result; |
172 | } |
173 | |
174 | EncodedJSValue jsAuthenticatorAttestationResponseAttestationObject(ExecState* state, EncodedJSValue thisValue, PropertyName) |
175 | { |
176 | return IDLAttribute<JSAuthenticatorAttestationResponse>::get<jsAuthenticatorAttestationResponseAttestationObjectGetter, CastedThisErrorBehavior::Assert>(*state, thisValue, "attestationObject" ); |
177 | } |
178 | |
179 | void JSAuthenticatorAttestationResponse::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
180 | { |
181 | auto* thisObject = jsCast<JSAuthenticatorAttestationResponse*>(cell); |
182 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
183 | if (thisObject->scriptExecutionContext()) |
184 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
185 | Base::heapSnapshot(cell, builder); |
186 | } |
187 | |
188 | |
189 | } |
190 | |
191 | #endif // ENABLE(WEB_AUTHN) |
192 | |