WebKit Bugzilla
Attachment 348380 Details for
Bug 189072
: [CFNetwork] Update CFNetwork SPI use to use CFNetworkSPI.h more consistently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189072-20180828194238.patch (text/plain), 16.60 KB, created by
Darin Adler
on 2018-08-28 19:42:40 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Darin Adler
Created:
2018-08-28 19:42:40 PDT
Size:
16.60 KB
patch
obsolete
>Subversion Revision: 235365 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c781a535526bea95d38b185f459b3f1d0a812b59..591101142330c8b32eb0c97f24c562d8e0d1b88e 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-08-28 Darin Adler <darin@apple.com> >+ >+ [CFNetwork] Update CFNetwork SPI use to use CFNetworkSPI.h more consistently >+ https://bugs.webkit.org/show_bug.cgi?id=189072 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * platform/mac/WebCoreNSURLExtras.mm: Include CFNetworkSPI.h and remove a >+ declaration of +[NSURLProtocol _protocolClassForRequest:]. >+ >+ * platform/network/mac/ResourceHandleMac.mm: Remove a declaration of >+ -[NSURLConnection _initWithRequest:delegate:usesCache:maxContentLength:startImmediately:connectionProperties:]. >+ (WebCore::ResourceHandle::createNSURLConnection): Add ignore of >+ "-Wdeprecated-declarations" around use of the above method, since it >+ is deprecated. >+ > 2018-08-27 Alex Christensen <achristensen@webkit.org> > > Fix IOSMAC build >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index a9c4bbc5e730e7b8290b60e10c8a811a9d805afc..055f348a4c192503d69f19b8779c63f7300e7bda 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,17 @@ >+2018-08-28 Darin Adler <darin@apple.com> >+ >+ [CFNetwork] Update CFNetwork SPI use to use CFNetworkSPI.h more consistently >+ https://bugs.webkit.org/show_bug.cgi?id=189072 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * pal/spi/cf/CFNetworkSPI.h: Added a FIXME about USE(CFNETWORK_IGNORE_HSTS). >+ Sorted Objective-C class interfaces alphabetically instead of having them >+ relatively randomly ordered in the file. Reduced the platform #if statements >+ since it's not critical to have these SPIs declared only where they are >+ present, as long as they are used only when they are present. Moved some >+ additional declarations into this file. >+ > 2018-08-26 Andy Estes <aestes@apple.com> > > [Apple Pay] Introduce new values for -apple-pay-button-type >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index f68913b9b52aaa5fd666ba9c0a1904da986dc57f..ca7be09fe0a20fbd521449e31a714c983a92d851 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,16 @@ >+2018-08-28 Darin Adler <darin@apple.com> >+ >+ [CFNetwork] Update CFNetwork SPI use to use CFNetworkSPI.h more consistently >+ https://bugs.webkit.org/show_bug.cgi?id=189072 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Removed NSURLSessionTask >+ method declarations from this file, they are in CFNetworkSPI.h. >+ >+ * NetworkProcess/cocoa/NetworkSessionCocoa.mm: Removed NSURLSessionConfiguration >+ method declarations from this file, they are in CFNetworkSPI.h. >+ > 2018-08-26 Darin Adler <darin@apple.com> > > [Cocoa] Adapt more WebKit code to be ARC-compatible >diff --git a/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h b/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h >index 3dc2950aad8b4aa2ad6b1780b94f7a2508318ef3..49127fd22a8fcc71d2cd587f0c60e7a2d180446e 100644 >--- a/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h >+++ b/Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h >@@ -30,6 +30,10 @@ > #include <CFNetwork/CFNetwork.h> > #include <pal/spi/cf/CFNetworkConnectionCacheSPI.h> > >+// FIXME: Policy about which CFNetwork features to *use* in WebKit does not belong in the SPI header. >+// The SPI header should define which CFNetwork features *exist* in the underlying system, but not >+// policy about what WebKit should do. Accordingly, we should move this somewhere else or rename it >+// to be about CFNetwork capabilities (HAVE) rather than about WebKit policy (USE). > #if ((PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101302 && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110200) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 40200) || (PLATFORM(TVOS) && __TV_OS_VERSION_MIN_REQUIRED >= 110200)) > #define USE_CFNETWORK_IGNORE_HSTS 1 > #endif >@@ -91,6 +95,50 @@ typedef void (^CFCachedURLResponseCallBackBlock)(CFCachedURLResponseRef); > - (CFURLCacheRef)_CFURLCache; > @end > >+@interface NSCachedURLResponse () >+- (id)_initWithCFCachedURLResponse:(CFCachedURLResponseRef)cachedResponse; >+- (CFCachedURLResponseRef)_CFCachedURLResponse; >+@end >+ >+@interface NSHTTPCookie () >+- (CFHTTPCookieRef)_CFHTTPCookie; >++ (CFArrayRef __nullable)_ns2cfCookies:(NSArray * __nullable)nsCookies CF_RETURNS_RETAINED; >+- (CFHTTPCookieRef __nullable)_GetInternalCFHTTPCookie; >+@property (nullable, readonly, copy) NSString *_storagePartition; >+@end >+ >+@interface NSURLDownload () >+- (id)_initWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)response delegate:(id)delegate proxy:(NSURLConnectionDelegateProxy *)proxy; >+- (id)_initWithRequest:(NSURLRequest *)request delegate:(id)delegate directory:(NSString *)directory; >+@end >+ >+@interface NSHTTPCookieStorage () >+- (id)_initWithIdentifier:(NSString *)identifier private:(bool)isPrivate; >+- (void)_getCookiesForURL:(NSURL *)url mainDocumentURL:(NSURL *)mainDocumentURL partition:(NSString *)partition completionHandler:(void (^)(NSArray *))completionHandler; >+- (void)_getCookiesForURL:(NSURL *)url mainDocumentURL:(NSURL *)mainDocumentURL partition:(NSString *)partition policyProperties:(NSDictionary*)props completionHandler:(void (^)(NSArray *))completionHandler; >+- (void)_setCookies:(NSArray *)cookies forURL:(NSURL *)URL mainDocumentURL:(NSURL *)mainDocumentURL policyProperties:(NSDictionary*) props; >+- (void)removeCookiesSinceDate:(NSDate *)date; >+- (id)_initWithCFHTTPCookieStorage:(CFHTTPCookieStorageRef)cfStorage; >+- (CFHTTPCookieStorageRef)_cookieStorage; >+- (void)_saveCookies; >+- (void)_saveCookies:(dispatch_block_t) completionHandler; >+@end >+ >+@interface NSURLConnection () >+- (id)_initWithRequest:(NSURLRequest *)request delegate:(id)delegate usesCache:(BOOL)usesCacheFlag maxContentLength:(long long)maxContentLength startImmediately:(BOOL)startImmediately connectionProperties:(NSDictionary *)connectionProperties; >+@end >+ >+@interface NSMutableURLRequest () >+- (void)setContentDispositionEncodingFallbackArray:(NSArray *)theEncodingFallbackArray; >+- (void)setBoundInterfaceIdentifier:(NSString *)identifier; >+- (void)_setPreventHSTSStorage:(BOOL)preventHSTSStorage; >+- (void)_setIgnoreHSTS:(BOOL)ignoreHSTS; >+@end >+ >+@interface NSURLProtocol () >++ (Class)_protocolClassForRequest:(NSURLRequest *)request; >+@end >+ > @interface NSURLRequest () > + (NSArray *)allowsSpecificHTTPSCertificateForHost:(NSString *)host; > + (void)setAllowsSpecificHTTPSCertificate:(NSArray *)allow forHost:(NSString *)host; >@@ -100,20 +148,9 @@ typedef void (^CFCachedURLResponseCallBackBlock)(CFCachedURLResponseRef); > - (id)_initWithCFURLRequest:(CFURLRequestRef)request; > - (id)_propertyForKey:(NSString *)key; > - (void)_setProperty:(id)value forKey:(NSString *)key; >-#if USE(CFNETWORK_IGNORE_HSTS) > - (BOOL)_schemeWasUpgradedDueToDynamicHSTS; > - (BOOL)_preventHSTSStorage; > - (BOOL)_ignoreHSTS; >-#endif >-@end >- >-@interface NSMutableURLRequest () >-- (void)setContentDispositionEncodingFallbackArray:(NSArray *)theEncodingFallbackArray; >-- (void)setBoundInterfaceIdentifier:(NSString *)identifier; >-#if USE(CFNETWORK_IGNORE_HSTS) >-- (void)_setPreventHSTSStorage:(BOOL)preventHSTSStorage; >-- (void)_setIgnoreHSTS:(BOOL)ignoreHSTS; >-#endif > @end > > @interface NSURLResponse () >@@ -122,12 +159,6 @@ typedef void (^CFCachedURLResponseCallBackBlock)(CFCachedURLResponseRef); > - (NSDate *)_lastModifiedDate; > @end > >-@interface NSHTTPCookie () >-- (CFHTTPCookieRef)_CFHTTPCookie; >-+ (CFArrayRef __nullable)_ns2cfCookies:(NSArray * __nullable)nsCookies CF_RETURNS_RETAINED; >-- (CFHTTPCookieRef __nullable)_GetInternalCFHTTPCookie; >-@end >- > @interface NSURLSessionConfiguration () > @property (assign) _TimingDataOptions _timingDataOptions; > @property (copy) NSData *_sourceApplicationAuditTokenData; >@@ -140,8 +171,16 @@ typedef void (^CFCachedURLResponseCallBackBlock)(CFCachedURLResponseRef); > #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) > @property (nullable, copy) NSSet *_suppressedAutoAddedHTTPHeaders; > #endif >-#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) >-@property (copy) NSDictionary *_socketStreamProperties; >+@end >+ >+@interface NSURLSessionTask () >+- (NSDictionary *)_timingData; >+@property (readwrite, copy) NSString *_pathToDownloadTaskFile; >+@property (copy) NSString *_storagePartitionIdentifier; >+@property (nullable, readwrite, retain) NSURL *_siteForCookies; >+@property (readwrite) BOOL _isTopLevelNavigation; >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >+@property (nonatomic, assign) BOOL _preconnect; > #endif > @end > >@@ -156,28 +195,6 @@ typedef void (^CFCachedURLResponseCallBackBlock)(CFCachedURLResponseRef); > @end > #endif > >-@interface NSHTTPCookie () >-@property (nullable, readonly, copy) NSString *_storagePartition; >-@end >- >-@interface NSHTTPCookieStorage () >-- (id)_initWithIdentifier:(NSString *)identifier private:(bool)isPrivate; >-- (void)_getCookiesForURL:(NSURL *)url mainDocumentURL:(NSURL *)mainDocumentURL partition:(NSString *)partition completionHandler:(void (^)(NSArray *))completionHandler; >-- (void)_getCookiesForURL:(NSURL *)url mainDocumentURL:(NSURL *)mainDocumentURL partition:(NSString *)partition policyProperties:(NSDictionary*)props completionHandler:(void (^)(NSArray *))completionHandler; >-- (void)_setCookies:(NSArray *)cookies forURL:(NSURL *)URL mainDocumentURL:(NSURL *)mainDocumentURL policyProperties:(NSDictionary*) props; >-@end >- >-@interface NSURLSessionTask () >-- (NSDictionary *)_timingData; >-@property (readwrite, copy) NSString *_pathToDownloadTaskFile; >-@property (copy) NSString *_storagePartitionIdentifier; >-@property (nullable, readwrite, retain) NSURL *_siteForCookies; >-@property (readwrite) BOOL _isTopLevelNavigation; >-#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >-@property (nonatomic, assign) BOOL _preconnect; >-#endif >-@end >- > extern NSString * const NSURLAuthenticationMethodOAuth; > > #endif // defined(__OBJC__) >@@ -285,11 +302,6 @@ enum : NSUInteger { > NSHTTPCookieAcceptPolicyExclusivelyFromMainDocumentDomain = 3, > }; > >-@interface NSCachedURLResponse () >--(id)_initWithCFCachedURLResponse:(CFCachedURLResponseRef)cachedResponse; >--(CFCachedURLResponseRef)_CFCachedURLResponse; >-@end >- > #endif > > WTF_EXTERN_C_BEGIN >@@ -314,6 +326,9 @@ WTF_EXTERN_C_END > > #if defined(__OBJC__) > >+// FIXME: Move these declarations the above section under !USE(APPLE_INTERNAL_SDK) when possible so that >+// Apple internal SDK builds use headers instead. >+ > @interface NSHTTPCookie () > #if PLATFORM(MAC) > + (NSArray *)_parsedCookiesWithResponseHeaderFields:(NSDictionary *)headerFields forURL:(NSURL *)aURL; >@@ -321,17 +336,6 @@ WTF_EXTERN_C_END > + (NSArray *)_cf2nsCookies:(CFArrayRef)cfCookies; > @end > >-#if !USE(APPLE_INTERNAL_SDK) >-@interface NSHTTPCookieStorage () >-- (void)removeCookiesSinceDate:(NSDate *)date; >-- (id)_initWithCFHTTPCookieStorage:(CFHTTPCookieStorageRef)cfStorage; >-- (CFHTTPCookieStorageRef)_cookieStorage; >-- (void)_saveCookies; >-- (void)_saveCookies:(dispatch_block_t) completionHandler; >-@end >-#endif >- >-// FIXME: Move +_setSharedHTTPCookieStorage: into the above section under !USE(APPLE_INTERNAL_SDK) when possible (soon). > @interface NSHTTPCookieStorage () > + (void)_setSharedHTTPCookieStorage:(NSHTTPCookieStorage *)storage; > @end >@@ -340,4 +344,15 @@ WTF_EXTERN_C_END > - (void)_setMIMEType:(NSString *)type; > @end > >+@interface NSURLSessionConfiguration () >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) >+// FIXME: Remove this once rdar://problem/40650244 is in a build. >+@property (copy) NSDictionary *_socketStreamProperties; >+#endif >+@end >+ >+@interface NSURLSessionTask () >+- (void)_setExplicitCookieStorage:(CFHTTPCookieStorageRef)storage; >+@end >+ > #endif // defined(__OBJC__) >diff --git a/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm b/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm >index ec64ea91cf72aa5256c9a56aee3262f82edb00fb..e45fdaa43b00be0be145aeecf7fce3ef97ef5ecb 100644 >--- a/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm >+++ b/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm >@@ -29,6 +29,7 @@ > #import "config.h" > #import "URLParser.h" > #import "WebCoreNSURLExtras.h" >+#import <pal/spi/cf/CFNetworkSPI.h> > #import <wtf/Function.h> > #import <wtf/HexNumber.h> > #import <wtf/ObjcRuntimeExtras.h> >@@ -47,11 +48,6 @@ typedef void (* StringRangeApplierFunction)(NSString *string, NSRange range, voi > > static uint32_t IDNScriptWhiteList[(USCRIPT_CODE_LIMIT + 31) / 32]; > >- >-@interface NSURLProtocol (WKNSURLProtocolInternal) >-+ (Class)_protocolClassForRequest:(NSURLRequest *)request; >-@end >- > namespace WebCore { > > static bool isArmenianLookalikeCharacter(UChar32 codePoint) >diff --git a/Source/WebCore/platform/network/mac/ResourceHandleMac.mm b/Source/WebCore/platform/network/mac/ResourceHandleMac.mm >index 1d7b6e78742ee17866907e54d625481274ca9054..b9fc2a2f17cd9574004cbb97499aabd1166e073b 100644 >--- a/Source/WebCore/platform/network/mac/ResourceHandleMac.mm >+++ b/Source/WebCore/platform/network/mac/ResourceHandleMac.mm >@@ -63,10 +63,6 @@ > > using namespace WebCore; > >-@interface NSURLConnection () >--(id)_initWithRequest:(NSURLRequest *)request delegate:(id)delegate usesCache:(BOOL)usesCacheFlag maxContentLength:(long long)maxContentLength startImmediately:(BOOL)startImmediately connectionProperties:(NSDictionary *)connectionProperties; >-@end >- > namespace WebCore { > > static void applyBasicAuthorizationHeader(ResourceRequest& request, const Credential& credential) >@@ -224,7 +220,10 @@ void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredential > // web content for purposes of App Transport Security. > [propertyDictionary setObject:@{@"NSAllowsArbitraryLoadsInWebContent": @YES} forKey:@"_kCFURLConnectionPropertyATSFrameworkOverrides"]; > >+#pragma clang diagnostic push >+#pragma clang diagnostic ignored "-Wdeprecated-declarations" > d->m_connection = adoptNS([[NSURLConnection alloc] _initWithRequest:nsRequest delegate:delegate usesCache:usesCache maxContentLength:0 startImmediately:NO connectionProperties:propertyDictionary]); >+#pragma clang diagnostic pop > } > > bool ResourceHandle::start() >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm >index fc209c8f71397e1728c152379937b28b9f4c1d2f..c2d45d66bd258eb832c254feb835aade6713e945 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm >@@ -45,26 +45,10 @@ > #import <wtf/ProcessPrivilege.h> > #import <wtf/text/Base64.h> > >-#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) >-@interface NSURLSessionTask (Staging) >-@property (readwrite, retain) NSURL *_siteForCookies; >-@property (readwrite) BOOL _isTopLevelNavigation; >-@end >-#endif >- > #if HAVE(NW_ACTIVITY) > #import <CFNetwork/CFNSURLConnection.h> > #endif > >-#if HAVE(CFNETWORK_STORAGE_PARTITIONING) >- >-// FIXME: Move to CFNetworkSPI.h? >-@interface NSURLSessionTask () >-- (void)_setExplicitCookieStorage:(CFHTTPCookieStorageRef)storage; >-@end >- >-#endif >- > namespace WebKit { > > #if USE(CREDENTIAL_STORAGE_WITH_NETWORK_SESSION) >diff --git a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >index fa045f9eb0cd7b4a9a14a3faa1e43660e7370b2e..81d7f8e72ffdbd82b76bc5663c6dcef8eb589c17 100644 >--- a/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >+++ b/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm >@@ -54,16 +54,6 @@ > > using namespace WebKit; > >-#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >-@interface NSURLSessionConfiguration (WKStaging) >-@property (copy) NSSet *_suppressedAutoAddedHTTPHeaders; >-#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000) >-// FIXME: Remove this once rdar://problem/40650244 is in a build. >-@property (copy) NSDictionary *_socketStreamProperties; >-#endif >-@end >-#endif >- > static NSURLSessionResponseDisposition toNSURLSessionResponseDisposition(WebCore::PolicyAction disposition) > { > switch (disposition) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189072
:
348380
|
348383
|
348387
|
348471
|
348716