1/*
2 * Copyright (c) 2015 Igalia
3 * Copyright (c) 2015 Igalia S.L.
4 * Copyright (c) 2015 Igalia.
5 * Copyright (c) 2015, 2016 Canon Inc. All rights reserved.
6 * Copyright (c) 2015, 2016 Ericsson AB. All rights reserved.
7 * Copyright (c) 2015, 2016, 2017 Canon Inc.
8 * Copyright (c) 2016 Apple Inc. All rights reserved.
9 * Copyright (c) 2017 Apple Inc.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 *
20 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30 * THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 */
33
34// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for
35// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py
36
37#include "config.h"
38#include "WebCoreJSBuiltinInternals.h"
39
40#include "JSDOMGlobalObject.h"
41#include "WebCoreJSClientData.h"
42#include <JavaScriptCore/HeapInlines.h>
43#include <JavaScriptCore/JSCJSValueInlines.h>
44#include <JavaScriptCore/SlotVisitorInlines.h>
45#include <JavaScriptCore/StructureInlines.h>
46
47namespace WebCore {
48
49JSBuiltinInternalFunctions::JSBuiltinInternalFunctions(JSC::VM& vm)
50 : m_vm(vm)
51#if ENABLE(WEB_RTC)
52 , m_rtcPeerConnectionInternals(m_vm)
53#endif // ENABLE(WEB_RTC)
54#if ENABLE(STREAMS_API)
55 , m_readableByteStreamInternals(m_vm)
56#endif // ENABLE(STREAMS_API)
57#if ENABLE(STREAMS_API)
58 , m_readableStreamInternals(m_vm)
59#endif // ENABLE(STREAMS_API)
60#if ENABLE(STREAMS_API)
61 , m_streamInternals(m_vm)
62#endif // ENABLE(STREAMS_API)
63#if ENABLE(STREAMS_API)
64 , m_writableStreamInternals(m_vm)
65#endif // ENABLE(STREAMS_API)
66 , m_jsDOMBindingInternals(m_vm)
67{
68 UNUSED_PARAM(vm);
69}
70
71void JSBuiltinInternalFunctions::visit(JSC::SlotVisitor& visitor)
72{
73#if ENABLE(WEB_RTC)
74 m_rtcPeerConnectionInternals.visit(visitor);
75#endif // ENABLE(WEB_RTC)
76#if ENABLE(STREAMS_API)
77 m_readableByteStreamInternals.visit(visitor);
78#endif // ENABLE(STREAMS_API)
79#if ENABLE(STREAMS_API)
80 m_readableStreamInternals.visit(visitor);
81#endif // ENABLE(STREAMS_API)
82#if ENABLE(STREAMS_API)
83 m_streamInternals.visit(visitor);
84#endif // ENABLE(STREAMS_API)
85#if ENABLE(STREAMS_API)
86 m_writableStreamInternals.visit(visitor);
87#endif // ENABLE(STREAMS_API)
88 m_jsDOMBindingInternals.visit(visitor);
89 UNUSED_PARAM(visitor);
90}
91
92void JSBuiltinInternalFunctions::initialize(JSDOMGlobalObject& globalObject)
93{
94 UNUSED_PARAM(globalObject);
95#if ENABLE(WEB_RTC)
96 m_rtcPeerConnectionInternals.init(globalObject);
97#endif // ENABLE(WEB_RTC)
98#if ENABLE(STREAMS_API)
99 m_readableByteStreamInternals.init(globalObject);
100#endif // ENABLE(STREAMS_API)
101#if ENABLE(STREAMS_API)
102 m_readableStreamInternals.init(globalObject);
103#endif // ENABLE(STREAMS_API)
104#if ENABLE(STREAMS_API)
105 m_streamInternals.init(globalObject);
106#endif // ENABLE(STREAMS_API)
107#if ENABLE(STREAMS_API)
108 m_writableStreamInternals.init(globalObject);
109#endif // ENABLE(STREAMS_API)
110 m_jsDOMBindingInternals.init(globalObject);
111
112#if ENABLE(WEB_RTC) || ENABLE(STREAMS_API)
113 JSVMClientData& clientData = *static_cast<JSVMClientData*>(m_vm.clientData);
114 JSDOMGlobalObject::GlobalPropertyInfo staticGlobals[] = {
115#if ENABLE(WEB_RTC)
116#define DECLARE_GLOBAL_STATIC(name) \
117 JSDOMGlobalObject::GlobalPropertyInfo( \
118 clientData.builtinFunctions().rtcPeerConnectionInternalsBuiltins().name##PrivateName(), rtcPeerConnectionInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly),
119 WEBCORE_FOREACH_RTCPEERCONNECTIONINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
120#undef DECLARE_GLOBAL_STATIC
121#endif // ENABLE(WEB_RTC)
122#if ENABLE(STREAMS_API)
123#define DECLARE_GLOBAL_STATIC(name) \
124 JSDOMGlobalObject::GlobalPropertyInfo( \
125 clientData.builtinFunctions().readableByteStreamInternalsBuiltins().name##PrivateName(), readableByteStreamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly),
126 WEBCORE_FOREACH_READABLEBYTESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
127#undef DECLARE_GLOBAL_STATIC
128#endif // ENABLE(STREAMS_API)
129#if ENABLE(STREAMS_API)
130#define DECLARE_GLOBAL_STATIC(name) \
131 JSDOMGlobalObject::GlobalPropertyInfo( \
132 clientData.builtinFunctions().readableStreamInternalsBuiltins().name##PrivateName(), readableStreamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly),
133 WEBCORE_FOREACH_READABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
134#undef DECLARE_GLOBAL_STATIC
135#endif // ENABLE(STREAMS_API)
136#if ENABLE(STREAMS_API)
137#define DECLARE_GLOBAL_STATIC(name) \
138 JSDOMGlobalObject::GlobalPropertyInfo( \
139 clientData.builtinFunctions().streamInternalsBuiltins().name##PrivateName(), streamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly),
140 WEBCORE_FOREACH_STREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
141#undef DECLARE_GLOBAL_STATIC
142#endif // ENABLE(STREAMS_API)
143#if ENABLE(STREAMS_API)
144#define DECLARE_GLOBAL_STATIC(name) \
145 JSDOMGlobalObject::GlobalPropertyInfo( \
146 clientData.builtinFunctions().writableStreamInternalsBuiltins().name##PrivateName(), writableStreamInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly),
147 WEBCORE_FOREACH_WRITABLESTREAMINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
148#undef DECLARE_GLOBAL_STATIC
149#endif // ENABLE(STREAMS_API)
150#define DECLARE_GLOBAL_STATIC(name) \
151 JSDOMGlobalObject::GlobalPropertyInfo( \
152 clientData.builtinFunctions().jsDOMBindingInternalsBuiltins().name##PrivateName(), jsDOMBindingInternals().m_##name##Function.get() , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly),
153 WEBCORE_FOREACH_JSDOMBINDINGINTERNALS_BUILTIN_FUNCTION_NAME(DECLARE_GLOBAL_STATIC)
154#undef DECLARE_GLOBAL_STATIC
155 };
156 globalObject.addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));
157 UNUSED_PARAM(clientData);
158#endif // ENABLE(WEB_RTC) || ENABLE(STREAMS_API)
159}
160
161} // namespace WebCore
162