0d18674a2a8e65e8919d62689e265a8a28e56d3a
[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(MediaControllerThemeAvailable);
81         INIT(PopupMenu);
82         INIT(QTIncludeOnlyModernMediaFileTypes);
83         INIT(QTMovieDataRate);
84         INIT(QTMovieDisableComponent);
85         INIT(QTMovieGetType);
86         INIT(QTMovieHasClosedCaptions);
87         INIT(QTMovieMaxTimeLoaded);
88         INIT(QTMovieMaxTimeLoadedChangeNotification);
89         INIT(QTMovieMaxTimeSeekable);
90         INIT(QTMovieResolvedURL);
91         INIT(QTMovieSelectPreferredAlternates);
92         INIT(QTMovieSetShowClosedCaptions);
93         INIT(QTMovieViewSetDrawSynchronously);
94         INIT(QTGetSitesInMediaDownloadCache);
95         INIT(QTClearMediaDownloadCacheForSite);
96         INIT(QTClearMediaDownloadCache);
97         INIT(SetBaseCTM);
98         INIT(SetCGFontRenderingMode);
99         INIT(SetCONNECTProxyAuthorizationForStream);
100         INIT(SetCONNECTProxyForStream);
101         INIT(SetDragImage);
102         INIT(SetHTTPPipeliningMaximumPriority);
103         INIT(SetHTTPPipeliningPriority);
104         INIT(SetHTTPPipeliningMinimumFastLanePriority);
105         INIT(SetNSURLConnectionDefersCallbacks);
106         INIT(SetNSURLRequestShouldContentSniff);
107         INIT(SetPatternPhaseInUserSpace);
108         INIT(SetUpFontCache);
109         INIT(SignalCFReadStreamEnd);
110         INIT(SignalCFReadStreamError);
111         INIT(SignalCFReadStreamHasBytes);
112         INIT(CreatePrivateStorageSession);
113         INIT(CopyRequestWithStorageSession);
114         INIT(CopyHTTPCookieStorage);
115         INIT(GetHTTPCookieAcceptPolicy);
116         INIT(SetHTTPCookieAcceptPolicy);
117         INIT(HTTPCookies);
118         INIT(HTTPCookiesForURL);
119         INIT(SetHTTPCookiesForURL);
120         INIT(DeleteAllHTTPCookies);
121         INIT(DeleteHTTPCookie);
122
123         INIT(SetMetadataURL);
124         
125         INIT(IOSurfaceContextCreate);
126         INIT(IOSurfaceContextCreateImage);
127         INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
128         INIT(CTRunGetInitialAdvance);
129         INIT(RecommendedScrollerStyle);
130         INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
131         INIT(CopyDefaultSearchProviderDisplayName);
132         INIT(SetCrashReportApplicationSpecificInformation);
133         INIT(AVAssetResolvedURL);
134         INIT(Cursor);
135
136 #if USE(CFNETWORK)
137         INIT(GetDefaultHTTPCookieStorage);
138         INIT(CopyCredentialFromCFPersistentStorage);
139         INIT(SetCFURLRequestShouldContentSniff);
140         INIT(CFURLRequestCopyHTTPRequestBodyParts);
141         INIT(CFURLRequestSetHTTPRequestBodyParts);
142         INIT(SetRequestStorageSession);
143 #endif
144
145 #if PLATFORM(MAC)
146         INIT(SpeechSynthesisGetVoiceIdentifiers);
147         INIT(SpeechSynthesisGetDefaultVoiceIdentifierForLocale);
148 #endif
149         INIT(GetAXTextMarkerTypeID);
150         INIT(GetAXTextMarkerRangeTypeID);
151         INIT(CreateAXTextMarker);
152         INIT(GetBytesFromAXTextMarker);
153         INIT(CreateAXTextMarkerRange);
154         INIT(CopyAXTextMarkerRangeStart);
155         INIT(CopyAXTextMarkerRangeEnd);
156         INIT(AccessibilityHandleFocusChanged);
157         INIT(CreateAXUIElementRef);
158         INIT(UnregisterUniqueIdForElement);
159
160         INIT(GetCFURLResponseMIMEType);
161         INIT(GetCFURLResponseURL);
162         INIT(GetCFURLResponseHTTPResponse);
163         INIT(CopyCFURLResponseSuggestedFilename);
164         INIT(SetCFURLResponseMIMEType);
165
166         INIT(CreateVMPressureDispatchOnMainQueue);
167
168         INIT(DestroyRenderingResources);
169
170 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
171         INIT(ExecutableWasLinkedOnOrBeforeLion);
172 #endif
173
174         INIT(CGPathAddRoundedRect);
175         INIT(CFURLRequestAllowAllPostCaching);
176
177 #if USE(CONTENT_FILTERING)
178         INIT(FilterIsManagedSession);
179         INIT(FilterCreateInstance);
180         INIT(FilterWasBlocked);
181         INIT(FilterIsBuffering);
182         INIT(FilterAddData);
183         INIT(FilterDataComplete);
184 #endif
185
186 #if !PLATFORM(IOS) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
187         INIT(NSElasticDeltaForTimeDelta);
188         INIT(NSElasticDeltaForReboundDelta);
189         INIT(NSReboundDeltaForElasticDelta);
190 #endif
191
192 #if ENABLE(PUBLIC_SUFFIX_LIST)
193         INIT(IsPublicSuffix);
194 #endif
195
196 #if ENABLE(CACHE_PARTITIONING)
197         INIT(CachePartitionKey);
198 #endif
199     });
200 }