[watchOS] Adopt NSURLSessionCompanionProxyPreference
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Oct 2018 00:07:04 +0000 (00:07 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Oct 2018 00:07:04 +0000 (00:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=190177
<rdar://problem/43402114>

Reviewed by Wenson Hsieh.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

Source/WTF:

* wtf/FeatureDefines.h:

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

Source/WTF/ChangeLog
Source/WTF/wtf/FeatureDefines.h
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

index 07d82dd..b52ccb5 100644 (file)
@@ -1,3 +1,13 @@
+2018-10-01  Andy Estes  <aestes@apple.com>
+
+        [watchOS] Adopt NSURLSessionCompanionProxyPreference
+        https://bugs.webkit.org/show_bug.cgi?id=190177
+        <rdar://problem/43402114>
+
+        Reviewed by Wenson Hsieh.
+
+        * wtf/FeatureDefines.h:
+
 2018-10-01  Koby Boyango  <koby.b@mce-sys.com>
 
         [WTF][JSCONLY] Use MainThreadWin on Windows in the JSCOnly port
index 5e1291d..858c298 100644 (file)
@@ -184,7 +184,7 @@ the public iOS SDK. See <https://webkit.org/b/179167>. */
 #if PLATFORM(WATCHOS)
 
 #if !defined(ENABLE_PROXIMITY_NETWORKING)
-#if !TARGET_OS_SIMULATOR
+#if !TARGET_OS_SIMULATOR && __WATCH_OS_VERSION_MIN_REQUIRED < 60000
 #define ENABLE_PROXIMITY_NETWORKING 1
 #endif
 #endif
index 3daccca..d6fb22d 100644 (file)
@@ -1,3 +1,13 @@
+2018-10-01  Andy Estes  <aestes@apple.com>
+
+        [watchOS] Adopt NSURLSessionCompanionProxyPreference
+        https://bugs.webkit.org/show_bug.cgi?id=190177
+        <rdar://problem/43402114>
+
+        Reviewed by Wenson Hsieh.
+
+        * pal/spi/cf/CFNetworkSPI.h:
+
 2018-10-01  Daniel Bates  <dabates@apple.com>
 
         [iOS] Special keys are misidentified in DOM keyboard events
index 6448bad..6c39378 100644 (file)
@@ -161,6 +161,14 @@ typedef void (^CFCachedURLResponseCallBackBlock)(CFCachedURLResponseRef);
 - (NSDate *)_lastModifiedDate;
 @end
 
+#if PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MAX_ALLOWED >= 60000
+typedef NS_ENUM(NSInteger, NSURLSessionCompanionProxyPreference) {
+    NSURLSessionCompanionProxyPreferenceDefault = 0,
+    NSURLSessionCompanionProxyPreferencePreferCompanion,
+    NSURLSessionCompanionProxyPreferencePreferDirectToCloud,
+};
+#endif
+
 @interface NSURLSessionConfiguration ()
 @property (assign) _TimingDataOptions _timingDataOptions;
 @property (copy) NSData *_sourceApplicationAuditTokenData;
@@ -173,6 +181,9 @@ 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(WATCHOS) && __WATCH_OS_VERSION_MAX_ALLOWED >= 60000
+@property NSURLSessionCompanionProxyPreference _companionProxyPreference;
+#endif
 @end
 
 @interface NSURLSessionTask ()
index 3fbfe38..3789c1d 100644 (file)
@@ -1,3 +1,14 @@
+2018-10-01  Andy Estes  <aestes@apple.com>
+
+        [watchOS] Adopt NSURLSessionCompanionProxyPreference
+        https://bugs.webkit.org/show_bug.cgi?id=190177
+        <rdar://problem/43402114>
+
+        Reviewed by Wenson Hsieh.
+
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
+
 2018-10-01  Chris Dumez  <cdumez@apple.com>
 
         [Mac] The UIProcess should listen to memory pressure signals
index cc0bcad..7f18c05 100644 (file)
@@ -707,6 +707,10 @@ NetworkSessionCocoa::NetworkSessionCocoa(NetworkSessionCreationParameters&& para
         configuration._socketStreamProperties = @{ @"kCFStreamPropertyAutoErrorOnSystemChange" : @(NO) };
 #endif
 
+#if PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 60000
+    configuration._companionProxyPreference = NSURLSessionCompanionProxyPreferencePreferDirectToCloud;
+#endif
+
     auto* storageSession = WebCore::NetworkStorageSession::storageSession(parameters.sessionID);
     RELEASE_ASSERT(storageSession);
     if (CFHTTPCookieStorageRef storage = storageSession->cookieStorage().get())