[CFNetwork] Update CFNetwork SPI use to use CFNetworkSPI.h more consistently
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Sep 2018 02:54:58 +0000 (02:54 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Sep 2018 02:54:58 +0000 (02:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189072
Source/WebCore:

Reviewed by Dan Bernstein.

* 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.

Source/WebCore/PAL:

Reviewed by Dan Bernstein.

* 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.

* pal/spi/cocoa/NSURLDownloadSPI.h: Added more NSURLDownload methods.

Source/WebKit:

Reviewed by Dan Bernstein.

* 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.

Source/WebKitLegacy/mac:

Reviewed by Dan Bernstein.

* Misc/WebDownload.mm: Removed forward declaration of NSURLConnectionDelegateProxy
and declarations for NSURLDownload init methods.

* Misc/WebDownloadInternal.h: Removed.

* WebCoreSupport/WebFrameLoaderClient.mm: Removed include of WebDownloadInternal.h.
(WebFrameLoaderClient::convertMainResourceLoadToDownload): Ignore
"-Wdeprecated-declarations" because the method used here is deprecated.

* WebView/WebView.mm:
(-[WebView _downloadURL:]): Ignore "-Wdeprecated-declarations" because the method
used here is deprecated.

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

14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h
Source/WebCore/PAL/pal/spi/cocoa/NSURLDownloadSPI.h
Source/WebCore/platform/mac/WebCoreNSURLExtras.mm
Source/WebCore/platform/network/mac/ResourceHandleMac.mm
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm
Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Misc/WebDownload.mm
Source/WebKitLegacy/mac/Misc/WebDownloadInternal.h [deleted file]
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKitLegacy/mac/WebView/WebView.mm

index 1564039..61181e2 100644 (file)
@@ -1,3 +1,19 @@
+2018-09-01  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 Dan Bernstein.
+
+        * 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-09-01  Simon Fraser  <simon.fraser@apple.com>
 
         Add some more filter logging
index e695f7a..87c6576 100644 (file)
@@ -1,3 +1,19 @@
+2018-09-01  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 Dan Bernstein.
+
+        * 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.
+
+        * pal/spi/cocoa/NSURLDownloadSPI.h: Added more NSURLDownload methods.
+
 2018-08-30  Don Olmstead  <don.olmstead@sony.com>
 
         [CMake] Replace AVFoundationSupport.py using CMake
index 3dc2950..17c13f3 100644 (file)
 #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,45 @@ 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 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 +143,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 +154,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 +166,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 +190,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 +297,6 @@ enum : NSUInteger {
     NSHTTPCookieAcceptPolicyExclusivelyFromMainDocumentDomain = 3,
 };
 
-@interface NSCachedURLResponse ()
--(id)_initWithCFCachedURLResponse:(CFCachedURLResponseRef)cachedResponse;
--(CFCachedURLResponseRef)_CFCachedURLResponse;
-@end
-
 #endif
 
 WTF_EXTERN_C_BEGIN
@@ -314,6 +321,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 +331,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 +339,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__)
index bad82de..7bc27e7 100644 (file)
 
 #pragma once
 
-#import <Foundation/NSObject.h>
-
 #if PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK)
 
 #import <Foundation/NSURLDownload.h>
 
 #if USE(APPLE_INTERNAL_SDK)
 #import <Foundation/NSURLDownloadPrivate.h>
-#else
-@interface NSURLDownload ()
-+(id)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)response delegate:(id)delegate proxy:(id)proxy;
-@end
 #endif
 
 #else
 @class NSURLRequest;
 @class NSURLResponse;
 
+#ifndef WebDownload_h
+/* Also defined in <WebKit/WebDownload.h>. */
+@interface NSURLDownload : NSObject
+@end
+#endif
+
 @protocol NSURLDownloadDelegate <NSObject>
 @optional
 - (void)downloadDidBegin:(NSURLDownload *)download;
 - (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error;
 @end
 
-#ifndef WebDownload_h
-/* Also defined in <WebKit/WebDownload.h>. */
-@interface NSURLDownload : NSObject
-@end
-#endif
-
 @interface NSURLDownload ()
 - (instancetype)initWithRequest:(NSURLRequest *)request delegate:(id <NSURLDownloadDelegate>)delegate;
 - (instancetype)initWithResumeData:(NSData *)resumeData delegate:(id <NSURLDownloadDelegate>)delegate path:(NSString *)path;
 @property (readonly, copy) NSURLRequest *request;
 @property (readonly, copy) NSData *resumeData;
 @property BOOL deletesFileUponFailure;
+@end
 
-+(id)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)response delegate:(id)delegate proxy:(id)proxy;
+#endif
+
+#if !USE(APPLE_INTERNAL_SDK)
+
+@class NSURLConnectionDelegateProxy;
+
+@interface NSURLDownload ()
++ (id)_downloadWithRequest:(NSURLRequest *)request delegate:(id)delegate directory:(NSString *)directory;
++ (id)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)response delegate:(id)delegate proxy:(id)proxy;
+- (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
 
 #endif
index ec64ea9..e45fdaa 100644 (file)
@@ -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)
index 1d7b6e7..b9fc2a2 100644 (file)
 
 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()
index 6626a8e..a4397d2 100644 (file)
@@ -1,3 +1,16 @@
+2018-09-01  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 Dan Bernstein.
+
+        * 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-09-01  Dan Bernstein  <mitz@apple.com>
 
         [Cocoa] Crash using KVO for 'serverTrust' property of WKWebView - "this class is not key value coding-compliant for the key serverTrust"
index fc209c8..c2d45d6 100644 (file)
 #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)
index fa045f9..81d7f8e 100644 (file)
 
 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) {
index 9b1d579..b4139bf 100644 (file)
@@ -1,3 +1,22 @@
+2018-09-01  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 Dan Bernstein.
+
+        * Misc/WebDownload.mm: Removed forward declaration of NSURLConnectionDelegateProxy
+        and declarations for NSURLDownload init methods.
+
+        * Misc/WebDownloadInternal.h: Removed.
+
+        * WebCoreSupport/WebFrameLoaderClient.mm: Removed include of WebDownloadInternal.h.
+        (WebFrameLoaderClient::convertMainResourceLoadToDownload): Ignore
+        "-Wdeprecated-declarations" because the method used here is deprecated.
+
+        * WebView/WebView.mm:
+        (-[WebView _downloadURL:]): Ignore "-Wdeprecated-declarations" because the method
+        used here is deprecated.
+
 2018-08-31  Chris Dumez  <cdumez@apple.com>
 
         Assertion hit in ~CompletionHandler() from ~WebFrame()
index 98c7cca..8c6afd2 100644 (file)
 
 using namespace WebCore;
 
-@class NSURLConnectionDelegateProxy;
-
-// FIXME: The following are NSURLDownload SPI - it would be nice to not have to override them at 
-// some point in the future
-@interface NSURLDownload (WebDownloadCapability)
-- (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 WebDownloadInternal : NSObject <NSURLDownloadDelegate>
-{
-@public
+@interface WebDownloadInternal : NSObject <NSURLDownloadDelegate> {
     id realDelegate;
 }
-
-- (void)setRealDelegate:(id)rd;
-
+- (void)setRealDelegate:(id)realDelegate;
 @end
 
 @implementation WebDownloadInternal
diff --git a/Source/WebKitLegacy/mac/Misc/WebDownloadInternal.h b/Source/WebKitLegacy/mac/Misc/WebDownloadInternal.h
deleted file mode 100644 (file)
index a33ce90..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2005 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. 
- * 3.  Neither the name of Apple Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission. 
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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.
-*/
-#import <WebKitLegacy/WebDownload.h>
-@interface WebDownload (WebDownloadCreation)
-+(id)_downloadWithLoadingConnection:(NSURLConnection *)connection request:(NSURLRequest *)request response:(NSURLResponse *)r delegate:(id)delegate proxy:(id)proxy;
-
-+(id)_downloadWithRequest:(NSURLRequest *)request delegate:(id)delegate directory:(NSString *)directory;
-
-@end
index 8fce7ef..9b9107d 100644 (file)
@@ -39,7 +39,7 @@
 #import "WebDelegateImplementationCaching.h"
 #import "WebDocumentInternal.h"
 #import "WebDocumentLoaderMac.h"
-#import "WebDownloadInternal.h"
+#import "WebDownload.h"
 #import "WebDynamicScrollBarsViewInternal.h"
 #import "WebElementDictionary.h"
 #import "WebFormDelegate.h"
@@ -318,7 +318,10 @@ void WebFrameLoaderClient::convertMainResourceLoadToDownload(DocumentLoader* doc
 
     ResourceHandle* handle = mainResourceLoader->handle();
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
     [WebDownload _downloadWithLoadingConnection:handle->connection() request:request.nsURLRequest(HTTPBodyUpdatePolicy::UpdateHTTPBody) response:response.nsURLResponse() delegate:[webView downloadDelegate] proxy:nil];
+#pragma clang diagnostic pop
 }
 
 bool WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache(DocumentLoader* loader, const ResourceRequest& request, const ResourceResponse& response, int length)
index 19619aa..91410a8 100644 (file)
@@ -58,7 +58,6 @@
 #import "WebDocument.h"
 #import "WebDocumentInternal.h"
 #import "WebDownload.h"
-#import "WebDownloadInternal.h"
 #import "WebDragClient.h"
 #import "WebDynamicScrollBarsViewInternal.h"
 #import "WebEditingDelegate.h"
 #import <pal/spi/cf/CFNetworkSPI.h>
 #import <pal/spi/cf/CFUtilitiesSPI.h>
 #import <pal/spi/cocoa/NSTouchBarSPI.h>
+#import <pal/spi/cocoa/NSURLDownloadSPI.h>
 #import <pal/spi/cocoa/NSURLFileTypeMappingsSPI.h>
 #import <pal/spi/mac/NSResponderSPI.h>
 #import <pal/spi/mac/NSSpellCheckerSPI.h>
@@ -2450,11 +2450,12 @@ static bool fastDocumentTeardownEnabled()
     ASSERT(URL);
     
     NSURLRequest *request = [[NSURLRequest alloc] initWithURL:URL];
-    WebDownload *download = [WebDownload _downloadWithRequest:request
-                                                     delegate:_private->downloadDelegate
-                                                    directory:nil];
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+    WebDownload *download = [WebDownload _downloadWithRequest:request delegate:_private->downloadDelegate directory:nil];
+#pragma clang diagnostic pop
     [request release];
-    
+
     return download;
 }