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 | #if ENABLE(VIDEO) |
24 | |
25 | #include "HTMLVideoElement.h" |
26 | #include "JSDOMConvertEnumeration.h" |
27 | #include "JSDOMWrapper.h" |
28 | #include "JSHTMLMediaElement.h" |
29 | #include "JSNode.h" |
30 | #include <wtf/NeverDestroyed.h> |
31 | |
32 | namespace WebCore { |
33 | |
34 | class JSHTMLVideoElement : public JSHTMLMediaElement { |
35 | public: |
36 | using Base = JSHTMLMediaElement; |
37 | using DOMWrapped = HTMLVideoElement; |
38 | static JSHTMLVideoElement* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<HTMLVideoElement>&& impl) |
39 | { |
40 | JSHTMLVideoElement* ptr = new (NotNull, JSC::allocateCell<JSHTMLVideoElement>(globalObject->vm().heap)) JSHTMLVideoElement(structure, *globalObject, WTFMove(impl)); |
41 | ptr->finishCreation(globalObject->vm()); |
42 | return ptr; |
43 | } |
44 | |
45 | static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&); |
46 | static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&); |
47 | static HTMLVideoElement* toWrapped(JSC::VM&, JSC::JSValue); |
48 | |
49 | DECLARE_INFO; |
50 | |
51 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
52 | { |
53 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::JSType(JSElementType), StructureFlags), info()); |
54 | } |
55 | |
56 | static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*); |
57 | static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&); |
58 | HTMLVideoElement& wrapped() const |
59 | { |
60 | return static_cast<HTMLVideoElement&>(Base::wrapped()); |
61 | } |
62 | protected: |
63 | JSHTMLVideoElement(JSC::Structure*, JSDOMGlobalObject&, Ref<HTMLVideoElement>&&); |
64 | |
65 | void finishCreation(JSC::VM&); |
66 | }; |
67 | |
68 | class JSHTMLVideoElementOwner : public JSNodeOwner { |
69 | public: |
70 | virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**); |
71 | virtual void finalize(JSC::Handle<JSC::Unknown>, void* context); |
72 | }; |
73 | |
74 | inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, HTMLVideoElement*) |
75 | { |
76 | static NeverDestroyed<JSHTMLVideoElementOwner> owner; |
77 | return &owner.get(); |
78 | } |
79 | |
80 | inline void* wrapperKey(HTMLVideoElement* wrappableObject) |
81 | { |
82 | return wrappableObject; |
83 | } |
84 | |
85 | |
86 | template<> struct JSDOMWrapperConverterTraits<HTMLVideoElement> { |
87 | using WrapperClass = JSHTMLVideoElement; |
88 | using ToWrappedReturnType = HTMLVideoElement*; |
89 | }; |
90 | #if ENABLE(VIDEO_PRESENTATION_MODE) |
91 | |
92 | String convertEnumerationToString(HTMLVideoElement::VideoPresentationMode); |
93 | template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, HTMLVideoElement::VideoPresentationMode); |
94 | |
95 | template<> Optional<HTMLVideoElement::VideoPresentationMode> parseEnumeration<HTMLVideoElement::VideoPresentationMode>(JSC::ExecState&, JSC::JSValue); |
96 | template<> const char* expectedEnumerationValues<HTMLVideoElement::VideoPresentationMode>(); |
97 | |
98 | #endif |
99 | |
100 | |
101 | } // namespace WebCore |
102 | |
103 | #endif // ENABLE(VIDEO) |
104 | |