XHR_RESPONSE_BLOB is not enabled on some platforms
[WebKit-https.git] / Source / WebCore / bindings / generic / RuntimeEnabledFeatures.cpp
1 /*
2  * Copyright (C) 2009 Google Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
8  *     * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *     * Redistributions in binary form must reproduce the above
11  * copyright notice, this list of conditions and the following disclaimer
12  * in the documentation and/or other materials provided with the
13  * distribution.
14  *     * Neither the name of Google Inc. nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30
31 #include "config.h"
32 #include "RuntimeEnabledFeatures.h"
33
34 #include "AbstractDatabase.h"
35 #include "MediaPlayer.h"
36 #include "SharedWorkerRepository.h"
37 #include "WebSocket.h"
38
39 #if ENABLE(FILE_SYSTEM)
40 #include "AsyncFileSystem.h"
41 #endif
42
43 namespace WebCore {
44
45 bool RuntimeEnabledFeatures::isLocalStorageEnabled = true;
46 bool RuntimeEnabledFeatures::isSessionStorageEnabled = true;
47 bool RuntimeEnabledFeatures::isWebkitNotificationsEnabled = false;
48 bool RuntimeEnabledFeatures::isApplicationCacheEnabled = true;
49 bool RuntimeEnabledFeatures::isDataTransferItemsEnabled = true;
50 bool RuntimeEnabledFeatures::isGeolocationEnabled = true;
51 bool RuntimeEnabledFeatures::isIndexedDBEnabled = false;
52 bool RuntimeEnabledFeatures::isWebAudioEnabled = false;
53 bool RuntimeEnabledFeatures::isPushStateEnabled = false;
54 bool RuntimeEnabledFeatures::isTouchEnabled = true;
55 bool RuntimeEnabledFeatures::isDeviceMotionEnabled = true;
56 bool RuntimeEnabledFeatures::isDeviceOrientationEnabled = true;
57 bool RuntimeEnabledFeatures::isSpeechInputEnabled = true;
58 bool RuntimeEnabledFeatures::isCSSExclusionsEnabled = false;
59
60 #if ENABLE(SCRIPTED_SPEECH)
61 bool RuntimeEnabledFeatures::isScriptedSpeechEnabled = false;
62 #endif
63
64 #if ENABLE(MEDIA_STREAM)
65 bool RuntimeEnabledFeatures::isMediaStreamEnabled = false;
66 bool RuntimeEnabledFeatures::isPeerConnectionEnabled = true;
67 #endif
68
69 #if ENABLE(GAMEPAD)
70 bool RuntimeEnabledFeatures::isGamepadEnabled = false;
71 #endif
72
73 #if ENABLE(FILE_SYSTEM)
74 bool RuntimeEnabledFeatures::isFileSystemEnabled = false;
75
76 bool RuntimeEnabledFeatures::fileSystemEnabled()
77 {
78     return isFileSystemEnabled && AsyncFileSystem::isAvailable();
79 }
80 #endif
81
82 #if ENABLE(JAVASCRIPT_I18N_API)
83 bool RuntimeEnabledFeatures::isJavaScriptI18NAPIEnabled = false;
84
85 bool RuntimeEnabledFeatures::javaScriptI18NAPIEnabled()
86 {
87     return isJavaScriptI18NAPIEnabled;
88 }
89 #endif
90
91 #if ENABLE(VIDEO)
92
93 bool RuntimeEnabledFeatures::audioEnabled()
94 {
95     return MediaPlayer::isAvailable();
96 }
97
98 bool RuntimeEnabledFeatures::htmlMediaElementEnabled()
99 {
100     return MediaPlayer::isAvailable();
101 }
102
103 bool RuntimeEnabledFeatures::htmlAudioElementEnabled()
104 {
105     return MediaPlayer::isAvailable();
106 }
107
108 bool RuntimeEnabledFeatures::htmlVideoElementEnabled()
109 {
110     return MediaPlayer::isAvailable();
111 }
112
113 bool RuntimeEnabledFeatures::htmlSourceElementEnabled()
114 {
115     return MediaPlayer::isAvailable();
116 }
117
118 bool RuntimeEnabledFeatures::mediaControllerEnabled()
119 {
120     return MediaPlayer::isAvailable();
121 }
122
123 bool RuntimeEnabledFeatures::mediaErrorEnabled()
124 {
125     return MediaPlayer::isAvailable();
126 }
127
128 bool RuntimeEnabledFeatures::timeRangesEnabled()
129 {
130     return MediaPlayer::isAvailable();
131 }
132
133 #endif
134
135 #if ENABLE(SHARED_WORKERS)
136 bool RuntimeEnabledFeatures::sharedWorkerEnabled()
137 {
138     return SharedWorkerRepository::isAvailable();
139 }
140 #endif
141
142 #if ENABLE(WEB_SOCKETS)
143 bool RuntimeEnabledFeatures::webSocketEnabled()
144 {
145     return WebSocket::isAvailable();
146 }
147 #endif
148
149 #if ENABLE(SQL_DATABASE)
150 bool RuntimeEnabledFeatures::openDatabaseEnabled()
151 {
152     return AbstractDatabase::isAvailable();
153 }
154
155 bool RuntimeEnabledFeatures::openDatabaseSyncEnabled()
156 {
157     return AbstractDatabase::isAvailable();
158 }
159 #endif
160
161 #if ENABLE(QUOTA)
162 bool RuntimeEnabledFeatures::isQuotaEnabled = false;
163 #endif
164
165 #if ENABLE(FULLSCREEN_API)
166 bool RuntimeEnabledFeatures::isFullScreenAPIEnabled = true;
167 #endif
168
169 #if ENABLE(POINTER_LOCK)
170 bool RuntimeEnabledFeatures::isPointerLockEnabled = false;
171 #endif
172
173 #if ENABLE(MEDIA_SOURCE)
174 bool RuntimeEnabledFeatures::isMediaSourceEnabled = false;
175 #endif
176
177 #if ENABLE(VIDEO_TRACK)
178 #if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(EFL)
179     bool RuntimeEnabledFeatures::isVideoTrackEnabled = true;
180 #else
181     bool RuntimeEnabledFeatures::isVideoTrackEnabled = false;
182 #endif
183 #endif
184
185 #if ENABLE(ENCRYPTED_MEDIA)
186 bool RuntimeEnabledFeatures::isEncryptedMediaEnabled = false;
187 #endif
188
189 #if ENABLE(SHADOW_DOM)
190 bool RuntimeEnabledFeatures::isShadowDOMEnabled = false;
191 #endif
192
193 #if ENABLE(STYLE_SCOPED)
194 bool RuntimeEnabledFeatures::isStyleScopedEnabled = false;
195 #endif
196
197 #if ENABLE(INPUT_TYPE_DATE)
198 bool RuntimeEnabledFeatures::isInputTypeDateEnabled = true;
199 #endif
200
201 } // namespace WebCore