WebSystemInterface.mm 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. /*
  2. * Copyright 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. *
  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. * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
  14. * its contributors may be used to endorse or promote products derived
  15. * from this software without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
  18. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  19. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  20. * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
  21. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  22. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  23. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  24. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  26. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. */
  28. #import "WebSystemInterface.h"
  29. // Needed for builds not using PCH to expose BUILDING_ macros, see bug 32753.
  30. #include <wtf/Platform.h>
  31. #import <WebCore/WebCoreSystemInterface.h>
  32. #import <WebKitSystemInterface.h>
  33. #define INIT(function) wk##function = WK##function
  34. void InitWebCoreSystemInterface(void)
  35. {
  36. static bool didInit;
  37. if (didInit)
  38. return;
  39. INIT(AdvanceDefaultButtonPulseAnimation);
  40. #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
  41. INIT(CALayerEnumerateRectsBeingDrawnWithBlock);
  42. #endif
  43. INIT(CGContextGetShouldSmoothFonts);
  44. INIT(CGPatternCreateWithImageAndTransform);
  45. INIT(CGContextResetClip);
  46. #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
  47. INIT(CGContextDrawsWithCorrectShadowOffsets);
  48. #endif
  49. #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
  50. INIT(CTFontTransformGlyphs);
  51. #endif
  52. INIT(CopyCFLocalizationPreferredName);
  53. INIT(CopyCONNECTProxyResponse);
  54. INIT(CopyNSURLResponseStatusLine);
  55. #if PLATFORM(MAC)
  56. INIT(CopyNSURLResponseCertificateChain);
  57. #endif
  58. INIT(CreateCustomCFReadStream);
  59. INIT(DrawCapsLockIndicator);
  60. INIT(DrawBezeledTextArea);
  61. INIT(DrawBezeledTextFieldCell);
  62. INIT(DrawFocusRing);
  63. INIT(DrawMediaUIPart);
  64. INIT(DrawMediaSliderTrack);
  65. INIT(DrawTextFieldCellFocusRing);
  66. INIT(GetExtensionsForMIMEType);
  67. INIT(GetFontInLanguageForCharacter);
  68. INIT(GetFontInLanguageForRange);
  69. INIT(GetGlyphTransformedAdvances);
  70. INIT(GetHTTPPipeliningPriority);
  71. INIT(GetMIMETypeForExtension);
  72. INIT(GetNSURLResponseLastModifiedDate);
  73. INIT(SignedPublicKeyAndChallengeString);
  74. INIT(GetPreferredExtensionForMIMEType);
  75. INIT(GetWheelEventDeltas);
  76. #if PLATFORM(MAC)
  77. INIT(GetNSEventKeyChar);
  78. #endif
  79. INIT(HitTestMediaUIPart);
  80. INIT(InitializeMaximumHTTPConnectionCountPerHost);
  81. INIT(MeasureMediaUIPart);
  82. INIT(CreateMediaUIBackgroundView);
  83. INIT(CreateMediaUIControl);
  84. INIT(WindowSetAlpha);
  85. INIT(WindowSetScaledFrame);
  86. INIT(MediaControllerThemeAvailable);
  87. INIT(PopupMenu);
  88. INIT(SetBaseCTM);
  89. INIT(SetCGFontRenderingMode);
  90. INIT(SetCONNECTProxyAuthorizationForStream);
  91. INIT(SetCONNECTProxyForStream);
  92. INIT(SetDragImage);
  93. INIT(SetHTTPPipeliningMaximumPriority);
  94. INIT(SetHTTPPipeliningPriority);
  95. INIT(SetHTTPPipeliningMinimumFastLanePriority);
  96. INIT(SetNSURLConnectionDefersCallbacks);
  97. INIT(SetNSURLRequestShouldContentSniff);
  98. INIT(SetPatternPhaseInUserSpace);
  99. INIT(CGContextIsPDFContext);
  100. INIT(GetUserToBaseCTM);
  101. INIT(SetUpFontCache);
  102. INIT(SignalCFReadStreamEnd);
  103. INIT(SignalCFReadStreamError);
  104. INIT(SignalCFReadStreamHasBytes);
  105. INIT(QTIncludeOnlyModernMediaFileTypes);
  106. INIT(QTMovieDataRate);
  107. INIT(QTMovieDisableComponent);
  108. INIT(QTMovieMaxTimeLoaded);
  109. INIT(QTMovieMaxTimeLoadedChangeNotification);
  110. INIT(QTMovieMaxTimeSeekable);
  111. INIT(QTMovieGetType);
  112. INIT(QTMovieHasClosedCaptions);
  113. INIT(QTMovieResolvedURL);
  114. INIT(QTMovieSetShowClosedCaptions);
  115. INIT(QTMovieSelectPreferredAlternates);
  116. INIT(QTMovieViewSetDrawSynchronously);
  117. INIT(QTGetSitesInMediaDownloadCache);
  118. INIT(QTClearMediaDownloadCacheForSite);
  119. INIT(QTClearMediaDownloadCache);
  120. INIT(GetGlyphsForCharacters);
  121. INIT(GetVerticalGlyphsForCharacters);
  122. #if __MAC_OS_X_VERSION_MIN_REQUIRED == 1060
  123. INIT(GetHyphenationLocationBeforeIndex);
  124. INIT(GetNSEventMomentumPhase);
  125. #endif
  126. INIT(CreateCTLineWithUniCharProvider);
  127. #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
  128. INIT(IOSurfaceContextCreate);
  129. INIT(IOSurfaceContextCreateImage);
  130. INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
  131. INIT(CTRunGetInitialAdvance);
  132. INIT(RecommendedScrollerStyle);
  133. INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
  134. INIT(SetCrashReportApplicationSpecificInformation);
  135. INIT(CopyDefaultSearchProviderDisplayName);
  136. INIT(AVAssetResolvedURL);
  137. INIT(Cursor);
  138. #endif
  139. #if USE(CFNETWORK)
  140. INIT(GetDefaultHTTPCookieStorage);
  141. INIT(CopyCredentialFromCFPersistentStorage);
  142. INIT(SetCFURLRequestShouldContentSniff);
  143. INIT(CFURLRequestCopyHTTPRequestBodyParts);
  144. INIT(CFURLRequestSetHTTPRequestBodyParts);
  145. INIT(SetRequestStorageSession);
  146. #endif
  147. #if PLATFORM(MAC)
  148. INIT(SpeechSynthesisGetVoiceIdentifiers);
  149. INIT(SpeechSynthesisGetDefaultVoiceIdentifierForLocale);
  150. #endif
  151. INIT(GetAXTextMarkerTypeID);
  152. INIT(GetAXTextMarkerRangeTypeID);
  153. INIT(CreateAXTextMarker);
  154. INIT(GetBytesFromAXTextMarker);
  155. INIT(CreateAXTextMarkerRange);
  156. INIT(CopyAXTextMarkerRangeStart);
  157. INIT(CopyAXTextMarkerRangeEnd);
  158. INIT(AccessibilityHandleFocusChanged);
  159. INIT(CreateAXUIElementRef);
  160. INIT(UnregisterUniqueIdForElement);
  161. INIT(CreatePrivateStorageSession);
  162. INIT(CopyRequestWithStorageSession);
  163. INIT(CopyHTTPCookieStorage);
  164. INIT(GetHTTPCookieAcceptPolicy);
  165. #if PLATFORM(MAC)
  166. INIT(HTTPCookies);
  167. #endif
  168. INIT(HTTPCookiesForURL);
  169. INIT(SetHTTPCookiesForURL);
  170. #if PLATFORM(MAC)
  171. INIT(DeleteAllHTTPCookies);
  172. #endif
  173. INIT(DeleteHTTPCookie);
  174. INIT(GetCFURLResponseMIMEType);
  175. INIT(GetCFURLResponseURL);
  176. INIT(GetCFURLResponseHTTPResponse);
  177. INIT(CopyCFURLResponseSuggestedFilename);
  178. INIT(SetCFURLResponseMIMEType);
  179. INIT(SetMetadataURL);
  180. #if PLATFORM(MAC)
  181. // FIXME: We should stop using this file in Chromium.
  182. INIT(DestroyRenderingResources);
  183. #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
  184. INIT(CreateVMPressureDispatchOnMainQueue);
  185. #endif
  186. #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
  187. INIT(CreateMemoryStatusPressureCriticalDispatchOnMainQueue);
  188. #endif
  189. #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
  190. INIT(ExecutableWasLinkedOnOrBeforeLion);
  191. #endif
  192. #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
  193. INIT(CGPathAddRoundedRect);
  194. #endif
  195. #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
  196. INIT(CFURLRequestAllowAllPostCaching);
  197. #endif
  198. #if USE(CONTENT_FILTERING)
  199. INIT(FilterIsManagedSession);
  200. INIT(FilterCreateInstance);
  201. INIT(FilterWasBlocked);
  202. INIT(FilterIsBuffering);
  203. INIT(FilterAddData);
  204. INIT(FilterDataComplete);
  205. #endif
  206. #if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
  207. INIT(NSElasticDeltaForTimeDelta);
  208. INIT(NSElasticDeltaForReboundDelta);
  209. INIT(NSReboundDeltaForElasticDelta);
  210. #endif
  211. #if ENABLE(PUBLIC_SUFFIX_LIST)
  212. INIT(IsPublicSuffix);
  213. #endif
  214. #if ENABLE(CACHE_PARTITIONING)
  215. INIT(CachePartitionKey);
  216. #endif
  217. #endif
  218. didInit = true;
  219. }