Unreviewed, rolling out r191902.
[WebKit-https.git] / Source / WebKit2 / WebProcess / WebCoreSupport / mac / WebSystemInterface.mm
1 /*
2  * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple 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
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #import "config.h"
27 #import "WebSystemInterface.h"
28
29 #import <WebCore/WebCoreSystemInterface.h>
30 #import <WebKitSystemInterface.h>
31
32 #define INIT(function) wk##function = WK##function
33
34 void InitWebCoreSystemInterface(void)
35 {
36     static dispatch_once_t initOnce;
37     
38     dispatch_once(&initOnce, ^{
39 #if !PLATFORM(IOS)
40         INIT(AdvanceDefaultButtonPulseAnimation);
41 #endif
42         INIT(CALayerEnumerateRectsBeingDrawnWithBlock);
43         INIT(CGContextGetShouldSmoothFonts);
44         INIT(CGPatternCreateWithImageAndTransform);
45 #if !PLATFORM(IOS)
46         INIT(CGContextDrawsWithCorrectShadowOffsets);
47 #endif
48         INIT(CopyCONNECTProxyResponse);
49         INIT(CopyNSURLResponseStatusLine);
50         INIT(CopyNSURLResponseCertificateChain);
51 #if !PLATFORM(IOS)
52         INIT(DrawBezeledTextArea);
53         INIT(DrawCapsLockIndicator);
54         INIT(DrawFocusRing);
55         INIT(DrawFocusRingAtTime);
56         INIT(DrawCellFocusRingWithFrameAtTime);
57         INIT(DrawMediaSliderTrack);
58         INIT(DrawMediaUIPart);
59 #endif
60         INIT(GetHTTPRequestPriority);
61         INIT(GetNSURLResponseLastModifiedDate);
62 #if !PLATFORM(IOS)
63         INIT(SignedPublicKeyAndChallengeString);
64 #endif
65         INIT(GetWebDefaultCFStringEncoding);
66         INIT(CGContextIsPDFContext);
67 #if !PLATFORM(IOS)
68         INIT(GetWheelEventDeltas);
69         INIT(GetNSEventKeyChar);
70         INIT(HitTestMediaUIPart);
71 #endif
72         INIT(InitializeMaximumHTTPConnectionCountPerHost);
73         INIT(HTTPRequestEnablePipelining);
74 #if !PLATFORM(IOS)
75         INIT(MeasureMediaUIPart);
76         INIT(QTIncludeOnlyModernMediaFileTypes);
77         INIT(QTMovieDisableComponent);
78         INIT(QTMovieGetType);
79         INIT(QTMovieHasClosedCaptions);
80         INIT(QTMovieMaxTimeLoaded);
81         INIT(QTMovieMaxTimeLoadedChangeNotification);
82         INIT(QTMovieMaxTimeSeekable);
83         INIT(QTMovieResolvedURL);
84         INIT(QTMovieSelectPreferredAlternates);
85         INIT(QTMovieSetShowClosedCaptions);
86         INIT(QTMovieViewSetDrawSynchronously);
87         INIT(QTGetSitesInMediaDownloadCache);
88         INIT(QTClearMediaDownloadCacheForSite);
89         INIT(QTClearMediaDownloadCache);
90         INIT(SetCGFontRenderingMode);
91 #endif
92         INIT(SetCONNECTProxyAuthorizationForStream);
93         INIT(SetCONNECTProxyForStream);
94 #if !PLATFORM(IOS)
95         INIT(SetDragImage);
96 #endif
97         INIT(SetHTTPRequestMaximumPriority);
98         INIT(SetHTTPRequestPriority);
99         INIT(SetHTTPRequestMinimumFastLanePriority);
100         INIT(SetNSURLRequestShouldContentSniff);
101         INIT(CreatePrivateStorageSession);
102         INIT(CopyRequestWithStorageSession);
103         INIT(CopyHTTPCookieStorage);
104         INIT(GetHTTPCookieAcceptPolicy);
105         INIT(SetHTTPCookieAcceptPolicy);
106         INIT(HTTPCookies);
107         INIT(HTTPCookiesForURL);
108         INIT(SetHTTPCookiesForURL);
109         INIT(DeleteAllHTTPCookies);
110         INIT(DeleteHTTPCookie);
111
112 #if !PLATFORM(IOS)
113         INIT(SetMetadataURL);
114 #endif // !PLATFORM(IOS)
115
116 #if !PLATFORM(IOS)
117         INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
118         INIT(CopyDefaultSearchProviderDisplayName);
119         INIT(Cursor);
120         INIT(WindowSetScaledFrame);
121         INIT(WindowSetAlpha);
122 #endif // !PLATFORM(IOS)
123
124 #if USE(CFNETWORK)
125         INIT(GetDefaultHTTPCookieStorage);
126         INIT(CopyCredentialFromCFPersistentStorage);
127         INIT(SetCFURLRequestShouldContentSniff);
128         INIT(SetRequestStorageSession);
129 #endif
130
131 #if !PLATFORM(IOS)
132         INIT(SpeechSynthesisGetVoiceIdentifiers);
133         INIT(SpeechSynthesisGetDefaultVoiceIdentifierForLocale);
134         INIT(GetAXTextMarkerTypeID);
135         INIT(GetAXTextMarkerRangeTypeID);
136         INIT(CreateAXTextMarker);
137         INIT(GetBytesFromAXTextMarker);
138         INIT(CreateAXTextMarkerRange);
139         INIT(CopyAXTextMarkerRangeStart);
140         INIT(CopyAXTextMarkerRangeEnd);
141         INIT(AccessibilityHandleFocusChanged);
142         INIT(CreateAXUIElementRef);
143         INIT(UnregisterUniqueIdForElement);
144 #endif
145
146         INIT(GetCFURLResponseMIMEType);
147         INIT(GetCFURLResponseURL);
148         INIT(GetCFURLResponseHTTPResponse);
149         INIT(CopyCFURLResponseSuggestedFilename);
150         INIT(SetCFURLResponseMIMEType);
151
152         INIT(CFURLRequestAllowAllPostCaching);
153
154 #if PLATFORM(IOS)
155         INIT(GetUserAgent);
156         INIT(GetDeviceName);
157         INIT(GetOSNameForUserAgent);
158         INIT(GetPlatformNameForNavigator);
159         INIT(GetVendorNameForNavigator);
160 #endif
161
162 #if !PLATFORM(IOS)
163         INIT(NSElasticDeltaForTimeDelta);
164         INIT(NSElasticDeltaForReboundDelta);
165         INIT(NSReboundDeltaForElasticDelta);
166 #endif
167 #if PLATFORM(IOS)
168         INIT(ExecutableWasLinkedOnOrAfterIOSVersion);
169         INIT(GetDeviceClass);
170         INIT(GetScreenSize);
171         INIT(GetAvailableScreenSize);
172         INIT(GetScreenScaleFactor);
173         INIT(IsGB18030ComplianceRequired);
174         INIT(IsOptimizedFullscreenSupported);
175 #endif
176
177 #if ENABLE(PUBLIC_SUFFIX_LIST)
178         INIT(IsPublicSuffix);
179 #endif
180
181 #if ENABLE(CACHE_PARTITIONING)
182         INIT(CachePartitionKey);
183 #endif
184
185         INIT(ExernalDeviceTypeForPlayer);
186         INIT(ExernalDeviceDisplayNameForPlayer);
187
188         INIT(QueryDecoderAvailability);
189     });
190 }