Improving webkitGetUserMedia error handling and error messages
[WebKit-https.git] / Source / WebCore / UseJSC.cmake
1 list(APPEND WebCore_INCLUDE_DIRECTORIES
2     "${WEBCORE_DIR}/bindings/js"
3     "${WEBCORE_DIR}/bridge/jsc"
4 )
5
6 list(APPEND WebCoreTestSupport_INCLUDE_DIRECTORIES
7     "${WEBCORE_DIR}/testing/js"
8 )
9
10 list(APPEND WebCore_IDL_INCLUDES
11     bindings/js
12 )
13
14 list(APPEND WebCore_SOURCES
15     bindings/js/ArrayValue.cpp
16     bindings/js/CallbackFunction.cpp
17     bindings/js/DOMObjectHashTableMap.cpp
18     bindings/js/DOMWrapperWorld.cpp
19     bindings/js/Dictionary.cpp
20     bindings/js/GCController.cpp
21     bindings/js/IDBBindingUtilities.cpp
22     bindings/js/JSAttrCustom.cpp
23     bindings/js/JSAudioBufferSourceNodeCustom.cpp
24     bindings/js/JSAudioContextCustom.cpp
25     bindings/js/JSAudioTrackCustom.cpp
26     bindings/js/JSAudioTrackListCustom.cpp
27     bindings/js/JSBiquadFilterNodeCustom.cpp
28     bindings/js/JSBlobCustom.cpp
29     bindings/js/JSCDATASectionCustom.cpp
30     bindings/js/JSCSSRuleCustom.cpp
31     bindings/js/JSCSSRuleListCustom.cpp
32     bindings/js/JSCSSStyleDeclarationCustom.cpp
33     bindings/js/JSCSSValueCustom.cpp
34     bindings/js/JSCallbackData.cpp
35     bindings/js/JSCanvasRenderingContext2DCustom.cpp
36     bindings/js/JSCanvasRenderingContextCustom.cpp
37     bindings/js/JSClipboardCustom.cpp
38     bindings/js/JSCommandLineAPIHostCustom.cpp
39     bindings/js/JSCryptoAlgorithmBuilder.cpp
40     bindings/js/JSCryptoAlgorithmDictionary.cpp
41     bindings/js/JSCryptoCustom.cpp
42     bindings/js/JSCryptoKeyCustom.cpp
43     bindings/js/JSCryptoKeyPairCustom.cpp
44     bindings/js/JSCryptoKeySerializationJWK.cpp
45     bindings/js/JSCryptoOperationData.cpp
46     bindings/js/JSCustomSQLStatementErrorCallback.cpp
47     bindings/js/JSCustomXPathNSResolver.cpp
48     bindings/js/JSDOMBinding.cpp
49     bindings/js/JSDOMFormDataCustom.cpp
50     bindings/js/JSDOMGlobalObject.cpp
51     bindings/js/JSDOMGlobalObjectTask.cpp
52     bindings/js/JSDOMMimeTypeArrayCustom.cpp
53     bindings/js/JSDOMPluginArrayCustom.cpp
54     bindings/js/JSDOMPluginCustom.cpp
55     bindings/js/JSDOMPromise.cpp
56     bindings/js/JSDOMStringListCustom.cpp
57     bindings/js/JSDOMStringMapCustom.cpp
58     bindings/js/JSDOMWindowBase.cpp
59     bindings/js/JSDOMWindowCustom.cpp
60     bindings/js/JSDOMWindowShell.cpp
61     bindings/js/JSDOMWrapper.cpp
62     bindings/js/JSDedicatedWorkerGlobalScopeCustom.cpp
63     bindings/js/JSDeviceMotionEventCustom.cpp
64     bindings/js/JSDeviceOrientationEventCustom.cpp
65     bindings/js/JSDictionary.cpp
66     bindings/js/JSDocumentCustom.cpp
67     bindings/js/JSElementCustom.cpp
68     bindings/js/JSErrorHandler.cpp
69     bindings/js/JSEventCustom.cpp
70     bindings/js/JSEventListener.cpp
71     bindings/js/JSEventTargetCustom.cpp
72     bindings/js/JSExceptionBase.cpp
73     bindings/js/JSFileReaderCustom.cpp
74     bindings/js/JSGeolocationCustom.cpp
75     bindings/js/JSHTMLAllCollectionCustom.cpp
76     bindings/js/JSHTMLAppletElementCustom.cpp
77     bindings/js/JSHTMLCanvasElementCustom.cpp
78     bindings/js/JSHTMLCollectionCustom.cpp
79     bindings/js/JSHTMLDocumentCustom.cpp
80     bindings/js/JSHTMLElementCustom.cpp
81     bindings/js/JSHTMLEmbedElementCustom.cpp
82     bindings/js/JSHTMLFormControlsCollectionCustom.cpp
83     bindings/js/JSHTMLFormElementCustom.cpp
84     bindings/js/JSHTMLFrameElementCustom.cpp
85     bindings/js/JSHTMLFrameSetElementCustom.cpp
86     bindings/js/JSHTMLInputElementCustom.cpp
87     bindings/js/JSHTMLLinkElementCustom.cpp
88     bindings/js/JSHTMLMediaElementCustom.cpp
89     bindings/js/JSHTMLObjectElementCustom.cpp
90     bindings/js/JSHTMLOptionsCollectionCustom.cpp
91     bindings/js/JSHTMLSelectElementCustom.cpp
92     bindings/js/JSHTMLTemplateElementCustom.cpp
93     bindings/js/JSHistoryCustom.cpp
94     bindings/js/JSIDBAnyCustom.cpp
95     bindings/js/JSIDBDatabaseCustom.cpp
96     bindings/js/JSIDBObjectStoreCustom.cpp
97     bindings/js/JSImageConstructor.cpp
98     bindings/js/JSImageDataCustom.cpp
99     bindings/js/JSInspectorFrontendHostCustom.cpp
100     bindings/js/JSLazyEventListener.cpp
101     bindings/js/JSLocationCustom.cpp
102     bindings/js/JSMainThreadExecState.cpp
103     bindings/js/JSMediaSourceStatesCustom.cpp
104     bindings/js/JSMediaStreamCapabilitiesCustom.cpp
105     bindings/js/JSMessageChannelCustom.cpp
106     bindings/js/JSMessageEventCustom.cpp
107     bindings/js/JSMessagePortCustom.cpp
108     bindings/js/JSMutationCallback.cpp
109     bindings/js/JSMutationObserverCustom.cpp
110     bindings/js/JSNamedNodeMapCustom.cpp
111     bindings/js/JSNavigatorCustom.cpp
112     bindings/js/JSNodeCustom.cpp
113     bindings/js/JSNodeFilterCondition.cpp
114     bindings/js/JSNodeFilterCustom.cpp
115     bindings/js/JSNodeIteratorCustom.cpp
116     bindings/js/JSNodeListCustom.cpp
117     bindings/js/JSOscillatorNodeCustom.cpp
118     bindings/js/JSPannerNodeCustom.cpp
119     bindings/js/JSPerformanceEntryCustom.cpp
120     bindings/js/JSPluginElementFunctions.cpp
121     bindings/js/JSPopStateEventCustom.cpp
122     bindings/js/JSRTCIceCandidateCustom.cpp
123     bindings/js/JSRTCPeerConnectionCustom.cpp
124     bindings/js/JSRTCSessionDescriptionCustom.cpp
125     bindings/js/JSRTCStatsResponseCustom.cpp
126     bindings/js/JSRequestAnimationFrameCallbackCustom.cpp
127     bindings/js/JSSQLResultSetRowListCustom.cpp
128     bindings/js/JSSQLTransactionCustom.cpp
129     bindings/js/JSSQLTransactionSyncCustom.cpp
130     bindings/js/JSSVGElementInstanceCustom.cpp
131     bindings/js/JSSVGLengthCustom.cpp
132     bindings/js/JSSVGPathSegCustom.cpp
133     bindings/js/JSSharedWorkerCustom.cpp
134     bindings/js/JSStorageCustom.cpp
135     bindings/js/JSStyleSheetCustom.cpp
136     bindings/js/JSStyleSheetListCustom.cpp
137     bindings/js/JSSubtleCryptoCustom.cpp
138     bindings/js/JSSVGElementInstanceCustom.cpp
139     bindings/js/JSSVGLengthCustom.cpp
140     bindings/js/JSSVGPathSegCustom.cpp
141     bindings/js/JSTextCustom.cpp
142     bindings/js/JSTextTrackCueCustom.cpp
143     bindings/js/JSTextTrackCustom.cpp
144     bindings/js/JSTextTrackListCustom.cpp
145     bindings/js/JSTouchCustom.cpp
146     bindings/js/JSTouchListCustom.cpp
147     bindings/js/JSTrackCustom.cpp
148     bindings/js/JSTrackEventCustom.cpp
149     bindings/js/JSTreeWalkerCustom.cpp
150     bindings/js/JSVideoTrackCustom.cpp
151     bindings/js/JSVideoTrackListCustom.cpp
152     bindings/js/JSWebGLRenderingContextCustom.cpp
153     bindings/js/JSWebKitPointCustom.cpp
154     bindings/js/JSWorkerCustom.cpp
155     bindings/js/JSWorkerGlobalScopeBase.cpp
156     bindings/js/JSWorkerGlobalScopeCustom.cpp
157     bindings/js/JSXMLHttpRequestCustom.cpp
158     bindings/js/JSXPathResultCustom.cpp
159     bindings/js/JSXSLTProcessorCustom.cpp
160     bindings/js/PageScriptDebugServer.cpp
161     bindings/js/ScheduledAction.cpp
162     bindings/js/ScriptCachedFrameData.cpp
163     bindings/js/ScriptController.cpp
164     bindings/js/ScriptGlobalObject.cpp
165     bindings/js/ScriptProfile.cpp
166     bindings/js/ScriptProfiler.cpp
167     bindings/js/ScriptState.cpp
168     bindings/js/SerializedScriptValue.cpp
169     bindings/js/WebCoreTypedArrayController.cpp
170     bindings/js/WorkerScriptController.cpp
171     bindings/js/WorkerScriptDebugServer.cpp
172
173     bridge/IdentifierRep.cpp
174     bridge/NP_jsobject.cpp
175     bridge/npruntime.cpp
176     bridge/runtime_array.cpp
177     bridge/runtime_method.cpp
178     bridge/runtime_object.cpp
179     bridge/runtime_root.cpp
180
181     bridge/c/CRuntimeObject.cpp
182     bridge/c/c_class.cpp
183     bridge/c/c_instance.cpp
184     bridge/c/c_runtime.cpp
185     bridge/c/c_utility.cpp
186
187     bridge/jsc/BridgeJSC.cpp
188 )
189
190 list(APPEND WebCoreTestSupport_SOURCES
191     testing/js/WebCoreTestSupport.cpp
192 )
193
194 if (ENABLE_BLOB)
195     list(APPEND WebCore_SOURCES
196         bindings/js/JSFileReaderCustom.cpp
197     )
198 endif ()
199
200 if (ENABLE_REQUEST_ANIMATION_FRAME)
201     list(APPEND WebCore_SOURCES
202         bindings/js/JSRequestAnimationFrameCallbackCustom.cpp
203     )
204 endif ()
205
206 if (ENABLE_SQL_DATABASE)
207     list(APPEND WebCore_SOURCES
208         bindings/js/JSCustomSQLStatementErrorCallback.cpp
209         bindings/js/JSSQLResultSetRowListCustom.cpp
210         bindings/js/JSSQLTransactionCustom.cpp
211         bindings/js/JSSQLTransactionSyncCustom.cpp
212     )
213 endif ()
214
215 if (ENABLE_INDEXED_DATABASE)
216     list(APPEND WebCore_SOURCES
217         bindings/js/IDBBindingUtilities.cpp
218         bindings/js/JSIDBAnyCustom.cpp
219         bindings/js/JSIDBDatabaseCustom.cpp
220         bindings/js/JSIDBObjectStoreCustom.cpp
221     )
222 endif ()
223
224     list(APPEND WebCore_SOURCES
225         bindings/js/JSDedicatedWorkerGlobalScopeCustom.cpp
226         bindings/js/JSWorkerGlobalScopeBase.cpp
227         bindings/js/JSWorkerGlobalScopeCustom.cpp
228         bindings/js/JSWorkerCustom.cpp
229         bindings/js/WorkerScriptController.cpp
230         bindings/js/WorkerScriptDebugServer.cpp
231     )
232
233 if (ENABLE_VIDEO_TRACK)
234     list(APPEND WebCore_SOURCES
235         bindings/js/JSAudioTrackCustom.cpp
236         bindings/js/JSAudioTrackListCustom.cpp
237         bindings/js/JSTextTrackCueCustom.cpp
238         bindings/js/JSTextTrackCustom.cpp
239         bindings/js/JSTextTrackListCustom.cpp
240         bindings/js/JSTrackCustom.cpp
241         bindings/js/JSTrackEventCustom.cpp
242         bindings/js/JSVideoTrackCustom.cpp
243         bindings/js/JSVideoTrackListCustom.cpp
244     )
245 endif ()
246
247 if (ENABLE_SHARED_WORKERS)
248     list(APPEND WebCore_SOURCES
249         bindings/js/JSSharedWorkerCustom.cpp
250     )
251 endif ()
252
253 if (ENABLE_WEBGL)
254     list(APPEND WebCore_SOURCES
255         bindings/js/JSWebGLRenderingContextCustom.cpp
256     )
257 endif ()
258
259 if (ENABLE_WEB_AUDIO)
260     list(APPEND WebCore_SOURCES
261         bindings/js/JSAudioBufferSourceNodeCustom.cpp
262         bindings/js/JSAudioContextCustom.cpp
263         bindings/js/JSBiquadFilterNodeCustom.cpp
264         bindings/js/JSOscillatorNodeCustom.cpp
265         bindings/js/JSPannerNodeCustom.cpp
266     )
267 endif ()
268
269 if (ENABLE_MEDIA_STREAM)
270     list(APPEND WebCore_SOURCES
271         bindings/js/JSMediaSourceStatesCustom.cpp
272         bindings/js/JSMediaStreamCapabilitiesCustom.cpp
273         bindings/js/JSRTCIceCandidateCustom.cpp
274         bindings/js/JSRTCPeerConnectionCustom.cpp
275         bindings/js/JSRTCSessionDescriptionCustom.cpp
276         bindings/js/JSRTCStatsResponseCustom.cpp
277     )
278 endif ()
279
280 list(APPEND SCRIPTS_BINDINGS
281     ${WEBCORE_DIR}/bindings/scripts/CodeGenerator.pm
282     ${WEBCORE_DIR}/bindings/scripts/CodeGeneratorJS.pm
283 )
284
285 set(IDL_INCLUDES "")
286 foreach (_include ${WebCore_IDL_INCLUDES})
287     list(APPEND IDL_INCLUDES --include=${WEBCORE_DIR}/${_include})
288 endforeach ()
289
290 foreach (_include ${WebCoreTestSupport_IDL_INCLUDES})
291     list(APPEND IDL_INCLUDES --include=${WEBCORE_DIR}/${_include})
292 endforeach ()
293
294 set(FEATURE_DEFINES_JAVASCRIPT "LANGUAGE_JAVASCRIPT=1 ${FEATURE_DEFINES_WITH_SPACE_SEPARATOR}")
295
296 # Create JavaScript C++ code given an IDL input
297 foreach (_idl ${WebCore_IDL_FILES})
298     set(IDL_FILES_LIST "${IDL_FILES_LIST}${WEBCORE_DIR}/${_idl}\n")
299 endforeach ()
300
301 foreach (_idl ${WebCoreTestSupport_IDL_FILES})
302     set(IDL_FILES_LIST "${IDL_FILES_LIST}${WEBCORE_DIR}/${_idl}\n")
303 endforeach ()
304
305 set(IDL_FILES_LIST "${IDL_FILES_LIST}${DERIVED_SOURCES_WEBCORE_DIR}/InternalSettingsGenerated.idl\n")
306 list(APPEND IDL_INCLUDES --include=${DERIVED_SOURCES_WEBCORE_DIR})
307 list(APPEND WebCoreTestSupport_IDL_FILES ${DERIVED_SOURCES_WEBCORE_DIR}/InternalSettingsGenerated.idl)
308
309 file(WRITE ${IDL_FILES_TMP} ${IDL_FILES_LIST})
310
311 add_custom_command(
312     OUTPUT ${SUPPLEMENTAL_DEPENDENCY_FILE} ${WINDOW_CONSTRUCTORS_FILE} ${WORKERGLOBALSCOPE_CONSTRUCTORS_FILE} ${SHAREDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE} ${DEDICATEDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
313     DEPENDS ${WEBCORE_DIR}/bindings/scripts/preprocess-idls.pl ${SCRIPTS_PREPROCESS_IDLS} ${WebCore_IDL_FILES} ${WebCoreTestSupport_IDL_FILES}
314     COMMAND ${PERL_EXECUTABLE} -I${WEBCORE_DIR}/bindings/scripts ${WEBCORE_DIR}/bindings/scripts/preprocess-idls.pl --defines "${FEATURE_DEFINES_JAVASCRIPT}" --idlFilesList ${IDL_FILES_TMP} --supplementalDependencyFile ${SUPPLEMENTAL_DEPENDENCY_FILE} --windowConstructorsFile ${WINDOW_CONSTRUCTORS_FILE} --workerGlobalScopeConstructorsFile ${WORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
315 --sharedWorkerGlobalScopeConstructorsFile ${SHAREDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE} --dedicatedWorkerGlobalScopeConstructorsFile ${DEDICATEDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
316     VERBATIM)
317
318 GENERATE_BINDINGS(WebCore_SOURCES
319     "${WebCore_IDL_FILES}"
320     "${WEBCORE_DIR}"
321     "${IDL_INCLUDES}"
322     "${FEATURE_DEFINES_JAVASCRIPT}"
323     ${DERIVED_SOURCES_WEBCORE_DIR} JS JS
324     ${IDL_ATTRIBUTES_FILE}
325     ${SUPPLEMENTAL_DEPENDENCY_FILE}
326     ${WINDOW_CONSTRUCTORS_FILE}
327     ${WORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
328     ${SHAREDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
329     ${DEDICATEDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE})
330
331 GENERATE_BINDINGS(WebCoreTestSupport_SOURCES
332     "${WebCoreTestSupport_IDL_FILES}"
333     "${WEBCORE_DIR}"
334     "${IDL_INCLUDES}"
335     "${FEATURE_DEFINES_JAVASCRIPT}"
336     ${DERIVED_SOURCES_WEBCORE_DIR} JS JS
337     ${IDL_ATTRIBUTES_FILE}
338     ${SUPPLEMENTAL_DEPENDENCY_FILE}
339     ${WINDOW_CONSTRUCTORS_FILE}
340     ${WORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
341     ${SHAREDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE}
342     ${DEDICATEDWORKERGLOBALSCOPE_CONSTRUCTORS_FILE})