76c6b6bdd8475227ce5efd6dbd021e9f7cb17e4b
[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         INIT(AdvanceDefaultButtonPulseAnimation);
40         INIT(CALayerEnumerateRectsBeingDrawnWithBlock);
41         INIT(CopyCFLocalizationPreferredName);
42         INIT(CGContextGetShouldSmoothFonts);
43         INIT(CGPatternCreateWithImageAndTransform);
44         INIT(CGContextResetClip);
45 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
46         INIT(CGContextDrawsWithCorrectShadowOffsets);
47 #endif
48 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
49         INIT(CTFontTransformGlyphs);
50 #endif
51         INIT(CopyCONNECTProxyResponse);
52         INIT(CopyNSURLResponseStatusLine);
53         INIT(CopyNSURLResponseCertificateChain);
54         INIT(CreateCTLineWithUniCharProvider);
55         INIT(CreateCustomCFReadStream);
56         INIT(DrawBezeledTextArea);
57         INIT(DrawBezeledTextFieldCell);
58         INIT(DrawCapsLockIndicator);
59         INIT(DrawFocusRing);
60         INIT(DrawMediaSliderTrack);
61         INIT(DrawMediaUIPart);
62         INIT(DrawTextFieldCellFocusRing);
63         INIT(GetExtensionsForMIMEType);
64         INIT(GetFontInLanguageForCharacter);
65         INIT(GetFontInLanguageForRange);
66         INIT(GetGlyphTransformedAdvances);
67         INIT(GetGlyphsForCharacters);
68         INIT(GetVerticalGlyphsForCharacters);
69         INIT(GetHTTPPipeliningPriority);
70         INIT(GetMIMETypeForExtension);
71         INIT(GetNSURLResponseLastModifiedDate);
72         INIT(SignedPublicKeyAndChallengeString);
73         INIT(GetPreferredExtensionForMIMEType);
74         INIT(GetUserToBaseCTM);
75         INIT(GetWheelEventDeltas);
76         INIT(GetNSEventKeyChar);
77         INIT(HitTestMediaUIPart);
78         INIT(InitializeMaximumHTTPConnectionCountPerHost);
79         INIT(MeasureMediaUIPart);
80         INIT(PopupMenu);
81         INIT(QTIncludeOnlyModernMediaFileTypes);
82         INIT(QTMovieDataRate);
83         INIT(QTMovieDisableComponent);
84         INIT(QTMovieGetType);
85         INIT(QTMovieHasClosedCaptions);
86         INIT(QTMovieMaxTimeLoaded);
87         INIT(QTMovieMaxTimeLoadedChangeNotification);
88         INIT(QTMovieMaxTimeSeekable);
89         INIT(QTMovieResolvedURL);
90         INIT(QTMovieSelectPreferredAlternates);
91         INIT(QTMovieSetShowClosedCaptions);
92         INIT(QTMovieViewSetDrawSynchronously);
93         INIT(QTGetSitesInMediaDownloadCache);
94         INIT(QTClearMediaDownloadCacheForSite);
95         INIT(QTClearMediaDownloadCache);
96         INIT(SetBaseCTM);
97         INIT(SetCGFontRenderingMode);
98         INIT(SetCONNECTProxyAuthorizationForStream);
99         INIT(SetCONNECTProxyForStream);
100         INIT(SetDragImage);
101         INIT(SetHTTPPipeliningMaximumPriority);
102         INIT(SetHTTPPipeliningPriority);
103         INIT(SetHTTPPipeliningMinimumFastLanePriority);
104         INIT(SetNSURLConnectionDefersCallbacks);
105         INIT(SetNSURLRequestShouldContentSniff);
106         INIT(SetPatternPhaseInUserSpace);
107         INIT(SetUpFontCache);
108         INIT(SignalCFReadStreamEnd);
109         INIT(SignalCFReadStreamError);
110         INIT(SignalCFReadStreamHasBytes);
111         INIT(CreatePrivateStorageSession);
112         INIT(CopyRequestWithStorageSession);
113         INIT(CopyHTTPCookieStorage);
114         INIT(GetHTTPCookieAcceptPolicy);
115         INIT(SetHTTPCookieAcceptPolicy);
116         INIT(HTTPCookies);
117         INIT(HTTPCookiesForURL);
118         INIT(SetHTTPCookiesForURL);
119         INIT(DeleteAllHTTPCookies);
120         INIT(DeleteHTTPCookie);
121
122         INIT(SetMetadataURL);
123         
124         INIT(IOSurfaceContextCreate);
125         INIT(IOSurfaceContextCreateImage);
126         INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
127         INIT(CTRunGetInitialAdvance);
128         INIT(RecommendedScrollerStyle);
129         INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
130         INIT(CopyDefaultSearchProviderDisplayName);
131         INIT(SetCrashReportApplicationSpecificInformation);
132         INIT(AVAssetResolvedURL);
133         INIT(Cursor);
134         INIT(WindowSetScaledFrame);
135         INIT(WindowSetAlpha);
136
137 #if USE(CFNETWORK)
138         INIT(GetDefaultHTTPCookieStorage);
139         INIT(CopyCredentialFromCFPersistentStorage);
140         INIT(SetCFURLRequestShouldContentSniff);
141         INIT(CFURLRequestCopyHTTPRequestBodyParts);
142         INIT(CFURLRequestSetHTTPRequestBodyParts);
143         INIT(SetRequestStorageSession);
144 #endif
145
146 #if PLATFORM(MAC)
147         INIT(SpeechSynthesisGetVoiceIdentifiers);
148         INIT(SpeechSynthesisGetDefaultVoiceIdentifierForLocale);
149 #endif
150         INIT(GetAXTextMarkerTypeID);
151         INIT(GetAXTextMarkerRangeTypeID);
152         INIT(CreateAXTextMarker);
153         INIT(GetBytesFromAXTextMarker);
154         INIT(CreateAXTextMarkerRange);
155         INIT(CopyAXTextMarkerRangeStart);
156         INIT(CopyAXTextMarkerRangeEnd);
157         INIT(AccessibilityHandleFocusChanged);
158         INIT(CreateAXUIElementRef);
159         INIT(UnregisterUniqueIdForElement);
160
161         INIT(GetCFURLResponseMIMEType);
162         INIT(GetCFURLResponseURL);
163         INIT(GetCFURLResponseHTTPResponse);
164         INIT(CopyCFURLResponseSuggestedFilename);
165         INIT(SetCFURLResponseMIMEType);
166
167         INIT(CreateVMPressureDispatchOnMainQueue);
168
169         INIT(DestroyRenderingResources);
170
171 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
172         INIT(ExecutableWasLinkedOnOrBeforeLion);
173 #endif
174         
175 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
176         INIT(CreateMemoryStatusPressureCriticalDispatchOnMainQueue);
177 #endif
178
179         INIT(CGPathAddRoundedRect);
180         INIT(CFURLRequestAllowAllPostCaching);
181
182 #if USE(CONTENT_FILTERING)
183         INIT(FilterIsManagedSession);
184         INIT(FilterCreateInstance);
185         INIT(FilterWasBlocked);
186         INIT(FilterIsBuffering);
187         INIT(FilterAddData);
188         INIT(FilterDataComplete);
189 #endif
190
191 #if !PLATFORM(IOS) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
192         INIT(NSElasticDeltaForTimeDelta);
193         INIT(NSElasticDeltaForReboundDelta);
194         INIT(NSReboundDeltaForElasticDelta);
195 #endif
196
197 #if ENABLE(PUBLIC_SUFFIX_LIST)
198         INIT(IsPublicSuffix);
199 #endif
200
201 #if ENABLE(CACHE_PARTITIONING)
202         INIT(CachePartitionKey);
203 #endif
204     });
205 }