[Cocoa] Adopt modern API availability macros
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Jul 2016 17:08:20 +0000 (17:08 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 3 Jul 2016 17:08:20 +0000 (17:08 +0000)
commitd71b08e37c3f6c1bc3c4d85919b010766d1d0eb7
treea5864fdabd8313b7579c3d700ac9dbfd235ba43a
parentd6b42714b66cc6a723582ff866550186c3807e76
[Cocoa] Adopt modern API availability macros
https://bugs.webkit.org/show_bug.cgi?id=159378

Reviewed by Sam Weinig.

iOS 10 and macOS Sierra introduce new macros for declaring API availability, defined in
CFAvailability.h, including API_AVAILABLE, API_DEPRECATED, and
API_DEPRECATED_WITH_REPLACEMENT. Rather than having positional parameters for macOS and iOS
versions, the new macros take a variable number of function-like parameters, where the
function specifies the platform to which it applies.

To have WebKit2’s postprocessed headers use the new macros, we make the following changes:

- Replace instances of WK_AVAILABLE(_mac, _ios) with WK_API_AVAILABLE(macosx(_mac), ios(_ios)),
  eliding a platform if its current availability is NA.
- Change instances of WK_CLASS_AVAILABLE(_mac, _ios) to
  WK_CLASS_AVAILABLE(macosx(_mac), ios(_ios)), eliding a platform if its current
  availability is NA.
- Replace instances of WK_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...) with
  WK_API_DEPRECATED_WITH_REPLACEMENT(_replacement, macosx(_macIntro, _macDep), ios(_iosIntro, _iosDep))
  when there is a one-for-one replacement, and with
  WK_API_DEPRECATED(_message, macosx(_macIntro, _macDep), ios(_iosIntro, _iosDep)) when the
  replacement isn’t one-for-one. Again, if the API doesn’t apply to a platform, then it’s
  elided.
- Replace instances of WK_CLASS_DEPRECATED with WK_CLASS_DEPRECATED_WITH_REPLACEMENT,
  following the same rules.
- Replace instances of the WK_ENUM_* macros with corresponding WK_API_* macros, now that
  all supported compilers support availability attributes on enum values.

* Configurations/WebKit.xcconfig: Disable header postprocessing when building for iOS 9.x,
  which doesn’t have the new macros.

* mac/postprocess-framework-headers.sh: Handle the new WK_* macros: WK_API_AVAILABLE becomes
  API_AVAILABLE; WK_API_DEPRECATED(_WITH_REPLACEMENT) become API_DEPRECATED(_WITH_REPLACEMENT);
  WK_CLASS_AVAILABLE and WK_CLASS_DEPRECATED(_WITH_REPLACEMENT) change to the corresponding
  API_ macros, prefixed with WK_EXTERN.
* Shared/API/Cocoa/WKFoundation.h: When header postprocessing is disabled, provide
  definitions of the new WK_* macros we use.

* UIProcess/API/Cocoa/WKWebViewConfiguration.h: In addition to the above, changed one
  instance of (iOS) 10_0 to WK_IOS_TBA.

Made the above changes in the following headers:

* Shared/API/Cocoa/WKBrowsingContextHandle.h:
* Shared/API/Cocoa/_WKFrameHandle.h:
* Shared/API/Cocoa/_WKHitTestResult.h:
* Shared/API/Cocoa/_WKRemoteObjectInterface.h:
* Shared/API/Cocoa/_WKRemoteObjectRegistry.h:
* Shared/API/Cocoa/_WKRenderingProgressEvents.h:
* Shared/API/Cocoa/_WKSameDocumentNavigationType.h:
* UIProcess/API/Cocoa/WKBackForwardList.h:
* UIProcess/API/Cocoa/WKBackForwardListItem.h:
* UIProcess/API/Cocoa/WKBrowsingContextController.h:
* UIProcess/API/Cocoa/WKBrowsingContextGroup.h:
* UIProcess/API/Cocoa/WKConnection.h:
* UIProcess/API/Cocoa/WKError.h:
* UIProcess/API/Cocoa/WKErrorPrivate.h:
* UIProcess/API/Cocoa/WKFrameInfo.h:
* UIProcess/API/Cocoa/WKFrameInfoPrivate.h:
* UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h:
* UIProcess/API/Cocoa/WKNavigation.h:
* UIProcess/API/Cocoa/WKNavigationAction.h:
* UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
* UIProcess/API/Cocoa/WKNavigationData.h:
* UIProcess/API/Cocoa/WKNavigationDelegate.h:
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/API/Cocoa/WKNavigationResponse.h:
* UIProcess/API/Cocoa/WKOpenPanelParameters.h:
* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
* UIProcess/API/Cocoa/WKPreviewActionItem.h:
* UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h:
* UIProcess/API/Cocoa/WKPreviewElementInfo.h:
* UIProcess/API/Cocoa/WKProcessGroup.h:
* UIProcess/API/Cocoa/WKProcessPool.h:
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/WKScriptMessage.h:
* UIProcess/API/Cocoa/WKSecurityOrigin.h:
* UIProcess/API/Cocoa/WKTypeRefWrapper.h:
* UIProcess/API/Cocoa/WKUIDelegate.h:
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKUserContentController.h:
* UIProcess/API/Cocoa/WKUserContentControllerPrivate.h:
* UIProcess/API/Cocoa/WKUserScript.h:
* UIProcess/API/Cocoa/WKUserScriptPrivate.h:
* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
* UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.h:
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/API/Cocoa/WKWindowFeatures.h:
* UIProcess/API/Cocoa/_WKActivatedElementInfo.h:
* UIProcess/API/Cocoa/_WKAutomationSession.h:
* UIProcess/API/Cocoa/_WKContextMenuElementInfo.h:
* UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h:
* UIProcess/API/Cocoa/_WKDownload.h:
* UIProcess/API/Cocoa/_WKElementAction.h:
* UIProcess/API/Cocoa/_WKExperimentalFeature.h:
* UIProcess/API/Cocoa/_WKFindOptions.h:
* UIProcess/API/Cocoa/_WKFormInputSession.h:
* UIProcess/API/Cocoa/_WKInputDelegate.h:
* UIProcess/API/Cocoa/_WKLayoutMode.h:
* UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKSessionState.h:
* UIProcess/API/Cocoa/_WKThumbnailView.h:
* UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
* UIProcess/API/Cocoa/_WKUserContentFilter.h:
* UIProcess/API/Cocoa/_WKUserContentWorld.h:
* UIProcess/API/Cocoa/_WKUserStyleSheet.h:
* UIProcess/API/Cocoa/_WKVisitedLinkProvider.h:
* UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
* UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
* UIProcess/API/Cocoa/_WKWebsiteDataSize.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
* WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
* WebProcess/InjectedBundle/API/mac/WKDOMElement.h:
* WebProcess/InjectedBundle/API/mac/WKDOMNode.h:
* WebProcess/InjectedBundle/API/mac/WKDOMRange.h:
* WebProcess/InjectedBundle/API/mac/WKDOMText.h:
* WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h:
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
94 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/WebKit.xcconfig
Source/WebKit2/Shared/API/Cocoa/WKBrowsingContextHandle.h
Source/WebKit2/Shared/API/Cocoa/WKFoundation.h
Source/WebKit2/Shared/API/Cocoa/_WKFrameHandle.h
Source/WebKit2/Shared/API/Cocoa/_WKHitTestResult.h
Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectInterface.h
Source/WebKit2/Shared/API/Cocoa/_WKRemoteObjectRegistry.h
Source/WebKit2/Shared/API/Cocoa/_WKRenderingProgressEvents.h
Source/WebKit2/Shared/API/Cocoa/_WKSameDocumentNavigationType.h
Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardList.h
Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItem.h
Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextController.h
Source/WebKit2/UIProcess/API/Cocoa/WKBrowsingContextGroup.h
Source/WebKit2/UIProcess/API/Cocoa/WKConnection.h
Source/WebKit2/UIProcess/API/Cocoa/WKError.h
Source/WebKit2/UIProcess/API/Cocoa/WKErrorPrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKFrameInfo.h
Source/WebKit2/UIProcess/API/Cocoa/WKFrameInfoPrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKMenuItemIdentifiersPrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKNavigation.h
Source/WebKit2/UIProcess/API/Cocoa/WKNavigationAction.h
Source/WebKit2/UIProcess/API/Cocoa/WKNavigationActionPrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKNavigationData.h
Source/WebKit2/UIProcess/API/Cocoa/WKNavigationDelegate.h
Source/WebKit2/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKNavigationResponse.h
Source/WebKit2/UIProcess/API/Cocoa/WKOpenPanelParameters.h
Source/WebKit2/UIProcess/API/Cocoa/WKPreferences.h
Source/WebKit2/UIProcess/API/Cocoa/WKPreferencesPrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKPreviewActionItem.h
Source/WebKit2/UIProcess/API/Cocoa/WKPreviewActionItemIdentifiers.h
Source/WebKit2/UIProcess/API/Cocoa/WKPreviewElementInfo.h
Source/WebKit2/UIProcess/API/Cocoa/WKProcessGroup.h
Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.h
Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKScriptMessage.h
Source/WebKit2/UIProcess/API/Cocoa/WKSecurityOrigin.h
Source/WebKit2/UIProcess/API/Cocoa/WKTypeRefWrapper.h
Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegate.h
Source/WebKit2/UIProcess/API/Cocoa/WKUIDelegatePrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.h
Source/WebKit2/UIProcess/API/Cocoa/WKUserContentControllerPrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKUserScript.h
Source/WebKit2/UIProcess/API/Cocoa/WKUserScriptPrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecord.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h
Source/WebKit2/UIProcess/API/Cocoa/WKWindowFeatures.h
Source/WebKit2/UIProcess/API/Cocoa/_WKActivatedElementInfo.h
Source/WebKit2/UIProcess/API/Cocoa/_WKAutomationSession.h
Source/WebKit2/UIProcess/API/Cocoa/_WKContextMenuElementInfo.h
Source/WebKit2/UIProcess/API/Cocoa/_WKDiagnosticLoggingDelegate.h
Source/WebKit2/UIProcess/API/Cocoa/_WKDownload.h
Source/WebKit2/UIProcess/API/Cocoa/_WKElementAction.h
Source/WebKit2/UIProcess/API/Cocoa/_WKExperimentalFeature.h
Source/WebKit2/UIProcess/API/Cocoa/_WKFindOptions.h
Source/WebKit2/UIProcess/API/Cocoa/_WKFormInputSession.h
Source/WebKit2/UIProcess/API/Cocoa/_WKInputDelegate.h
Source/WebKit2/UIProcess/API/Cocoa/_WKLayoutMode.h
Source/WebKit2/UIProcess/API/Cocoa/_WKOverlayScrollbarStyle.h
Source/WebKit2/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h
Source/WebKit2/UIProcess/API/Cocoa/_WKSessionState.h
Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.h
Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentExtensionStore.h
Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentFilter.h
Source/WebKit2/UIProcess/API/Cocoa/_WKUserContentWorld.h
Source/WebKit2/UIProcess/API/Cocoa/_WKUserStyleSheet.h
Source/WebKit2/UIProcess/API/Cocoa/_WKVisitedLinkProvider.h
Source/WebKit2/UIProcess/API/Cocoa/_WKVisitedLinkStore.h
Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecord.h
Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataSize.h
Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.h
Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h
Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h
Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInHitTestResult.h
Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h
Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h
Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMDocument.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMElement.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMNode.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMText.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.h
Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h
Source/WebKit2/mac/postprocess-framework-headers.sh