Remove unused QTKit preference
[WebKit-https.git] / Source / WebCore / page / DeprecatedGlobalSettings.h
1 /*
2  * Copyright (C) 2003-2016 Apple Inc. All rights reserved.
3  *           (C) 2006 Graham Dennis (graham.dennis@gmail.com)
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
15  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
18  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
25  */
26
27 #pragma once
28
29 #include <wtf/Forward.h>
30
31 namespace WebCore {
32
33 class DeprecatedGlobalSettings {
34 public:
35     DeprecatedGlobalSettings() = delete;
36
37 #if PLATFORM(WIN)
38     static void setShouldUseHighResolutionTimers(bool);
39     static bool shouldUseHighResolutionTimers() { return gShouldUseHighResolutionTimers; }
40 #endif
41
42     static bool isPostLoadCPUUsageMeasurementEnabled();
43     static bool isPostBackgroundingCPUUsageMeasurementEnabled();
44     static bool isPerActivityStateCPUUsageMeasurementEnabled();
45
46     static bool isPostLoadMemoryUsageMeasurementEnabled();
47     static bool isPostBackgroundingMemoryUsageMeasurementEnabled();
48
49     static bool globalConstRedeclarationShouldThrow();
50
51 #if USE(AVFOUNDATION)
52     WEBCORE_EXPORT static void setAVFoundationEnabled(bool flag);
53     static bool isAVFoundationEnabled() { return gAVFoundationEnabled; }
54     WEBCORE_EXPORT static void setAVFoundationNSURLSessionEnabled(bool flag);
55     static bool isAVFoundationNSURLSessionEnabled() { return gAVFoundationNSURLSessionEnabled; }
56 #endif
57
58 #if USE(GSTREAMER)
59     WEBCORE_EXPORT static void setGStreamerEnabled(bool flag);
60     static bool isGStreamerEnabled() { return gGStreamerEnabled; }
61 #endif
62
63     WEBCORE_EXPORT static void setMockScrollbarsEnabled(bool flag);
64     WEBCORE_EXPORT static bool mockScrollbarsEnabled();
65
66     WEBCORE_EXPORT static void setUsesOverlayScrollbars(bool flag);
67     static bool usesOverlayScrollbars();
68
69     WEBCORE_EXPORT static void setUsesMockScrollAnimator(bool);
70     static bool usesMockScrollAnimator();
71
72     WEBCORE_EXPORT static void setShouldRespectPriorityInCSSAttributeSetters(bool);
73     static bool shouldRespectPriorityInCSSAttributeSetters();
74
75     static bool lowPowerVideoAudioBufferSizeEnabled() { return gLowPowerVideoAudioBufferSizeEnabled; }
76     WEBCORE_EXPORT static void setLowPowerVideoAudioBufferSizeEnabled(bool);
77
78     static bool resourceLoadStatisticsEnabled() { return gResourceLoadStatisticsEnabledEnabled; }
79     WEBCORE_EXPORT static void setResourceLoadStatisticsEnabled(bool);
80
81 #if PLATFORM(IOS)
82     WEBCORE_EXPORT static void setAudioSessionCategoryOverride(unsigned);
83     static unsigned audioSessionCategoryOverride();
84
85     WEBCORE_EXPORT static void setNetworkDataUsageTrackingEnabled(bool);
86     static bool networkDataUsageTrackingEnabled();
87
88     WEBCORE_EXPORT static void setNetworkInterfaceName(const String&);
89     static const String& networkInterfaceName();
90
91 #if HAVE(AVKIT)
92     static void setAVKitEnabled(bool flag) { gAVKitEnabled = flag; }
93 #endif
94     static bool avKitEnabled() { return gAVKitEnabled; }
95
96     static void setShouldOptOutOfNetworkStateObservation(bool flag) { gShouldOptOutOfNetworkStateObservation = flag; }
97     static bool shouldOptOutOfNetworkStateObservation() { return gShouldOptOutOfNetworkStateObservation; }
98 #endif
99
100 #if USE(AUDIO_SESSION)
101     static void setShouldManageAudioSessionCategory(bool flag) { gManageAudioSession = flag; }
102     static bool shouldManageAudioSessionCategory() { return gManageAudioSession; }
103 #endif
104     
105 #if ENABLE(MEDIA_STREAM)
106     static bool mockCaptureDevicesEnabled();
107     WEBCORE_EXPORT static void setMockCaptureDevicesEnabled(bool);
108
109     static bool mediaCaptureRequiresSecureConnection();
110     WEBCORE_EXPORT static void setMediaCaptureRequiresSecureConnection(bool);
111 #endif
112
113     WEBCORE_EXPORT static void setAllowsAnySSLCertificate(bool);
114     static bool allowsAnySSLCertificate();
115
116 private:
117 #if USE(AVFOUNDATION)
118     WEBCORE_EXPORT static bool gAVFoundationEnabled;
119     WEBCORE_EXPORT static bool gAVFoundationNSURLSessionEnabled;
120 #endif
121
122 #if USE(GSTREAMER)
123     WEBCORE_EXPORT static bool gGStreamerEnabled;
124 #endif
125
126     static bool gMockScrollbarsEnabled;
127     static bool gUsesOverlayScrollbars;
128     static bool gMockScrollAnimatorEnabled;
129
130 #if PLATFORM(WIN)
131     static bool gShouldUseHighResolutionTimers;
132 #endif
133     static bool gShouldRespectPriorityInCSSAttributeSetters;
134 #if PLATFORM(IOS)
135     static bool gNetworkDataUsageTrackingEnabled;
136     WEBCORE_EXPORT static bool gAVKitEnabled;
137     WEBCORE_EXPORT static bool gShouldOptOutOfNetworkStateObservation;
138 #endif
139     WEBCORE_EXPORT static bool gManageAudioSession;
140     WEBCORE_EXPORT static bool gCustomPasteboardDataEnabled;
141     
142 #if ENABLE(MEDIA_STREAM)
143     static bool gMockCaptureDevicesEnabled;
144     static bool gMediaCaptureRequiresSecureConnection;
145 #endif
146
147     static bool gLowPowerVideoAudioBufferSizeEnabled;
148     static bool gResourceLoadStatisticsEnabledEnabled;
149     static bool gAllowsAnySSLCertificate;
150 };
151
152 inline bool DeprecatedGlobalSettings::isPostLoadCPUUsageMeasurementEnabled()
153 {
154 #if PLATFORM(COCOA)
155     return true;
156 #else
157     return false;
158 #endif
159 }
160
161 inline bool DeprecatedGlobalSettings::isPostBackgroundingCPUUsageMeasurementEnabled()
162 {
163 #if PLATFORM(MAC)
164     return true;
165 #else
166     return false;
167 #endif
168 }
169
170 inline bool DeprecatedGlobalSettings::isPerActivityStateCPUUsageMeasurementEnabled()
171 {
172 #if PLATFORM(MAC)
173     return true;
174 #else
175     return false;
176 #endif
177 }
178
179 inline bool DeprecatedGlobalSettings::isPostLoadMemoryUsageMeasurementEnabled()
180 {
181 #if PLATFORM(COCOA)
182     return true;
183 #else
184     return false;
185 #endif
186 }
187
188 inline bool DeprecatedGlobalSettings::isPostBackgroundingMemoryUsageMeasurementEnabled()
189 {
190 #if PLATFORM(MAC)
191     return true;
192 #else
193     return false;
194 #endif
195 }
196
197 } // namespace WebCore