Changeset 277215 in webkit
- Timestamp:
- May 7, 2021, 5:30:35 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 13 edited
-
ChangeLog (modified) (1 diff)
-
Shared/API/Cocoa/WKFoundation.h (modified) (1 diff)
-
SwiftOverlay/Configurations/WebKitSwiftOverlay.xcconfig (modified) (1 diff)
-
SwiftOverlay/WebKitSwiftOverlay.xcodeproj/project.pbxproj (modified) (8 diffs)
-
UIProcess/API/Cocoa/NSAttributedString.h (modified) (4 diffs)
-
UIProcess/API/Cocoa/WKContentRuleListStore.h (modified) (1 diff)
-
UIProcess/API/Cocoa/WKDownloadDelegate.h (modified) (2 diffs)
-
UIProcess/API/Cocoa/WKHTTPCookieStore.h (modified) (1 diff)
-
UIProcess/API/Cocoa/WKNavigationDelegate.h (modified) (5 diffs)
-
UIProcess/API/Cocoa/WKScriptMessageHandlerWithReply.h (modified) (1 diff)
-
UIProcess/API/Cocoa/WKUIDelegate.h (modified) (2 diffs)
-
UIProcess/API/Cocoa/WKWebView.h (modified) (2 diffs)
-
UIProcess/API/Cocoa/WKWebsiteDataStore.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r277210 r277215 1 2021-05-07 James Savage <james.savage@apple.com> 2 3 Validate Swift async imports. 4 https://bugs.webkit.org/show_bug.cgi?id=225134 5 <rdar://73620237> 6 7 Reviewed by Sam Weinig. 8 9 Audit our imported Objective-C API for correct translations to Swift's 10 upcoming concurrency feature. This mostly entails removing redundant 11 words, tagging methods which Swift's heuristics missed, and in some 12 cases disabling methods that do not follow Swift's async conventions. 13 14 * Shared/API/Cocoa/WKFoundation.h: Because the Foundation macros used 15 for Swift async won't exist in all SDKs, provide our own wrapper around 16 them to avoid undefined macro errors. 17 * SwiftOverlay/Configurations/WebKitSwiftOverlay.xcconfig: Passing these 18 flags to older tools will result in errors, so only so conditionally. 19 * SwiftOverlay/WebKitSwiftOverlay.xcodeproj/project.pbxproj: Added a 20 new source file reference for generated sources. These will be copied 21 from WebKitAdditions if available, or replaced with empty sources for 22 compatibility. 23 * UIProcess/API/Cocoa/NSAttributedString.h: Adopt new attributes to 24 define an explicit Swift async name. 25 * UIProcess/API/Cocoa/WKContentRuleListStore.h: Ditto. 26 * UIProcess/API/Cocoa/WKDownloadDelegate.h: In this case I also apply 27 NS_SWIFT_NAME as the "decisionHandler" argument would otherwise not 28 import as async. Despite using a different macro, I'm just using 29 NS_SWIFT_ASYNC_NAME to check for these changes as all these annotations 30 should exist or not-exist at once. 31 * UIProcess/API/Cocoa/WKHTTPCookieStore.h: Ditto. 32 * UIProcess/API/Cocoa/WKNavigationDelegate.h: Ditto. 33 * UIProcess/API/Cocoa/WKScriptMessageHandlerWithReply.h: Ditto. 34 * UIProcess/API/Cocoa/WKUIDelegate.h: Ditto. 35 * UIProcess/API/Cocoa/WKWebView.h: _Nullable_result is a new annotation 36 which specifies that the result and error are not mutually exclusive, 37 but rather than we can expect a nil result in cases where there are not 38 an error. For the same reason as above, we only want to refer to this 39 keyword conditionally. 40 * UIProcess/API/Cocoa/WKWebsiteDataStore.h: Ditto. 41 1 42 2021-05-07 Tim Horton <timothy_horton@apple.com> 2 43 -
trunk/Source/WebKit/Shared/API/Cocoa/WKFoundation.h
r276125 r277215 33 33 #endif 34 34 35 #ifdef NS_SWIFT_ASYNC_NAME 36 #define WK_SWIFT_ASYNC_NAME(...) NS_SWIFT_ASYNC_NAME(__VA_ARGS__) 37 #else 38 #define WK_SWIFT_ASYNC_NAME(...) 39 #endif 40 41 #ifdef NS_SWIFT_ASYNC 42 #define WK_SWIFT_ASYNC(...) NS_SWIFT_ASYNC(__VA_ARGS__) 43 #else 44 #define WK_SWIFT_ASYNC(...) 45 #endif 46 35 47 #ifndef WK_FRAMEWORK_HEADER_POSTPROCESSING_ENABLED 36 48 -
trunk/Source/WebKit/SwiftOverlay/Configurations/WebKitSwiftOverlay.xcconfig
r269273 r277215 51 51 INSTALL_PATH = $(WK_ALTERNATE_FRAMEWORKS_DIR)$(SWIFT_OVERLAY_INSTALL_PATH); 52 52 53 OTHER_SWIFT_FLAGS = -module-link-name $(SWIFT_MODULE_LINK_NAME) -autolink-force-load -runtime-compatibility-version none -disable-autolinking-runtime-compatibility-dynamic-replacements; 53 WK_SWIFT_CONCURRENCY_FLAGS = -Xfrontend -enable-experimental-concurrency; 54 WK_SWIFT_CONCURRENCY_FLAGS[sdk=macos*11.*] = ; 55 WK_SWIFT_CONCURRENCY_FLAGS[sdk=iphone*14.*] = ; 56 57 OTHER_SWIFT_FLAGS = -module-link-name $(SWIFT_MODULE_LINK_NAME) -autolink-force-load -runtime-compatibility-version none -disable-autolinking-runtime-compatibility-dynamic-replacements $(WK_SWIFT_CONCURRENCY_FLAGS); 54 58 SWIFT_MODULE_LINK_NAME = swift$(PRODUCT_NAME); 55 59 -
trunk/Source/WebKit/SwiftOverlay/WebKitSwiftOverlay.xcodeproj/project.pbxproj
r267352 r277215 18 18 B3B8FEEF2502BAA0006172CA /* ObjectiveCBlockConversions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3B8FEEE2502BAA0006172CA /* ObjectiveCBlockConversions.swift */; }; 19 19 B3B8FEF02502BAA0006172CA /* ObjectiveCBlockConversions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3B8FEEE2502BAA0006172CA /* ObjectiveCBlockConversions.swift */; }; 20 B3DF244C2638BE240038D95A /* WebKitSwiftOverlayAdditions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B31B03FD2637EF6500D67EAD /* WebKitSwiftOverlayAdditions.swift */; }; 21 B3DF244D2638BE290038D95A /* WebKitSwiftOverlayAdditions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B31B03FD2637EF6500D67EAD /* WebKitSwiftOverlayAdditions.swift */; }; 20 22 /* End PBXBuildFile section */ 21 23 … … 42 44 7D20070722F4EB72008DF640 /* WebKitSwiftOverlayTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WebKitSwiftOverlayTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 43 45 7D20071622F4ECCA008DF640 /* WebKitSwiftOverlayTests-maccatalyst.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "WebKitSwiftOverlayTests-maccatalyst.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 46 B31B03FD2637EF6500D67EAD /* WebKitSwiftOverlayAdditions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = WebKitSwiftOverlayAdditions.swift; path = usr/local/include/WebKitAdditions/WebKitSwiftOverlayAdditions.swift; sourceTree = BUILT_PRODUCTS_DIR; }; 44 47 B3A5D38823F78F5400B17727 /* WebKitTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebKitTests.swift; sourceTree = "<group>"; }; 45 48 B3A5D39123F790DB00B17727 /* WebKitSwiftOverlay.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = WebKitSwiftOverlay.swift; path = ../UIProcess/API/Cocoa/WebKitSwiftOverlay.swift; sourceTree = SOURCE_ROOT; }; … … 95 98 B3B8FEEE2502BAA0006172CA /* ObjectiveCBlockConversions.swift */, 96 99 B3A5D39123F790DB00B17727 /* WebKitSwiftOverlay.swift */, 100 B31B03FD2637EF6500D67EAD /* WebKitSwiftOverlayAdditions.swift */, 97 101 ); 98 102 name = "Swift Overlay"; … … 175 179 buildConfigurationList = 7D20067B22F2652E008DF640 /* Build configuration list for PBXNativeTarget "WebKitSwiftOverlay" */; 176 180 buildPhases = ( 181 B31B03FC2637EEBD00D67EAD /* Copy Additional Sources */, 177 182 7D20067122F2652E008DF640 /* Headers */, 178 183 7D20067222F2652E008DF640 /* Sources */, … … 193 198 buildConfigurationList = 7D20068D22F26721008DF640 /* Build configuration list for PBXNativeTarget "WebKitSwiftOverlay-maccatalyst" */; 194 199 buildPhases = ( 200 B31B04002637F22E00D67EAD /* Copy Additional Sources */, 195 201 7D20068322F26721008DF640 /* Headers */, 196 202 7D20068422F26721008DF640 /* Sources */, … … 346 352 shellScript = "exec \"${SOURCE_ROOT}/SwiftOverlay/install-swiftmodules.sh\"\n"; 347 353 }; 354 B31B03FC2637EEBD00D67EAD /* Copy Additional Sources */ = { 355 isa = PBXShellScriptBuildPhase; 356 buildActionMask = 2147483647; 357 files = ( 358 ); 359 inputFileListPaths = ( 360 ); 361 inputPaths = ( 362 "$(SDK_DIR)/usr/local/include/WebKitAdditions/WebKitSwiftOverlayAdditions.swift", 363 ); 364 name = "Copy Additional Sources"; 365 outputFileListPaths = ( 366 ); 367 outputPaths = ( 368 "$(BUILT_PRODUCTS_DIR)/usr/local/include/WebKitAdditions/WebKitSwiftOverlayAdditions.swift", 369 ); 370 runOnlyForDeploymentPostprocessing = 0; 371 shellPath = /bin/sh; 372 shellScript = "set -e\n\nRELATIVE_SOURCE_PATH=\"usr/local/include/WebKitAdditions/WebKitSwiftOverlayAdditions.swift\"\nSOURCE_PATH=\"$SDK_DIR/$RELATIVE_SOURCE_PATH\"\nDESTINATION_PATH=\"$BUILT_PRODUCTS_DIR/$RELATIVE_SOURCE_PATH\"\n\nif [[ -e \"$SOURCE_PATH\" ]]; then\n ditto \"$SOURCE_PATH\" \"$DESTINATION_PATH\"\nelse\n touch \"$DESTINATION_PATH\"\nfi\n"; 373 }; 374 B31B04002637F22E00D67EAD /* Copy Additional Sources */ = { 375 isa = PBXShellScriptBuildPhase; 376 buildActionMask = 2147483647; 377 files = ( 378 ); 379 inputFileListPaths = ( 380 ); 381 inputPaths = ( 382 "$(SDK_DIR)/usr/local/include/WebKitAdditions/WebKitSwiftOverlayAdditions.swift", 383 ); 384 name = "Copy Additional Sources"; 385 outputFileListPaths = ( 386 ); 387 outputPaths = ( 388 "$(BUILT_PRODUCTS_DIR)/usr/local/include/WebKitAdditions/WebKitSwiftOverlayAdditions.swift", 389 ); 390 runOnlyForDeploymentPostprocessing = 0; 391 shellPath = /bin/sh; 392 shellScript = "set -e\n\nRELATIVE_SOURCE_PATH=\"usr/local/include/WebKitAdditions/WebKitSwiftOverlayAdditions.swift\"\nSOURCE_PATH=\"$SDK_DIR/$RELATIVE_SOURCE_PATH\"\nDESTINATION_PATH=\"$BUILT_PRODUCTS_DIR/$RELATIVE_SOURCE_PATH\"\n\nif [[ -e \"$SOURCE_PATH\" ]]; then\n ditto \"$SOURCE_PATH\" \"$DESTINATION_PATH\"\nelse\n touch \"$DESTINATION_PATH\"\nfi\n"; 393 }; 348 394 /* End PBXShellScriptBuildPhase section */ 349 395 … … 355 401 B3B8FEEF2502BAA0006172CA /* ObjectiveCBlockConversions.swift in Sources */, 356 402 B3A5D39223F790DB00B17727 /* WebKitSwiftOverlay.swift in Sources */, 403 B3DF244C2638BE240038D95A /* WebKitSwiftOverlayAdditions.swift in Sources */, 357 404 ); 358 405 runOnlyForDeploymentPostprocessing = 0; … … 364 411 B3B8FEF02502BAA0006172CA /* ObjectiveCBlockConversions.swift in Sources */, 365 412 B3A5D39323F790DB00B17727 /* WebKitSwiftOverlay.swift in Sources */, 413 B3DF244D2638BE290038D95A /* WebKitSwiftOverlayAdditions.swift in Sources */, 366 414 ); 367 415 runOnlyForDeploymentPostprocessing = 0; -
trunk/Source/WebKit/UIProcess/API/Cocoa/NSAttributedString.h
r252174 r277215 71 71 */ 72 72 + (void)loadFromHTMLWithRequest:(NSURLRequest *)request options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)options completionHandler:(NSAttributedStringCompletionHandler)completionHandler 73 NS_SWIFT_NAME(loadFromHTML(request:options:completionHandler:)) WK_ API_AVAILABLE(macos(10.15), ios(13.0));73 NS_SWIFT_NAME(loadFromHTML(request:options:completionHandler:)) WK_SWIFT_ASYNC_NAME(fromHTML(request:options:)) WK_API_AVAILABLE(macos(10.15), ios(13.0)); 74 74 75 75 /*! … … 86 86 */ 87 87 + (void)loadFromHTMLWithFileURL:(NSURL *)fileURL options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)options completionHandler:(NSAttributedStringCompletionHandler)completionHandler 88 NS_SWIFT_NAME(loadFromHTML(fileURL:options:completionHandler:)) WK_ API_AVAILABLE(macos(10.15), ios(13.0));88 NS_SWIFT_NAME(loadFromHTML(fileURL:options:completionHandler:)) WK_SWIFT_ASYNC_NAME(fromHTML(fileURL:options:)) WK_API_AVAILABLE(macos(10.15), ios(13.0)); 89 89 90 90 /*! … … 100 100 */ 101 101 + (void)loadFromHTMLWithString:(NSString *)string options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)options completionHandler:(NSAttributedStringCompletionHandler)completionHandler 102 NS_SWIFT_NAME(loadFromHTML(string:options:completionHandler:)) WK_ API_AVAILABLE(macos(10.15), ios(13.0));102 NS_SWIFT_NAME(loadFromHTML(string:options:completionHandler:)) WK_SWIFT_ASYNC_NAME(fromHTML(_:options:)) WK_API_AVAILABLE(macos(10.15), ios(13.0)); 103 103 104 104 /*! … … 114 114 */ 115 115 + (void)loadFromHTMLWithData:(NSData *)data options:(NSDictionary<NSAttributedStringDocumentReadingOptionKey, id> *)options completionHandler:(NSAttributedStringCompletionHandler)completionHandler 116 NS_SWIFT_NAME(loadFromHTML(data:options:completionHandler:)) WK_ API_AVAILABLE(macos(10.15), ios(13.0));116 NS_SWIFT_NAME(loadFromHTML(data:options:completionHandler:)) WK_SWIFT_ASYNC_NAME(fromHTML(_:options:)) WK_API_AVAILABLE(macos(10.15), ios(13.0)); 117 117 118 118 @end -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKContentRuleListStore.h
r275166 r277215 37 37 38 38 - (void)compileContentRuleListForIdentifier:(NSString *)identifier encodedContentRuleList:(NSString *)encodedContentRuleList completionHandler:(void (^)(WKContentRuleList *, NSError *))completionHandler; 39 - (void)lookUpContentRuleListForIdentifier:(NSString *)identifier completionHandler:(void (^)(WKContentRuleList *, NSError *))completionHandler; 39 40 - (void)lookUpContentRuleListForIdentifier:(NSString *)identifier completionHandler:(void (^)(WKContentRuleList *, NSError *))completionHandler WK_SWIFT_ASYNC_NAME(contentRuleList(forIdentifier:)); 41 40 42 - (void)removeContentRuleListForIdentifier:(NSString *)identifier completionHandler:(void (^)(NSError *))completionHandler; 41 - (void)getAvailableContentRuleListIdentifiers:(void (^)(NSArray<NSString *> *))completionHandler; 43 44 - (void)getAvailableContentRuleListIdentifiers:(void (^)(NSArray<NSString *> *))completionHandler WK_SWIFT_ASYNC_NAME(availableIdentifiers()); 42 45 43 46 @end -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKDownloadDelegate.h
r270790 r277215 69 69 @discussion If you do not implement this method, all server suggested redirects will be taken. 70 70 */ 71 - (void)download:(WKDownload *)download willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request decisionHandler:(void (^)(WKDownloadRedirectPolicy))decisionHandler ;71 - (void)download:(WKDownload *)download willPerformHTTPRedirection:(NSHTTPURLResponse *)response newRequest:(NSURLRequest *)request decisionHandler:(void (^)(WKDownloadRedirectPolicy))decisionHandler WK_SWIFT_ASYNC_NAME(download(_:decidedPolicyForHTTPRedirection:newRequest:)) WK_SWIFT_ASYNC(4); 72 72 73 73 /* @abstract Invoked when the download needs to respond to an authentication challenge. … … 81 81 @discussion If you do not implement this method, the web view will respond to the authentication challenge with the NSURLSessionAuthChallengeRejectProtectionSpace disposition. 82 82 */ 83 - (void)download:(WKDownload *)download didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler ;83 - (void)download:(WKDownload *)download didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler WK_SWIFT_ASYNC_NAME(download(_:respondTo:)); 84 84 85 85 /* @abstract Invoked when the download has finished successfully. -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStore.h
r243376 r277215 60 60 @param completionHandler A block to invoke once the cookie has been deleted. 61 61 */ 62 - (void)deleteCookie:(NSHTTPCookie *)cookie completionHandler:(nullable void (^)(void))completionHandler ;62 - (void)deleteCookie:(NSHTTPCookie *)cookie completionHandler:(nullable void (^)(void))completionHandler WK_SWIFT_ASYNC_NAME(deleteCookie(_:)); 63 63 64 64 /*! @abstract Adds a WKHTTPCookieStoreObserver object with the cookie store. -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegate.h
r271813 r277215 78 78 @discussion If you do not implement this method, the web view will load the request or, if appropriate, forward it to another application. 79 79 */ 80 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler ;80 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler WK_SWIFT_ASYNC(3); 81 81 82 82 /*! @abstract Decides whether to allow or cancel a navigation. … … 92 92 -webView:decidePolicyForNavigationAction:decisionHandler: will not be called. 93 93 */ 94 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction preferences:(WKWebpagePreferences *)preferences decisionHandler:(void (^)(WKNavigationActionPolicy, WKWebpagePreferences *))decisionHandler WK_ API_AVAILABLE(macos(10.15), ios(13.0));94 - (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction preferences:(WKWebpagePreferences *)preferences decisionHandler:(void (^)(WKNavigationActionPolicy, WKWebpagePreferences *))decisionHandler WK_SWIFT_ASYNC(4) WK_API_AVAILABLE(macos(10.15), ios(13.0)); 95 95 96 96 /*! @abstract Decides whether to allow or cancel a navigation after its … … 103 103 @discussion If you do not implement this method, the web view will allow the response, if the web view can show it. 104 104 */ 105 - (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler ;105 - (void)webView:(WKWebView *)webView decidePolicyForNavigationResponse:(WKNavigationResponse *)navigationResponse decisionHandler:(void (^)(WKNavigationResponsePolicy))decisionHandler WK_SWIFT_ASYNC(3); 106 106 107 107 /*! @abstract Invoked when a main frame navigation starts. … … 156 156 @discussion If you do not implement this method, the web view will respond to the authentication challenge with the NSURLSessionAuthChallengeRejectProtectionSpace disposition. 157 157 */ 158 - (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler ;158 - (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler WK_SWIFT_ASYNC_NAME(webView(_:respondTo:)); 159 159 160 160 /*! @abstract Invoked when the web view's web content process is terminated. … … 168 168 @param decisionHandler The decision handler you must invoke to respond to indicate whether or not to continue with the connection establishment. 169 169 */ 170 - (void)webView:(WKWebView *)webView authenticationChallenge:(NSURLAuthenticationChallenge *)challenge shouldAllowDeprecatedTLS:(void (^)(BOOL))decisionHandler WK_ API_AVAILABLE(macos(11.0), ios(14.0));170 - (void)webView:(WKWebView *)webView authenticationChallenge:(NSURLAuthenticationChallenge *)challenge shouldAllowDeprecatedTLS:(void (^)(BOOL))decisionHandler WK_SWIFT_ASYNC_NAME(webView(_:shouldAllowDeprecatedTLSFor:)) WK_SWIFT_ASYNC(3) WK_API_AVAILABLE(macos(11.0), ios(14.0)); 171 171 172 172 /* -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKScriptMessageHandlerWithReply.h
r271813 r277215 88 88 - JavaScript execution continues and the value 42 is returned. 89 89 */ 90 - (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message replyHandler:(void (^)(id _Nullable reply, NSString *_Nullable errorMessage))replyHandler WK_API_AVAILABLE(macos(11.0), ios(14.0)); 90 - (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message replyHandler:(void (^)(id _Nullable reply, NSString *_Nullable errorMessage))replyHandler WK_SWIFT_ASYNC(3) WK_API_AVAILABLE(macos(11.0), ios(14.0)); 91 91 92 @end 92 93 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h
r276125 r277215 145 145 @discussion If not implemented, the result is the same as calling the decisionHandler with WKPermissionDecisionPrompt. 146 146 */ 147 - (void)webView:(WKWebView *)webView requestMediaCapturePermissionForOrigin:(WKSecurityOrigin *)origin initiatedByFrame:(WKFrameInfo *)frame type:(WKMediaCaptureType)type decisionHandler:(void (^)(WKPermissionDecision decision))decisionHandler WK_ API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));147 - (void)webView:(WKWebView *)webView requestMediaCapturePermissionForOrigin:(WKSecurityOrigin *)origin initiatedByFrame:(WKFrameInfo *)frame type:(WKMediaCaptureType)type decisionHandler:(void (^)(WKPermissionDecision decision))decisionHandler WK_SWIFT_ASYNC_NAME(webView(_:decideMediaCapturePermissionsFor:initiatedBy:type:)) WK_SWIFT_ASYNC(5) WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA)); 148 148 149 149 /*! @abstract Allows your app to determine whether or not the given security origin should have access to the device's orientation and motion. … … 201 201 */ 202 202 203 - (void)webView:(WKWebView *)webView contextMenuConfigurationForElement:(WKContextMenuElementInfo *)elementInfo completionHandler:(void (^)(UIContextMenuConfiguration * _Nullable configuration))completionHandler WK_ API_AVAILABLE(ios(13.0));203 - (void)webView:(WKWebView *)webView contextMenuConfigurationForElement:(WKContextMenuElementInfo *)elementInfo completionHandler:(void (^)(UIContextMenuConfiguration * _Nullable configuration))completionHandler WK_SWIFT_ASYNC_NAME(webView(_:contextMenuConfigurationFor:)) WK_API_AVAILABLE(ios(13.0)); 204 204 205 205 /** -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.h
r275984 r277215 334 334 The above function text will create a promise that will fulfull with the value 42 after a one second delay, wait for it to resolve, then return the fulfillment value of 42. 335 335 */ 336 #ifdef NS_SWIFT_ASYNC_NAME 337 - (void)callAsyncJavaScript:(NSString *)functionBody arguments:(nullable NSDictionary<NSString *, id> *)arguments inFrame:(nullable WKFrameInfo *)frame inContentWorld:(WKContentWorld *)contentWorld completionHandler:(void (^ _Nullable)(_Nullable_result id, NSError * _Nullable error))completionHandler NS_REFINED_FOR_SWIFT WK_API_AVAILABLE(macos(11.0), ios(14.0)); 338 #else 336 339 - (void)callAsyncJavaScript:(NSString *)functionBody arguments:(nullable NSDictionary<NSString *, id> *)arguments inFrame:(nullable WKFrameInfo *)frame inContentWorld:(WKContentWorld *)contentWorld completionHandler:(void (^ _Nullable)(_Nullable id, NSError * _Nullable error))completionHandler NS_REFINED_FOR_SWIFT WK_API_AVAILABLE(macos(11.0), ios(14.0)); 340 #endif 337 341 338 342 /*! @abstract Closes all out-of-window media presentations in a WKWebView. … … 402 406 */ 403 407 #if TARGET_OS_IPHONE 404 - (void)takeSnapshotWithConfiguration:(nullable WKSnapshotConfiguration *)snapshotConfiguration completionHandler:(void (^)(UIImage * _Nullable snapshotImage, NSError * _Nullable error))completionHandler WK_ API_AVAILABLE(ios(11.0));408 - (void)takeSnapshotWithConfiguration:(nullable WKSnapshotConfiguration *)snapshotConfiguration completionHandler:(void (^)(UIImage * _Nullable snapshotImage, NSError * _Nullable error))completionHandler WK_SWIFT_ASYNC_NAME(takeSnapshot(configuration:)) WK_API_AVAILABLE(ios(11.0)); 405 409 #else 406 - (void)takeSnapshotWithConfiguration:(nullable WKSnapshotConfiguration *)snapshotConfiguration completionHandler:(void (^)(NSImage * _Nullable snapshotImage, NSError * _Nullable error))completionHandler WK_ API_AVAILABLE(macos(10.13));410 - (void)takeSnapshotWithConfiguration:(nullable WKSnapshotConfiguration *)snapshotConfiguration completionHandler:(void (^)(NSImage * _Nullable snapshotImage, NSError * _Nullable error))completionHandler WK_SWIFT_ASYNC_NAME(takeSnapshot(configuration:)) WK_API_AVAILABLE(macos(10.13)); 407 411 #endif 408 412 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.h
r263570 r277215 61 61 @param completionHandler A block to invoke when the data records have been fetched. 62 62 */ 63 - (void)fetchDataRecordsOfTypes:(NSSet<NSString *> *)dataTypes completionHandler:(void (^)(NSArray<WKWebsiteDataRecord *> *))completionHandler ;63 - (void)fetchDataRecordsOfTypes:(NSSet<NSString *> *)dataTypes completionHandler:(void (^)(NSArray<WKWebsiteDataRecord *> *))completionHandler WK_SWIFT_ASYNC_NAME(dataRecords(ofTypes:)); 64 64 65 65 /*! @abstract Removes website data of the given types for the given data records.
Note:
See TracChangeset
for help on using the changeset viewer.