Add WK_ARRAY and WK_SET annotations
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Apr 2015 23:19:22 +0000 (23:19 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Apr 2015 23:19:22 +0000 (23:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=144075
rdar://problem/19417770

Reviewed by Dan Bernstein.

* Shared/API/Cocoa/WKFoundation.h:
* UIProcess/API/Cocoa/WKBackForwardList.h:
* UIProcess/API/Cocoa/WKUserContentController.h:
* UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.h:
* mac/postprocess-framework-headers.sh:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183152 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/Cocoa/WKFoundation.h
Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardList.h
Source/WebKit2/UIProcess/API/Cocoa/WKUserContentController.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecord.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataStore.h
Source/WebKit2/mac/postprocess-framework-headers.sh

index 9a96e08..6b76f8c 100644 (file)
@@ -1,3 +1,18 @@
+2015-04-22  Anders Carlsson  <andersca@apple.com>
+
+        Add WK_ARRAY and WK_SET annotations
+        https://bugs.webkit.org/show_bug.cgi?id=144075
+        rdar://problem/19417770
+
+        Reviewed by Dan Bernstein.
+
+        * Shared/API/Cocoa/WKFoundation.h:
+        * UIProcess/API/Cocoa/WKBackForwardList.h:
+        * UIProcess/API/Cocoa/WKUserContentController.h:
+        * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
+        * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
+        * mac/postprocess-framework-headers.sh:
+
 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
 
         Unreviewed build fix after r183136.
index af29bed..78d10bb 100644 (file)
@@ -54,6 +54,9 @@
 #define WK_ENUM_AVAILABLE(_mac, _ios)
 #define WK_ENUM_AVAILABLE_IOS(_ios)
 
+#define WK_ARRAY(...) NSArray
+#define WK_SET(...) NSSet
+
 #ifndef __NSi_8_3
 #define __NSi_8_3 introduced=8.3
 #endif
index 27f2015..cf8c72c 100644 (file)
@@ -65,13 +65,13 @@ if there isn't one.
  @discussion The items are in the order in which they were originally
  visited.
  */
-@property (nonatomic, readonly, copy) NSArray *backList;
+@property (nonatomic, readonly, copy) WK_ARRAY(WKBackForwardListItem *) *backList;
 
 /*! @abstract The portion of the list following the current item.
  @discussion The items are in the order in which they were originally
  visited.
  */
-@property (nonatomic, readonly, copy) NSArray *forwardList;
+@property (nonatomic, readonly, copy) WK_ARRAY(WKBackForwardListItem *) *forwardList;
 
 @end
 
index f049957..6b967ee 100644 (file)
@@ -45,7 +45,7 @@ WK_CLASS_AVAILABLE(10_10, 8_0)
 /*! @abstract The user scripts associated with this user content
  controller.
 */
-@property (nonatomic, readonly, copy) NSArray *userScripts;
+@property (nonatomic, readonly, copy) WK_ARRAY(WKUserScript *) *userScripts;
 
 /*! @abstract Adds a user script.
  @param userScript The user script to add.
index d44f167..c0ffd7a 100644 (file)
@@ -45,7 +45,7 @@ WK_CLASS_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA)
 
 @property (nonatomic, readonly, copy) NSString *displayName;
 
-@property (nonatomic, readonly, copy) NSSet *dataTypes;
+@property (nonatomic, readonly, copy) WK_SET(NSString *) *dataTypes;
 
 @end
 
index ab4cdfd..bd275d6 100644 (file)
@@ -44,11 +44,11 @@ WK_CLASS_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA)
 
 @property (readonly, getter=isNonPersistent) BOOL nonPersistent;
 
-+ (NSSet *)allWebsiteDataTypes;
++ (WK_SET(NSString *) *)allWebsiteDataTypes;
 
-- (void)fetchDataRecordsOfTypes:(NSSet *)websiteDataTypes completionHandler:(void (^)(NSArray *))completionHandler;
-- (void)removeDataOfTypes:(NSSet *)websiteDataTypes forDataRecords:(NSArray *)dataRecords completionHandler:(void (^)(void))completionHandler;
-- (void)removeDataOfTypes:(NSSet *)websiteDataTypes modifiedSince:(NSDate *)date completionHandler:(void (^)(void))completionHandler;
+- (void)fetchDataRecordsOfTypes:(WK_SET(NSString *) *)websiteDataTypes completionHandler:(void (^)(WK_ARRAY(WKWebsiteDataRecord *) *))completionHandler;
+- (void)removeDataOfTypes:(WK_SET(NSString *) *)websiteDataTypes forDataRecords:(WK_ARRAY(WKWebsiteDataRecord *) *)dataRecords completionHandler:(void (^)(void))completionHandler;
+- (void)removeDataOfTypes:(WK_SET(NSString *) *)websiteDataTypes modifiedSince:(NSDate *)date completionHandler:(void (^)(void))completionHandler;
 
 @end
 
index 779e9b2..ddd5bc5 100755 (executable)
@@ -66,13 +66,17 @@ function rewrite_headers () {
                 sed -i .tmp -E -e 's/WK_(CLASS_|ENUM_)?AVAILABLE(_IOS|_MAC)?\(.+\)//g' -e 's/WK_(CLASS_?)DEPRECATED\(.+\)//g' ${TARGET_TEMP_DIR}/${HEADER_PATH##*/} || exit $_
             fi
 
-            sed -i .tmp -e s/^WK_CLASS_AVAILABLE/NS_CLASS_AVAILABLE/ -e s/WK_AVAILABLE/NS_AVAILABLE/ -e s/^WK_CLASS_DEPRECATED/NS_CLASS_DEPRECATED/ -e s/WK_DEPRECATED/NS_DEPRECATED/ -e s/WK_DESIGNATED_INITIALIZER/NS_DESIGNATED_INITIALIZER/ -e s/WK_ENUM_AVAILABLE/NS_ENUM_AVAILABLE/ -e s/WK_UNAVAILABLE/NS_UNAVAILABLE/ -e s/WK_ASSUME_NONNULL_BEGIN/NS_ASSUME_NONNULL_BEGIN/ -e s/WK_ASSUME_NONNULL_END/NS_ASSUME_NONNULL_END/ -e s/WK_NULLABLE_PROPERTY/nullable,/ -e s/WK_NULLABLE_SPECIFIER/__nullable/g -e s/WK_NULLABLE/nullable/g -e s/WK_NULL_UNSPECIFIED/null_unspecified/ ${OTHER_SED_OPTIONS[*]} ${TARGET_TEMP_DIR}/${HEADER_PATH##*/} || exit $_
+            sed -i .tmp -E -e s/^WK_CLASS_AVAILABLE/NS_CLASS_AVAILABLE/ -e s/WK_AVAILABLE/NS_AVAILABLE/ -e s/^WK_CLASS_DEPRECATED/NS_CLASS_DEPRECATED/ -e s/WK_DEPRECATED/NS_DEPRECATED/ -e s/WK_DESIGNATED_INITIALIZER/NS_DESIGNATED_INITIALIZER/ -e s/WK_ENUM_AVAILABLE/NS_ENUM_AVAILABLE/ -e s/WK_UNAVAILABLE/NS_UNAVAILABLE/ -e s/WK_ASSUME_NONNULL_BEGIN/NS_ASSUME_NONNULL_BEGIN/ -e s/WK_ASSUME_NONNULL_END/NS_ASSUME_NONNULL_END/ -e s/WK_NULLABLE_PROPERTY/nullable,/ -e s/WK_NULLABLE_SPECIFIER/__nullable/g -e s/WK_NULLABLE/nullable/g -e s/WK_NULL_UNSPECIFIED/null_unspecified/ ${OTHER_SED_OPTIONS[*]} ${TARGET_TEMP_DIR}/${HEADER_PATH##*/} || exit $_
             mv ${TARGET_TEMP_DIR}/${HEADER_PATH##*/} $HEADER_PATH
         fi
     done
 }
 
 DEFINITIONS_PATH=usr/local/include/WebKitAdditions/Scripts/postprocess-framework-headers-definitions
+
+# FIXME: Remove this.
+OTHER_SED_OPTIONS=(-e 's/WK_SET\([^\)]+\)/NSSet/g' -e 's/WK_ARRAY\([^\)]+\)/NSArray/g')
+
 process_definitions "${BUILT_PRODUCTS_DIR}/${DEFINITIONS_PATH}" || process_definitions "${SDKROOT}/${DEFINITIONS_PATH}"
 
 rewrite_headers ${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}