| 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 | #pragma once |
| 22 | |
| 23 | #include "JSDOMWrapper.h" |
| 24 | #include "Location.h" |
| 25 | #include <wtf/NeverDestroyed.h> |
| 26 | |
| 27 | namespace WebCore { |
| 28 | |
| 29 | class JSLocation : public JSDOMWrapper<Location> { |
| 30 | public: |
| 31 | using Base = JSDOMWrapper<Location>; |
| 32 | static JSLocation* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<Location>&& impl) |
| 33 | { |
| 34 | JSLocation* ptr = new (NotNull, JSC::allocateCell<JSLocation>(globalObject->vm().heap)) JSLocation(structure, *globalObject, WTFMove(impl)); |
| 35 | ptr->finishCreation(globalObject->vm()); |
| 36 | return ptr; |
| 37 | } |
| 38 | |
| 39 | static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&); |
| 40 | static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&); |
| 41 | static Location* toWrapped(JSC::VM&, JSC::JSValue); |
| 42 | static bool getOwnPropertySlot(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot&); |
| 43 | static bool getOwnPropertySlotByIndex(JSC::JSObject*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&); |
| 44 | static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode = JSC::EnumerationMode()); |
| 45 | static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&); |
| 46 | static bool putByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::JSValue, bool shouldThrow); |
| 47 | static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow); |
| 48 | static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName); |
| 49 | static bool deletePropertyByIndex(JSC::JSCell*, JSC::ExecState*, unsigned); |
| 50 | static JSC::JSValue getPrototype(JSC::JSObject*, JSC::ExecState*); |
| 51 | static String toStringName(const JSC::JSObject*, JSC::ExecState*); |
| 52 | static bool preventExtensions(JSC::JSObject*, JSC::ExecState*); |
| 53 | static void destroy(JSC::JSCell*); |
| 54 | |
| 55 | DECLARE_INFO; |
| 56 | |
| 57 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
| 58 | { |
| 59 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
| 60 | } |
| 61 | |
| 62 | static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); |
| 63 | mutable JSC::WriteBarrier<JSC::Unknown> m_ancestorOrigins; |
| 64 | static void visitChildren(JSCell*, JSC::SlotVisitor&); |
| 65 | |
| 66 | static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); |
| 67 | public: |
| 68 | static const unsigned StructureFlags = Base::StructureFlags | JSC::HasStaticPropertyTable | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::IsImmutablePrototypeExoticObject | JSC::OverridesGetOwnPropertySlot | JSC::OverridesGetPropertyNames; |
| 69 | protected: |
| 70 | JSLocation(JSC::Structure*, JSDOMGlobalObject&, Ref<Location>&&); |
| 71 | |
| 72 | void finishCreation(JSC::VM&); |
| 73 | }; |
| 74 | |
| 75 | class JSLocationOwner : public JSC::WeakHandleOwner { |
| 76 | public: |
| 77 | virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); |
| 78 | virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); |
| 79 | }; |
| 80 | |
| 81 | inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, Location*) |
| 82 | { |
| 83 | static NeverDestroyed<JSLocationOwner> owner; |
| 84 | return &owner.get(); |
| 85 | } |
| 86 | |
| 87 | inline void* wrapperKey(Location* wrappableObject) |
| 88 | { |
| 89 | return wrappableObject; |
| 90 | } |
| 91 | |
| 92 | JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, Location&); |
| 93 | inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, Location* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); } |
| 94 | JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<Location>&&); |
| 95 | inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<Location>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); } |
| 96 | |
| 97 | class JSLocationPrototype : public JSC::JSNonFinalObject { |
| 98 | public: |
| 99 | using Base = JSC::JSNonFinalObject; |
| 100 | static JSLocationPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
| 101 | { |
| 102 | JSLocationPrototype* ptr = new (NotNull, JSC::allocateCell<JSLocationPrototype>(vm.heap)) JSLocationPrototype(vm, globalObject, structure); |
| 103 | ptr->finishCreation(vm); |
| 104 | return ptr; |
| 105 | } |
| 106 | |
| 107 | DECLARE_INFO; |
| 108 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
| 109 | { |
| 110 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
| 111 | } |
| 112 | |
| 113 | private: |
| 114 | JSLocationPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| 115 | : JSC::JSNonFinalObject(vm, structure) |
| 116 | { |
| 117 | } |
| 118 | |
| 119 | void finishCreation(JSC::VM&); |
| 120 | |
| 121 | static bool put(JSC::JSCell*, JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&); |
| 122 | |
| 123 | static bool defineOwnProperty(JSC::JSObject*, JSC::ExecState*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow); |
| 124 | }; |
| 125 | |
| 126 | // Functions |
| 127 | |
| 128 | JSC::EncodedJSValue JSC_HOST_CALL jsLocationInstanceFunctionAssign(JSC::ExecState*); |
| 129 | JSC::EncodedJSValue JSC_HOST_CALL jsLocationInstanceFunctionReplace(JSC::ExecState*); |
| 130 | JSC::EncodedJSValue JSC_HOST_CALL jsLocationInstanceFunctionReload(JSC::ExecState*); |
| 131 | |
| 132 | template<> struct JSDOMWrapperConverterTraits<Location> { |
| 133 | using WrapperClass = JSLocation; |
| 134 | using ToWrappedReturnType = Location*; |
| 135 | }; |
| 136 | |
| 137 | } // namespace WebCore |
| 138 | |