38db2c5d476b7eaa674c8e9036f4872d4b259759
[WebKit-https.git] / Source / WebCore / PAL / pal / spi / cf / CFNetworkSPI.h
1 /*
2  * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #pragma clang system_header
27
28 #pragma once
29
30 #include <CFNetwork/CFNetwork.h>
31 #include <pal/spi/cf/CFNetworkConnectionCacheSPI.h>
32
33 #if PLATFORM(WIN) || USE(APPLE_INTERNAL_SDK)
34
35 #include <CFNetwork/CFHTTPCookiesPriv.h>
36 #include <CFNetwork/CFHTTPStream.h>
37 #include <CFNetwork/CFProxySupportPriv.h>
38 #include <CFNetwork/CFURLCachePriv.h>
39 #include <CFNetwork/CFURLConnectionPriv.h>
40 #include <CFNetwork/CFURLCredentialStorage.h>
41 #include <CFNetwork/CFURLProtocolPriv.h>
42 #include <CFNetwork/CFURLRequestPriv.h>
43 #include <CFNetwork/CFURLResponsePriv.h>
44 #include <CFNetwork/CFURLStorageSession.h>
45
46 #if PLATFORM(WIN)
47
48 WTF_EXTERN_C_BEGIN
49
50 CFN_EXPORT CFStringRef _CFNetworkErrorGetLocalizedDescription(CFIndex);
51
52 extern const CFStringRef _kCFWindowsSSLLocalCert;
53 extern const CFStringRef _kCFStreamPropertyWindowsSSLCertInfo;
54 extern const CFStringRef _kCFWindowsSSLPeerCert;
55
56 WTF_EXTERN_C_END
57
58 #endif
59
60 // FIXME: Remove the defined(__OBJC__)-guard once we fix <rdar://problem/19033610>.
61 #if defined(__OBJC__) && PLATFORM(COCOA)
62 #import <CFNetwork/CFNSURLConnection.h>
63 #endif
64
65 // This only needs to be declared on macOS 10.12 Sierra because
66 // it will never appear in those SDK headers.  See also
67 // HAVE(CFNETWORK_OVERRIDE_SESSION_COOKIE_ACCEPT_POLICY).
68 #if defined(__OBJC__) && PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED == 101200
69 @interface NSHTTPCookieStorage ()
70 @property (nonatomic, readwrite) BOOL _overrideSessionCookieAcceptPolicy;
71 @end
72 #endif
73
74 #else // !PLATFORM(WIN) && !USE(APPLE_INTERNAL_SDK)
75
76 typedef CF_ENUM(int64_t, _TimingDataOptions)
77 {
78     _TimingDataOptionsEnableW3CNavigationTiming = (1 << 0)
79 };
80
81 enum CFURLCacheStoragePolicy {
82     kCFURLCacheStorageAllowed = 0,
83     kCFURLCacheStorageAllowedInMemoryOnly = 1,
84     kCFURLCacheStorageNotAllowed = 2
85 };
86 typedef enum CFURLCacheStoragePolicy CFURLCacheStoragePolicy;
87
88 typedef const struct _CFCachedURLResponse* CFCachedURLResponseRef;
89 typedef const struct _CFURLCache* CFURLCacheRef;
90 typedef const struct _CFURLCredential* CFURLCredentialRef;
91 typedef const struct _CFURLRequest* CFURLRequestRef;
92 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
93 typedef const struct __CFData* CFDataRef;
94 typedef const struct OpaqueCFHTTPCookie* CFHTTPCookieRef;
95 typedef struct _CFURLConnection* CFURLConnectionRef;
96 typedef struct _CFURLCredentialStorage* CFURLCredentialStorageRef;
97 typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
98 typedef struct _CFURLRequest* CFMutableURLRequestRef;
99 typedef struct _CFURLResponse* CFURLResponseRef;
100 typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
101 typedef CFIndex CFURLRequestPriority;
102 typedef int CFHTTPCookieStorageAcceptPolicy;
103
104 CF_ENUM(CFHTTPCookieStorageAcceptPolicy)
105 {
106     CFHTTPCookieStorageAcceptPolicyAlways = 0,
107     CFHTTPCookieStorageAcceptPolicyNever = 1,
108     CFHTTPCookieStorageAcceptPolicyOnlyFromMainDocumentDomain = 2,
109     CFHTTPCookieStorageAcceptPolicyExclusivelyFromMainDocumentDomain = 3,
110 };
111
112 #ifdef __BLOCKS__
113 typedef void (^CFCachedURLResponseCallBackBlock)(CFCachedURLResponseRef);
114 #endif
115
116 #if defined(__OBJC__)
117
118 @interface NSURLCache ()
119 - (CFURLCacheRef)_CFURLCache;
120 @end
121
122 @interface NSCachedURLResponse ()
123 - (id)_initWithCFCachedURLResponse:(CFCachedURLResponseRef)cachedResponse;
124 - (CFCachedURLResponseRef)_CFCachedURLResponse;
125 @end
126
127 @interface NSHTTPCookie ()
128 - (CFHTTPCookieRef)_CFHTTPCookie;
129 + (CFArrayRef __nullable)_ns2cfCookies:(NSArray * __nullable)nsCookies CF_RETURNS_RETAINED;
130 - (CFHTTPCookieRef __nullable)_GetInternalCFHTTPCookie;
131 @property (nullable, readonly, copy) NSString *_storagePartition;
132 @end
133
134 @interface NSHTTPCookieStorage ()
135 - (id)_initWithIdentifier:(NSString *)identifier private:(bool)isPrivate;
136 - (void)_getCookiesForURL:(NSURL *)url mainDocumentURL:(NSURL *)mainDocumentURL partition:(NSString *)partition completionHandler:(void (^)(NSArray *))completionHandler;
137 - (void)_getCookiesForURL:(NSURL *)url mainDocumentURL:(NSURL *)mainDocumentURL partition:(NSString *)partition policyProperties:(NSDictionary*)props completionHandler:(void (^)(NSArray *))completionHandler;
138 - (void)_setCookies:(NSArray *)cookies forURL:(NSURL *)URL mainDocumentURL:(NSURL *)mainDocumentURL policyProperties:(NSDictionary*) props;
139 - (void)removeCookiesSinceDate:(NSDate *)date;
140 - (id)_initWithCFHTTPCookieStorage:(CFHTTPCookieStorageRef)cfStorage;
141 - (CFHTTPCookieStorageRef)_cookieStorage;
142 - (void)_saveCookies;
143 #if HAVE(FOUNDATION_WITH_SAVE_COOKIES_WITH_COMPLETION_HANDLER)
144 - (void)_saveCookies:(dispatch_block_t) completionHandler;
145 #endif
146 #if HAVE(CFNETWORK_OVERRIDE_SESSION_COOKIE_ACCEPT_POLICY)
147 @property (nonatomic, readwrite) BOOL _overrideSessionCookieAcceptPolicy;
148 #endif
149 @end
150
151 @interface NSURLConnection ()
152 - (id)_initWithRequest:(NSURLRequest *)request delegate:(id)delegate usesCache:(BOOL)usesCacheFlag maxContentLength:(long long)maxContentLength startImmediately:(BOOL)startImmediately connectionProperties:(NSDictionary *)connectionProperties;
153 @end
154
155 @interface NSMutableURLRequest ()
156 - (void)setContentDispositionEncodingFallbackArray:(NSArray *)theEncodingFallbackArray;
157 - (void)setBoundInterfaceIdentifier:(NSString *)identifier;
158 - (void)_setPreventHSTSStorage:(BOOL)preventHSTSStorage;
159 - (void)_setIgnoreHSTS:(BOOL)ignoreHSTS;
160 @end
161
162 @interface NSURLProtocol ()
163 + (Class)_protocolClassForRequest:(NSURLRequest *)request;
164 @end
165
166 @interface NSURLRequest ()
167 + (NSArray *)allowsSpecificHTTPSCertificateForHost:(NSString *)host;
168 + (void)setAllowsSpecificHTTPSCertificate:(NSArray *)allow forHost:(NSString *)host;
169 + (void)setDefaultTimeoutInterval:(NSTimeInterval)seconds;
170 - (NSArray *)contentDispositionEncodingFallbackArray;
171 - (CFMutableURLRequestRef)_CFURLRequest;
172 - (id)_initWithCFURLRequest:(CFURLRequestRef)request;
173 - (id)_propertyForKey:(NSString *)key;
174 - (void)_setProperty:(id)value forKey:(NSString *)key;
175 - (BOOL)_schemeWasUpgradedDueToDynamicHSTS;
176 - (BOOL)_preventHSTSStorage;
177 - (BOOL)_ignoreHSTS;
178 @end
179
180 @interface NSURLResponse ()
181 + (NSURLResponse *)_responseWithCFURLResponse:(CFURLResponseRef)response;
182 - (CFURLResponseRef)_CFURLResponse;
183 - (NSDate *)_lastModifiedDate;
184 @end
185
186 #if PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MAX_ALLOWED >= 60000
187 typedef NS_ENUM(NSInteger, NSURLSessionCompanionProxyPreference) {
188     NSURLSessionCompanionProxyPreferenceDefault = 0,
189     NSURLSessionCompanionProxyPreferencePreferCompanion,
190     NSURLSessionCompanionProxyPreferencePreferDirectToCloud,
191 };
192 #endif
193
194 @interface NSURLSessionConfiguration ()
195 @property (assign) _TimingDataOptions _timingDataOptions;
196 @property (copy) NSData *_sourceApplicationAuditTokenData;
197 @property (nullable, copy) NSString *_sourceApplicationBundleIdentifier;
198 @property (nullable, copy) NSString *_sourceApplicationSecondaryIdentifier;
199 @property BOOL _shouldSkipPreferredClientCertificateLookup NS_AVAILABLE(10_10, 8_0);
200 @property BOOL _allowsTLSFallback;
201 #if PLATFORM(IOS_FAMILY)
202 @property (nullable, copy) NSString *_CTDataConnectionServiceType;
203 #endif
204 #if HAVE(CFNETWORK_WITH_AUTO_ADDED_HTTP_HEADER_SUPPRESSION_SUPPORT)
205 @property (nullable, copy) NSSet *_suppressedAutoAddedHTTPHeaders;
206 #endif
207 #if PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MAX_ALLOWED >= 60000
208 @property NSURLSessionCompanionProxyPreference _companionProxyPreference;
209 #endif
210 @end
211
212 @interface NSURLSessionTask ()
213 - (NSDictionary *)_timingData;
214 @property (readwrite, copy) NSString *_pathToDownloadTaskFile;
215 @property (copy) NSString *_storagePartitionIdentifier;
216 #if HAVE(FOUNDATION_WITH_SAME_SITE_COOKIE_SUPPORT)
217 @property (nullable, readwrite, retain) NSURL *_siteForCookies;
218 @property (readwrite) BOOL _isTopLevelNavigation;
219 #endif
220 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
221 @property (nonatomic, assign) BOOL _preconnect;
222 #endif
223 @end
224
225 #if HAVE(CFNETWORK_NSURLSESSIONTASKTRANSACTIONMETRICS_SPI)
226 @interface NSURLSessionTaskTransactionMetrics ()
227 @property (copy, readonly) NSString* _remoteAddressAndPort;
228 @property (copy, readonly) NSUUID* _connectionIdentifier;
229 @property (assign, readonly) NSInteger _requestHeaderBytesSent;
230 @property (assign, readonly) NSInteger _responseHeaderBytesReceived;
231 @property (assign, readonly) int64_t _responseBodyBytesReceived;
232 @property (assign, readonly) int64_t _responseBodyBytesDecoded;
233 @end
234 #endif
235
236 #if HAVE(CFNETWORK_NEGOTIATED_SSL_PROTOCOL_CIPHER)
237 @interface NSURLSessionTaskTransactionMetrics ()
238 @property (assign) SSLProtocol _negotiatedTLSProtocol;
239 @property (assign) SSLCipherSuite _negotiatedTLSCipher;
240 @end
241 #endif
242
243 @interface NSURLSession (SPI)
244 #if HAVE(CFNETWORK_NSURLSESSION_STRICTRUSTEVALUATE)
245 + (void)_strictTrustEvaluate:(NSURLAuthenticationChallenge *)challenge queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSURLAuthenticationChallenge *challenge, OSStatus trustResult))cb;
246 #endif
247 #if HAVE(APP_SSO)
248 + (void)_disableAppSSO;
249 #endif
250 @end
251
252 extern NSString * const NSURLAuthenticationMethodOAuth;
253
254 #endif // defined(__OBJC__)
255
256 #endif // !PLATFORM(WIN) && !USE(APPLE_INTERNAL_SDK)
257
258 WTF_EXTERN_C_BEGIN
259
260 #if !PLATFORM(WIN)
261
262 CFURLStorageSessionRef _CFURLStorageSessionCreate(CFAllocatorRef, CFStringRef, CFDictionaryRef);
263 CFURLCacheRef _CFURLStorageSessionCopyCache(CFAllocatorRef, CFURLStorageSessionRef);
264
265 void CFURLRequestSetShouldStartSynchronously(CFURLRequestRef, Boolean);
266
267 CFURLCacheRef CFURLCacheCopySharedURLCache();
268 void CFURLCacheSetMemoryCapacity(CFURLCacheRef, CFIndex memoryCapacity);
269 CFIndex CFURLCacheMemoryCapacity(CFURLCacheRef);
270 void CFURLCacheSetDiskCapacity(CFURLCacheRef, CFIndex);
271 CFCachedURLResponseRef CFURLCacheCopyResponseForRequest(CFURLCacheRef, CFURLRequestRef);
272
273 void CFHTTPCookieStorageDeleteAllCookies(CFHTTPCookieStorageRef);
274 void _CFHTTPCookieStorageFlushCookieStores();
275
276 #if PLATFORM(COCOA)
277 CFDataRef _CFCachedURLResponseGetMemMappedData(CFCachedURLResponseRef);
278 #endif
279
280 #if PLATFORM(COCOA) && defined(__BLOCKS__)
281 void _CFCachedURLResponseSetBecameFileBackedCallBackBlock(CFCachedURLResponseRef, CFCachedURLResponseCallBackBlock, dispatch_queue_t);
282 #endif
283
284 extern CFStringRef const kCFHTTPCookieLocalFileDomain;
285 extern const CFStringRef kCFHTTPVersion1_1;
286 extern const CFStringRef kCFURLRequestAllowAllPOSTCaching;
287 extern const CFStringRef _kCFURLCachePartitionKey;
288 extern const CFStringRef _kCFURLConnectionPropertyShouldSniff;
289 extern const CFStringRef _kCFURLStorageSessionIsPrivate;
290
291 #if HAVE(CFNETWORK_WITH_CONTENT_ENCODING_SNIFFING_OVERRIDE)
292 extern const CFStringRef kCFURLRequestContentDecoderSkipURLCheck;
293 #endif
294
295 CFHTTPCookieStorageRef _CFHTTPCookieStorageGetDefault(CFAllocatorRef);
296 CFHTTPCookieStorageRef CFHTTPCookieStorageCreateFromFile(CFAllocatorRef, CFURLRef, CFHTTPCookieStorageRef);
297 void CFHTTPCookieStorageScheduleWithRunLoop(CFHTTPCookieStorageRef, CFRunLoopRef, CFStringRef);
298 void CFHTTPCookieStorageSetCookie(CFHTTPCookieStorageRef, CFHTTPCookieRef);
299 void CFHTTPCookieStorageSetCookieAcceptPolicy(CFHTTPCookieStorageRef, CFHTTPCookieStorageAcceptPolicy);
300 CFHTTPCookieStorageAcceptPolicy CFHTTPCookieStorageGetCookieAcceptPolicy(CFHTTPCookieStorageRef);
301
302 typedef void (*CFHTTPCookieStorageChangedProcPtr)(CFHTTPCookieStorageRef, void*);
303 void CFHTTPCookieStorageAddObserver(CFHTTPCookieStorageRef, CFRunLoopRef, CFStringRef, CFHTTPCookieStorageChangedProcPtr, void*);
304 void CFHTTPCookieStorageRemoveObserver(CFHTTPCookieStorageRef, CFRunLoopRef, CFStringRef, CFHTTPCookieStorageChangedProcPtr, void*);
305
306 CFURLCredentialStorageRef CFURLCredentialStorageCreate(CFAllocatorRef);
307 CFURLCredentialRef CFURLCredentialStorageCopyDefaultCredentialForProtectionSpace(CFURLCredentialStorageRef, CFURLProtectionSpaceRef);
308 CFURLRequestPriority CFURLRequestGetRequestPriority(CFURLRequestRef);
309 void _CFURLRequestSetProtocolProperty(CFURLRequestRef, CFStringRef, CFTypeRef);
310 void CFURLRequestSetRequestPriority(CFURLRequestRef, CFURLRequestPriority);
311 void CFURLRequestSetShouldPipelineHTTP(CFURLRequestRef, Boolean, Boolean);
312 void _CFURLRequestSetStorageSession(CFMutableURLRequestRef, CFURLStorageSessionRef);
313 CFStringRef CFURLResponseCopySuggestedFilename(CFURLResponseRef);
314 CFHTTPMessageRef CFURLResponseGetHTTPResponse(CFURLResponseRef);
315 CFStringRef CFURLResponseGetMIMEType(CFURLResponseRef);
316 CFDictionaryRef _CFURLResponseGetSSLCertificateContext(CFURLResponseRef);
317 CFURLRef CFURLResponseGetURL(CFURLResponseRef);
318 void CFURLResponseSetMIMEType(CFURLResponseRef, CFStringRef);
319 CFHTTPCookieStorageRef _CFURLStorageSessionCopyCookieStorage(CFAllocatorRef, CFURLStorageSessionRef);
320 CFArrayRef _CFHTTPCookieStorageCopyCookiesForURLWithMainDocumentURL(CFHTTPCookieStorageRef inCookieStorage, CFURLRef inURL, CFURLRef inMainDocumentURL, Boolean sendSecureCookies);
321 CFStringRef CFURLResponseGetTextEncodingName(CFURLResponseRef);
322 SInt64 CFURLResponseGetExpectedContentLength(CFURLResponseRef);
323 CFTypeID CFURLResponseGetTypeID();
324 Boolean CFURLRequestShouldHandleHTTPCookies(CFURLRequestRef);
325 CFURLRef CFURLRequestGetURL(CFURLRequestRef);
326 CFURLResponseRef CFURLResponseCreate(CFAllocatorRef, CFURLRef, CFStringRef mimeType, SInt64 expectedContentLength, CFStringRef textEncodingName, CFURLCacheStoragePolicy);
327 void CFURLResponseSetExpectedContentLength(CFURLResponseRef, SInt64 length);
328 CFURLResponseRef CFURLResponseCreateWithHTTPResponse(CFAllocatorRef, CFURLRef, CFHTTPMessageRef, CFURLCacheStoragePolicy);
329 CFArrayRef CFHTTPCookieStorageCopyCookies(CFHTTPCookieStorageRef);
330 void CFHTTPCookieStorageSetCookies(CFHTTPCookieStorageRef, CFArrayRef cookies, CFURLRef, CFURLRef mainDocumentURL);
331 void CFHTTPCookieStorageDeleteCookie(CFHTTPCookieStorageRef, CFHTTPCookieRef);
332 CFMutableURLRequestRef CFURLRequestCreateMutableCopy(CFAllocatorRef, CFURLRequestRef);
333 CFStringRef _CFURLCacheCopyCacheDirectory(CFURLCacheRef);
334 Boolean _CFHostIsDomainTopLevel(CFStringRef domain);
335 void _CFURLRequestCreateArchiveList(CFAllocatorRef, CFURLRequestRef, CFIndex* version, CFTypeRef** objects, CFIndex* objectCount, CFDictionaryRef* protocolProperties);
336 CFMutableURLRequestRef _CFURLRequestCreateFromArchiveList(CFAllocatorRef, CFIndex version, CFTypeRef* objects, CFIndex objectCount, CFDictionaryRef protocolProperties);
337 void CFURLRequestSetProxySettings(CFMutableURLRequestRef, CFDictionaryRef);
338
339 #if HAVE(HSTS_STORAGE_PATH)
340 void _CFNetworkSetHSTSStoragePath(CFStringRef);
341 #endif
342
343 #endif // !PLATFORM(WIN)
344
345 CFN_EXPORT const CFStringRef kCFStreamPropertyCONNECTProxy;
346 CFN_EXPORT const CFStringRef kCFStreamPropertyCONNECTProxyHost;
347 CFN_EXPORT const CFStringRef kCFStreamPropertyCONNECTProxyPort;
348 CFN_EXPORT const CFStringRef kCFStreamPropertyCONNECTAdditionalHeaders;
349 CFN_EXPORT const CFStringRef kCFStreamPropertyCONNECTResponse;
350
351 CFN_EXPORT void _CFHTTPMessageSetResponseURL(CFHTTPMessageRef, CFURLRef);
352 CFN_EXPORT void _CFHTTPMessageSetResponseProxyURL(CFHTTPMessageRef, CFURLRef);
353
354 WTF_EXTERN_C_END
355
356 #if defined(__OBJC__) && !USE(APPLE_INTERNAL_SDK)
357
358 enum : NSUInteger {
359     NSHTTPCookieAcceptPolicyExclusivelyFromMainDocumentDomain = 3,
360 };
361
362 #endif
363
364 WTF_EXTERN_C_BEGIN
365
366 CFDataRef _CFNetworkCopyATSContext(void);
367 Boolean _CFNetworkSetATSContext(CFDataRef);
368
369 #if PLATFORM(COCOA)
370 extern const CFStringRef _kCFNetworkHSTSPreloaded;
371 CFDictionaryRef _CFNetworkCopyHSTSPolicies(CFURLStorageSessionRef);
372 void _CFNetworkResetHSTS(CFURLRef, CFURLStorageSessionRef);
373 void _CFNetworkResetHSTSHostsSinceDate(CFURLStorageSessionRef, CFDateRef);
374 Boolean _CFNetworkIsKnownHSTSHostWithSession(CFURLRef, CFURLStorageSessionRef);
375 void _CFNetworkResetHSTSHostsWithSession(CFURLStorageSessionRef);
376 #endif
377
378 CFDataRef CFHTTPCookieStorageCreateIdentifyingData(CFAllocatorRef inAllocator, CFHTTPCookieStorageRef inStorage);
379 CFHTTPCookieStorageRef CFHTTPCookieStorageCreateFromIdentifyingData(CFAllocatorRef inAllocator, CFDataRef inData);
380 CFArrayRef _CFHTTPParsedCookiesWithResponseHeaderFields(CFAllocatorRef inAllocator, CFDictionaryRef headerFields, CFURLRef inURL);
381
382 WTF_EXTERN_C_END
383
384 #if defined(__OBJC__)
385
386 // FIXME: Move these declarations the above section under !USE(APPLE_INTERNAL_SDK) when possible so that
387 // Apple internal SDK builds use headers instead.
388
389 @interface NSHTTPCookie ()
390 #if PLATFORM(MAC)
391 + (NSArray *)_parsedCookiesWithResponseHeaderFields:(NSDictionary *)headerFields forURL:(NSURL *)aURL;
392 #endif
393 + (NSArray *)_cf2nsCookies:(CFArrayRef)cfCookies;
394 @end
395
396 @interface NSHTTPCookieStorage ()
397 + (void)_setSharedHTTPCookieStorage:(NSHTTPCookieStorage *)storage;
398 @end
399
400 @interface NSURLResponse ()
401 - (void)_setMIMEType:(NSString *)type;
402 @end
403
404 @interface NSURLSessionConfiguration ()
405 // FIXME: Remove this once rdar://problem/40650244 is in a build.
406 @property (copy) NSDictionary *_socketStreamProperties;
407 @end
408
409 @interface NSURLSessionTask ()
410 - (void)_setExplicitCookieStorage:(CFHTTPCookieStorageRef)storage;
411 @end
412
413 #endif // defined(__OBJC__)