Title: [161332] trunk/Source
Revision
161332
Author
[email protected]
Date
2014-01-06 00:15:52 -0800 (Mon, 06 Jan 2014)

Log Message

<https://webkit.org/b/126499> Move WebKit off the legacy WebKit availability macros

The legacy WebKit availability macros are verbose, confusing, and provide no benefit
over using the system availability macros directly. The original vision was that
they'd serve a cross-platform purpose but that never came to be.

Since WebKit1 is API on OS X but SPI on iOS, some indirection is still needed in the
availability macros to allow the headers to advertise the API as unavailable on OS X
without interfering with the ability to build on iOS. This is achieved by defining
WEBKIT-prefixed versions of the Foundation availability macros that are defined to
their NS-prefixed equivalents. The installed headers are post-processed to map these
macros back to their Foundation equivalents.

Part of <rdar://problem/15512304>.

Source/WebCore:

Reviewed by Sam Weinig.

* WebCore.xcodeproj/project.pbxproj:
* bindings/objc/WebKitAvailability.h: Added. This lives at the WebCore level since it
will be needed by the Objective-C DOM bindings.

Source/WebKit:

Reviewed by Sam Weinig.

* WebKit.xcodeproj/project.pbxproj: Change the Postprocess Headers build phase to
invoke mac/postprocess-headers.sh.

Source/WebKit/mac:

The OS X version used in the new availability macros is based on the mapping in
_javascript_Core/WebKitAvailability.h.

Reviewed by Sam Weinig.

* Carbon/CarbonUtils.h:
* Carbon/HIWebView.h:
* MigrateHeaders.make: Migrate WebKitAvailability.h from WebCore as an API header.
* Plugins/WebPlugin.h:
* Plugins/WebPluginViewFactory.h:
* WebView/WebFrameLoadDelegate.h:
* WebView/WebResourceLoadDelegatePrivate.h:
* WebView/WebUIDelegate.h:
* postprocess-headers.sh: Added. Extracted from the Xcode project. Extended to map the
WEBKIT-prefixed macros to their NS-prefixed equivalents on OS X and to remove them on iOS.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (161331 => 161332)


--- trunk/Source/WebCore/ChangeLog	2014-01-06 07:54:02 UTC (rev 161331)
+++ trunk/Source/WebCore/ChangeLog	2014-01-06 08:15:52 UTC (rev 161332)
@@ -1,3 +1,26 @@
+2014-01-06  Mark Rowe  <[email protected]>
+
+        <https://webkit.org/b/126499> Move WebKit off the legacy WebKit availability macros
+
+        The legacy WebKit availability macros are verbose, confusing, and provide no benefit
+        over using the system availability macros directly. The original vision was that
+        they'd serve a cross-platform purpose but that never came to be.
+
+        Since WebKit1 is API on OS X but SPI on iOS, some indirection is still needed in the
+        availability macros to allow the headers to advertise the API as unavailable on OS X
+        without interfering with the ability to build on iOS. This is achieved by defining
+        WEBKIT-prefixed versions of the Foundation availability macros that are defined to
+        their NS-prefixed equivalents. The installed headers are post-processed to map these
+        macros back to their Foundation equivalents.
+
+        Part of <rdar://problem/15512304>.
+
+        Reviewed by Sam Weinig.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/objc/WebKitAvailability.h: Added. This lives at the WebCore level since it
+        will be needed by the Objective-C DOM bindings.
+
 2014-01-05  Simon Fraser  <[email protected]>
 
         Move responsibility for remote layer tree committing to RemoteLayerTreeDrawingArea

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (161331 => 161332)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2014-01-06 07:54:02 UTC (rev 161331)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2014-01-06 08:15:52 UTC (rev 161332)
@@ -1968,6 +1968,7 @@
 		5DFE8F570D16477C0076E937 /* ScheduledAction.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA378BB0D15F64200B793D6 /* ScheduledAction.h */; };
 		5F2DBBE9178E3C8100141486 /* CertificateInfoMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5F2DBBE7178E332D00141486 /* CertificateInfoMac.mm */; };
 		5FA904CA178E61F5004C8A2D /* CertificateInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F2DBBE8178E336900141486 /* CertificateInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		5DFEBAB718592B6D00C75BEB /* WebKitAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 5DFEBAB618592B6D00C75BEB /* WebKitAvailability.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		5FC7DC26CFE2563200B85AE4 /* JSEventTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */; };
 		5FE1D292178FD1F3001AA3C3 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5FE1D291178FD1F3001AA3C3 /* Security.framework */; };
 		626CDE0E1140424C001E5A68 /* SpatialNavigation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */; };
@@ -8768,6 +8769,7 @@
 		5DB1BC6910715A6400EFAA49 /* TransformSourceLibxslt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TransformSourceLibxslt.cpp; sourceTree = "<group>"; };
 		5F2DBBE7178E332D00141486 /* CertificateInfoMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CertificateInfoMac.mm; sourceTree = "<group>"; };
 		5F2DBBE8178E336900141486 /* CertificateInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CertificateInfo.h; sourceTree = "<group>"; };
+		5DFEBAB618592B6D00C75BEB /* WebKitAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitAvailability.h; sourceTree = "<group>"; };
 		5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSEventTarget.h; sourceTree = "<group>"; };
 		5FE1D291178FD1F3001AA3C3 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
 		626CDE0C1140424C001E5A68 /* SpatialNavigation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpatialNavigation.cpp; sourceTree = "<group>"; };
@@ -19867,6 +19869,7 @@
 				1CF6BE130E9BB4670025E1CD /* ObjCNodeFilterCondition.h */,
 				1CF6BE120E9BB4670025E1CD /* ObjCNodeFilterCondition.mm */,
 				1CD0B6200AABDB5000D0A3FF /* PublicDOMInterfaces.h */,
+				5DFEBAB618592B6D00C75BEB /* WebKitAvailability.h */,
 				1CAF347E0A6C405200ABE06E /* WebScriptObject.h */,
 				1CAF347F0A6C405200ABE06E /* WebScriptObject.mm */,
 				1CAF34800A6C405200ABE06E /* WebScriptObjectPrivate.h */,
@@ -23771,6 +23774,7 @@
 				1AE2AE5C0A1D26F200B42B25 /* JSHTMLMenuElement.h in Headers */,
 				A80E7A180A19C3D6007FB8C5 /* JSHTMLMetaElement.h in Headers */,
 				A7BBE26711AFB3F20005EA03 /* JSHTMLMeterElement.h in Headers */,
+				5DFEBAB718592B6D00C75BEB /* WebKitAvailability.h in Headers */,
 				1AE2AB2A0A1CE63B00B42B25 /* JSHTMLModElement.h in Headers */,
 				BC305C7A0C076BB300CD20F0 /* JSHTMLObjectElement.h in Headers */,
 				1A85B1EB0A1B240500D8C87C /* JSHTMLOListElement.h in Headers */,

Added: trunk/Source/WebCore/bindings/objc/WebKitAvailability.h (0 => 161332)


--- trunk/Source/WebCore/bindings/objc/WebKitAvailability.h	                        (rev 0)
+++ trunk/Source/WebCore/bindings/objc/WebKitAvailability.h	2014-01-06 08:15:52 UTC (rev 161332)
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebKit_WebKitAvailability_h
+#define WebKit_WebKitAvailability_h
+
+#import <TargetConditionals.h>
+
+#if !TARGET_OS_IPHONE
+
+#define WEBKIT_AVAILABLE_MAC(introduced) NS_AVAILABLE_MAC(introduced)
+#define WEBKIT_CLASS_AVAILABLE_MAC(introduced) NS_CLASS_AVAILABLE_MAC(introduced)
+#define WEBKIT_ENUM_AVAILABLE_MAC(introduced) NS_ENUM_AVAILABLE_MAC(introduced)
+#define WEBKIT_DEPRECATED_MAC(introduced, deprecated) NS_DEPRECATED_MAC(introduced, deprecated)
+
+#else
+
+#define WEBKIT_AVAILABLE_MAC(introduced)
+#define WEBKIT_CLASS_AVAILABLE_MAC(introduced)
+#define WEBKIT_ENUM_AVAILABLE_MAC(introduced)
+#define WEBKIT_DEPRECATED_MAC(introduced, deprecated)
+
+#endif /* !TARGET_OS_IPHONE */
+
+#endif /* WebKit_WebKitAvailability_h */

Modified: trunk/Source/WebKit/ChangeLog (161331 => 161332)


--- trunk/Source/WebKit/ChangeLog	2014-01-06 07:54:02 UTC (rev 161331)
+++ trunk/Source/WebKit/ChangeLog	2014-01-06 08:15:52 UTC (rev 161332)
@@ -1,3 +1,25 @@
+2014-01-06  Mark Rowe  <[email protected]>
+
+        <https://webkit.org/b/126499> Move WebKit off the legacy WebKit availability macros
+
+        The legacy WebKit availability macros are verbose, confusing, and provide no benefit
+        over using the system availability macros directly. The original vision was that
+        they'd serve a cross-platform purpose but that never came to be.
+
+        Since WebKit1 is API on OS X but SPI on iOS, some indirection is still needed in the
+        availability macros to allow the headers to advertise the API as unavailable on OS X
+        without interfering with the ability to build on iOS. This is achieved by defining
+        WEBKIT-prefixed versions of the Foundation availability macros that are defined to
+        their NS-prefixed equivalents. The installed headers are post-processed to map these
+        macros back to their Foundation equivalents.
+
+        Part of <rdar://problem/15512304>.
+
+        Reviewed by Sam Weinig.
+
+        * WebKit.xcodeproj/project.pbxproj: Change the Postprocess Headers build phase to
+        invoke mac/postprocess-headers.sh.
+
 2014-01-05  Martin Robinson  <[email protected]>
 
         [GTK] [CMake] Ensure that the autotools build and the CMake install the same files

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (161331 => 161332)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2014-01-06 07:54:02 UTC (rev 161331)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2014-01-06 08:15:52 UTC (rev 161332)
@@ -2137,7 +2137,7 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
-			shellScript = "postProcessInDirectory() {\n    cd \"$1\"\n\n    if [[ ${PLATFORM_NAME} == iphoneos ]]; then\n        local unifdefOptions=\"-DTARGET_OS_EMBEDDED=1 -DTARGET_OS_IPHONE=1 -DTARGET_IPHONE_SIMULATOR=0\";\n    elif [[ ${PLATFORM_NAME} == iphonesimulator ]]; then\n        local unifdefOptions=\"-DTARGET_OS_EMBEDDED=0 -DTARGET_OS_IPHONE=1 -DTARGET_IPHONE_SIMULATOR=1\";\n    else\n        local unifdefOptions=\"-DTARGET_OS_EMBEDDED=0 -DTARGET_OS_IPHONE=0 -DTARGET_IPHONE_SIMULATOR=0\";\n    fi\n\n    for header in $(find . -name '*.h' -type f); do\n        unifdef -B ${unifdefOptions} -o ${header}.unifdef ${header}\n        case $? in\n        0)\n            rm ${header}.unifdef\n            ;;\n        1)\n            mv ${header}{.unifdef,}\n            ;;\n        *)\n            exit 1\n            ;;\n        esac\n    done\n}\n\npostProcessInDirectory \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\"\npostProcessInDirectory \"${TARGET_BUILD_DIR}/${PRIVATE_HEADERS_FOLDER_PATH}\"";
+			shellScript = "exec ${SRCROOT}/mac/postprocess-headers.sh";
 		};
 		A55DEAA516703F9F003DB841 /* Check For Inappropriate Macros in External Headers */ = {
 			isa = PBXShellScriptBuildPhase;

Modified: trunk/Source/WebKit/mac/Carbon/CarbonUtils.h (161331 => 161332)


--- trunk/Source/WebKit/mac/Carbon/CarbonUtils.h	2014-01-06 07:54:02 UTC (rev 161331)
+++ trunk/Source/WebKit/mac/Carbon/CarbonUtils.h	2014-01-06 08:15:52 UTC (rev 161332)
@@ -33,7 +33,7 @@
 
 // These functions are only available for 32-bit.
 
-#include <_javascript_Core/WebKitAvailability.h>
+#include <WebKit/WebKitAvailability.h>
 
 #ifdef __OBJC__
 #import <ApplicationServices/ApplicationServices.h>
@@ -45,12 +45,12 @@
 #endif
 
 extern void
-WebInitForCarbon(void) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0;
+WebInitForCarbon(void) CF_DEPRECATED_MAC(10_3, 10_6);
 
 #ifdef __OBJC__
 
 extern CGImageRef
-WebConvertNSImageToCGImageRef(NSImage * inImage) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0;
+WebConvertNSImageToCGImageRef(NSImage * inImage) CF_DEPRECATED_MAC(10_3, 10_6);
 
 #endif
 

Modified: trunk/Source/WebKit/mac/Carbon/HIWebView.h (161331 => 161332)


--- trunk/Source/WebKit/mac/Carbon/HIWebView.h	2014-01-06 07:54:02 UTC (rev 161331)
+++ trunk/Source/WebKit/mac/Carbon/HIWebView.h	2014-01-06 08:15:52 UTC (rev 161332)
@@ -33,7 +33,7 @@
 
 #include <Carbon/Carbon.h>
 
-#include <_javascript_Core/WebKitAvailability.h>
+#include <WebKit/WebKitAvailability.h>
 
 #if PRAGMA_ONCE
 #pragma once
@@ -67,7 +67,7 @@
  *    Non-Carbon CFM:   not available
  */
 extern OSStatus 
-HIWebViewCreate(HIViewRef * outControl) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0;
+HIWebViewCreate(HIViewRef * outControl) CF_DEPRECATED_MAC(10_3, 10_6, "Use WebView instead.");
 
 #ifdef __OBJC__
 
@@ -91,7 +91,7 @@
  *    Non-Carbon CFM:   not available
  */
 extern WebView *
-HIWebViewGetWebView(HIViewRef inView) AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_4_0;
+HIWebViewGetWebView(HIViewRef inView) CF_DEPRECATED_MAC(10_3, 10_6);
 
 #endif
 

Modified: trunk/Source/WebKit/mac/ChangeLog (161331 => 161332)


--- trunk/Source/WebKit/mac/ChangeLog	2014-01-06 07:54:02 UTC (rev 161331)
+++ trunk/Source/WebKit/mac/ChangeLog	2014-01-06 08:15:52 UTC (rev 161332)
@@ -1,3 +1,36 @@
+2014-01-06  Mark Rowe  <[email protected]>
+
+        <https://webkit.org/b/126499> Move WebKit off the legacy WebKit availability macros
+
+        The legacy WebKit availability macros are verbose, confusing, and provide no benefit
+        over using the system availability macros directly. The original vision was that
+        they'd serve a cross-platform purpose but that never came to be.
+
+        Since WebKit1 is API on OS X but SPI on iOS, some indirection is still needed in the
+        availability macros to allow the headers to advertise the API as unavailable on OS X
+        without interfering with the ability to build on iOS. This is achieved by defining
+        WEBKIT-prefixed versions of the Foundation availability macros that are defined to
+        their NS-prefixed equivalents. The installed headers are post-processed to map these
+        macros back to their Foundation equivalents.
+
+        Part of <rdar://problem/15512304>.
+
+        The OS X version used in the new availability macros is based on the mapping in
+        _javascript_Core/WebKitAvailability.h.
+
+        Reviewed by Sam Weinig.
+
+        * Carbon/CarbonUtils.h:
+        * Carbon/HIWebView.h:
+        * MigrateHeaders.make: Migrate WebKitAvailability.h from WebCore as an API header.
+        * Plugins/WebPlugin.h:
+        * Plugins/WebPluginViewFactory.h:
+        * WebView/WebFrameLoadDelegate.h:
+        * WebView/WebResourceLoadDelegatePrivate.h:
+        * WebView/WebUIDelegate.h:
+        * postprocess-headers.sh: Added. Extracted from the Xcode project. Extended to map the
+        WEBKIT-prefixed macros to their NS-prefixed equivalents on OS X and to remove them on iOS.
+
 2014-01-04  Zan Dobersek  <[email protected]>
 
         Explicitly use the std:: nested name specifier when using std::pair, std::make_pair

Modified: trunk/Source/WebKit/mac/MigrateHeaders.make (161331 => 161332)


--- trunk/Source/WebKit/mac/MigrateHeaders.make	2014-01-06 07:54:02 UTC (rev 161331)
+++ trunk/Source/WebKit/mac/MigrateHeaders.make	2014-01-06 08:15:52 UTC (rev 161332)
@@ -182,6 +182,7 @@
     $(PUBLIC_HEADERS_DIR)/DOMXPathExpression.h \
     $(PUBLIC_HEADERS_DIR)/DOMXPathNSResolver.h \
     $(PUBLIC_HEADERS_DIR)/DOMXPathResult.h \
+    $(PUBLIC_HEADERS_DIR)/WebKitAvailability.h \
     $(PUBLIC_HEADERS_DIR)/WebScriptObject.h \
     $(PUBLIC_HEADERS_DIR)/npapi.h \
     $(PUBLIC_HEADERS_DIR)/npfunctions.h \

Modified: trunk/Source/WebKit/mac/Plugins/WebPlugin.h (161331 => 161332)


--- trunk/Source/WebKit/mac/Plugins/WebPlugin.h	2014-01-06 07:54:02 UTC (rev 161331)
+++ trunk/Source/WebKit/mac/Plugins/WebPlugin.h	2014-01-06 08:15:52 UTC (rev 161332)
@@ -27,7 +27,7 @@
  */
 
 #import <Foundation/Foundation.h>
-#import <_javascript_Core/WebKitAvailability.h>
+#import <WebKit/WebKitAvailability.h>
 
 #if !TARGET_OS_IPHONE
 #import <AppKit/AppKit.h>
@@ -106,7 +106,7 @@
     @discussion This method is only sent to the plug-in if the
     WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
 */
-- (void)webPlugInMainResourceDidReceiveResponse:(NSURLResponse *)response WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
+- (void)webPlugInMainResourceDidReceiveResponse:(NSURLResponse *)response WEBKIT_AVAILABLE_MAC(10_6);
 
 /*!
     @method webPlugInMainResourceDidReceiveData:
@@ -115,7 +115,7 @@
     @discussion This method is only sent to the plug-in if the
     WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
 */
-- (void)webPlugInMainResourceDidReceiveData:(NSData *)data WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
+- (void)webPlugInMainResourceDidReceiveData:(NSData *)data WEBKIT_AVAILABLE_MAC(10_6);
 
 /*!
     @method webPlugInMainResourceDidFailWithError:
@@ -124,7 +124,7 @@
     @discussion This method is only sent to the plug-in if the
     WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
 */
-- (void)webPlugInMainResourceDidFailWithError:(NSError *)error WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
+- (void)webPlugInMainResourceDidFailWithError:(NSError *)error WEBKIT_AVAILABLE_MAC(10_6);
 
 /*!
     @method webPlugInMainResourceDidFinishLoading
@@ -133,6 +133,6 @@
     @discussion This method is only sent to the plug-in if the
     WebPlugInShouldLoadMainResourceKey argument passed to the plug-in was NO.
 */
-- (void)webPlugInMainResourceDidFinishLoading WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
+- (void)webPlugInMainResourceDidFinishLoading WEBKIT_AVAILABLE_MAC(10_6);
 
 @end

Modified: trunk/Source/WebKit/mac/Plugins/WebPluginViewFactory.h (161331 => 161332)


--- trunk/Source/WebKit/mac/Plugins/WebPluginViewFactory.h	2014-01-06 07:54:02 UTC (rev 161331)
+++ trunk/Source/WebKit/mac/Plugins/WebPluginViewFactory.h	2014-01-06 08:15:52 UTC (rev 161332)
@@ -27,7 +27,7 @@
  */
 
 #import <Foundation/Foundation.h>
-#import <_javascript_Core/WebKitAvailability.h>
+#import <WebKit/WebKitAvailability.h>
 
 #if !TARGET_OS_IPHONE
 #import <AppKit/AppKit.h>
@@ -70,7 +70,7 @@
  For compatibility with older versions of WebKit, the plug-in should assume that the value for
  WebPlugInShouldLoadMainResourceKey is NO if it is absent from the arguments dictionary.
  */
-extern NSString *WebPlugInShouldLoadMainResourceKey AVAILABLE_IN_WEBKIT_VERSION_4_0;
+extern NSString *WebPlugInShouldLoadMainResourceKey WEBKIT_AVAILABLE_MAC(10_6);
 
 /*!
     @protocol WebPlugInViewFactory

Modified: trunk/Source/WebKit/mac/WebView/WebFrameLoadDelegate.h (161331 => 161332)


--- trunk/Source/WebKit/mac/WebView/WebFrameLoadDelegate.h	2014-01-06 07:54:02 UTC (rev 161331)
+++ trunk/Source/WebKit/mac/WebView/WebFrameLoadDelegate.h	2014-01-06 08:15:52 UTC (rev 161332)
@@ -28,7 +28,7 @@
 
 #import <Foundation/Foundation.h>
 #import <_javascript_Core/JSBase.h>
-#import <_javascript_Core/WebKitAvailability.h>
+#import <WebKit/WebKitAvailability.h>
 
 #if !TARGET_OS_IPHONE
 #import <AppKit/AppKit.h>
@@ -203,7 +203,7 @@
     @discussion This method is deprecated. Consider using webView:didClearWindowObject:forFrame:
     instead.
 */
-- (void)webView:(WebView *)webView windowScriptObjectAvailable:(WebScriptObject *)windowScriptObject WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_3_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
+- (void)webView:(WebView *)webView windowScriptObjectAvailable:(WebScriptObject *)windowScriptObject WEBKIT_DEPRECATED_MAC(10_4, 10_5);
 
 #if JSC_OBJC_API_ENABLED
 /*!

Modified: trunk/Source/WebKit/mac/WebView/WebResourceLoadDelegatePrivate.h (161331 => 161332)


--- trunk/Source/WebKit/mac/WebView/WebResourceLoadDelegatePrivate.h	2014-01-06 07:54:02 UTC (rev 161331)
+++ trunk/Source/WebKit/mac/WebView/WebResourceLoadDelegatePrivate.h	2014-01-06 08:15:52 UTC (rev 161332)
@@ -37,15 +37,13 @@
 - (void)webView:(WebView *)webView didLoadResourceFromMemoryCache:(NSURLRequest *)request response:(NSURLResponse *)response length:(NSInteger)length fromDataSource:(WebDataSource *)dataSource;
 - (BOOL)webView:(WebView *)webView resource:(id)identifier shouldUseCredentialStorageForDataSource:(WebDataSource *)dataSource;
 
-#if WEBKIT_VERSION_MAX_ALLOWED > WEBKIT_VERSION_4_0
 /*!
  @method webView:resource:canAuthenticateAgainstProtectionSpace:forDataSource:
  @abstract Inspect an NSURLProtectionSpace before an authentication attempt is made. Only used on Snow Leopard or newer.
  @param protectionSpace an NSURLProtectionSpace that will be used to generate an authentication challenge
  @result Return YES if the resource load delegate is prepared to respond to an authentication challenge generated with protectionSpace, NO otherwise
  */
-- (BOOL)webView:(WebView *)sender resource:(id)identifier canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace forDataSource:(WebDataSource *)dataSource;
-#endif
+- (BOOL)webView:(WebView *)sender resource:(id)identifier canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace forDataSource:(WebDataSource *)dataSource WEBKIT_AVAILABLE_MAC(10_6);
 
 /*!
  @method webView:shouldPaintBrokenImageForURL:(NSURL*)imageURL

Modified: trunk/Source/WebKit/mac/WebView/WebUIDelegate.h (161331 => 161332)


--- trunk/Source/WebKit/mac/WebView/WebUIDelegate.h	2014-01-06 07:54:02 UTC (rev 161331)
+++ trunk/Source/WebKit/mac/WebView/WebUIDelegate.h	2014-01-06 08:15:52 UTC (rev 161332)
@@ -28,7 +28,7 @@
 
 #import <Foundation/Foundation.h>
 #import <Foundation/NSURLRequest.h>
-#import <_javascript_Core/WebKitAvailability.h>
+#import <WebKit/WebKitAvailability.h>
 
 #if !TARGET_OS_IPHONE
 #import <AppKit/AppKit.h>
@@ -133,7 +133,7 @@
     @abstract Call this method to return an array of filenames from the file open panel.
     @param fileNames
 */
-- (void)chooseFilenames:(NSArray *)fileNames WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
+- (void)chooseFilenames:(NSArray *)fileNames WEBKIT_AVAILABLE_MAC(10_6);
 
 /*!
     @method cancel
@@ -426,7 +426,7 @@
     @discussion This method is passed a callback object instead of giving a return
     value so that it can be handled with a sheet.
 */
-- (void)webView:(WebView *)sender runOpenPanelForFileButtonWithResultListener:(id<WebOpenPanelResultListener>)resultListener allowMultipleFiles:(BOOL)allowMultipleFiles WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_IN_WEBKIT_VERSION_4_0);
+- (void)webView:(WebView *)sender runOpenPanelForFileButtonWithResultListener:(id<WebOpenPanelResultListener>)resultListener allowMultipleFiles:(BOOL)allowMultipleFiles WEBKIT_AVAILABLE_MAC(10_6);
 
 /*!
     @method webView:mouseDidMoveOverElement:modifierFlags:
@@ -573,12 +573,12 @@
 
 // The following delegate methods are deprecated in favor of the ones above that specify
 // the WebFrame whose _javascript_ initiated this call.
-- (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
-- (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
-- (NSString *)webView:(WebView *)sender runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
+- (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message WEBKIT_DEPRECATED_MAC(10_3, 10_5);
+- (BOOL)webView:(WebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message WEBKIT_DEPRECATED_MAC(10_3, 10_5);
+- (NSString *)webView:(WebView *)sender runJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)defaultText WEBKIT_DEPRECATED_MAC(10_3, 10_5);
 
 // The following delegate methods are deprecated. Content rect calculations are now done automatically.
-- (void)webView:(WebView *)sender setContentRect:(NSRect)frame WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
-- (NSRect)webViewContentRect:(WebView *)sender WEBKIT_OBJC_METHOD_ANNOTATION(AVAILABLE_WEBKIT_VERSION_1_0_AND_LATER_BUT_DEPRECATED_IN_WEBKIT_VERSION_3_0);
+- (void)webView:(WebView *)sender setContentRect:(NSRect)frame WEBKIT_DEPRECATED_MAC(10_3, 10_5);
+- (NSRect)webViewContentRect:(WebView *)sender WEBKIT_DEPRECATED_MAC(10_3, 10_5);
 
 @end

Added: trunk/Source/WebKit/mac/postprocess-headers.sh (0 => 161332)


--- trunk/Source/WebKit/mac/postprocess-headers.sh	                        (rev 0)
+++ trunk/Source/WebKit/mac/postprocess-headers.sh	2014-01-06 08:15:52 UTC (rev 161332)
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+postProcessInDirectory()
+{
+    cd "$1"
+
+    local unifdefOptions sedExpression
+
+    if [[ ${PLATFORM_NAME} == iphoneos ]]; then
+        unifdefOptions="-DTARGET_OS_EMBEDDED=1 -DTARGET_OS_IPHONE=1 -DTARGET_IPHONE_SIMULATOR=0";
+    elif [[ ${PLATFORM_NAME} == iphonesimulator ]]; then
+        unifdefOptions="-DTARGET_OS_EMBEDDED=0 -DTARGET_OS_IPHONE=1 -DTARGET_IPHONE_SIMULATOR=1";
+    else
+        unifdefOptions="-DTARGET_OS_EMBEDDED=0 -DTARGET_OS_IPHONE=0 -DTARGET_IPHONE_SIMULATOR=0";
+    fi
+
+    if [[ ${PLATFORM_NAME} == iphone* ]]; then
+        sedExpression='s/ *WEBKIT_((CLASS_|ENUM_)?AVAILABLE|DEPRECATED)_MAC\([^)]+\)//g';
+    else
+        sedExpression='s/WEBKIT_((CLASS_|ENUM_)?AVAILABLE|DEPRECATED)/NS_\1/g';
+    fi
+
+    for header in $(find . -name '*.h' -type f); do
+        unifdef -B ${unifdefOptions} -o ${header}.unifdef ${header}
+        case $? in
+        0)
+            rm ${header}.unifdef
+            ;;
+        1)
+            mv ${header}{.unifdef,}
+            ;;
+        *)
+            exit 1
+            ;;
+        esac
+
+        if [[ ${header} == "./WebKitAvailability.h" ]]; then
+            continue
+        fi
+
+        sed -E -e "${sedExpression}" < ${header} > ${header}.sed
+        if cmp ${header} ${header}.sed; then
+            rm ${header}.sed
+        else
+            mv ${header}.sed ${header}
+        fi
+    done
+}
+
+postProcessInDirectory "${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}"
+postProcessInDirectory "${TARGET_BUILD_DIR}/${PRIVATE_HEADERS_FOLDER_PATH}"
Property changes on: trunk/Source/WebKit/mac/postprocess-headers.sh
___________________________________________________________________

Added: svn:executable

_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to