Title: [280001] trunk/Source/WebKit
Revision
280001
Author
katherine_che...@apple.com
Date
2021-07-16 14:26:15 -0700 (Fri, 16 Jul 2021)

Log Message

macOS Safari network sessions not being marked as being from a browser
https://bugs.webkit.org/show_bug.cgi?id=228028
<rdar://problem/80648664>

Reviewed by Brent Fulgham.

Move WebKitAdditions to open source to communicate full web browser
status to the networking stack. In the macOS case, we don't have
a full browser entitlement, so we should check for Safari.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::SessionWrapper::initialize):
The name com.apple.WebKit.InAppBrowser is not the most accurate name,
but changing it would require syncing with other parts of the network
stack. We should do this in a separate bug.

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (280000 => 280001)


--- trunk/Source/WebKit/ChangeLog	2021-07-16 21:22:48 UTC (rev 280000)
+++ trunk/Source/WebKit/ChangeLog	2021-07-16 21:26:15 UTC (rev 280001)
@@ -1,3 +1,21 @@
+2021-07-16  Kate Cheney  <katherine_che...@apple.com>
+
+        macOS Safari network sessions not being marked as being from a browser
+        https://bugs.webkit.org/show_bug.cgi?id=228028
+        <rdar://problem/80648664>
+
+        Reviewed by Brent Fulgham.
+
+        Move WebKitAdditions to open source to communicate full web browser
+        status to the networking stack. In the macOS case, we don't have
+        a full browser entitlement, so we should check for Safari.
+
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::SessionWrapper::initialize):
+        The name com.apple.WebKit.InAppBrowser is not the most accurate name,
+        but changing it would require syncing with other parts of the network
+        stack. We should do this in a separate bug.
+
 2021-07-16  Tim Horton  <timothy_hor...@apple.com>
 
         Adopt BifurcatedGraphicsContext for backing store + display list RemoteLayerBackingStore

Modified: trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (280000 => 280001)


--- trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2021-07-16 21:22:48 UTC (rev 280000)
+++ trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2021-07-16 21:26:15 UTC (rev 280001)
@@ -64,7 +64,6 @@
 #import <wtf/text/WTFString.h>
 
 #if USE(APPLE_INTERNAL_SDK)
-#import <WebKitAdditions/NetworkSessionCocoaAdditions.h>
 
 #if ENABLE(APP_PRIVACY_REPORT) && HAVE(SYMPTOMS_FRAMEWORK)
 #import <Symptoms/SymptomAnalytics.h>
@@ -83,7 +82,6 @@
 #endif
 
 #else
-#define NETWORK_SESSION_COCOA_ADDITIONS_1
 void WebKit::NetworkSessionCocoa::removeNetworkWebsiteData(std::optional<WallTime>, std::optional<HashSet<WebCore::RegistrableDomain>>&&, CompletionHandler<void()>&& completionHandler) { completionHandler(); }
 #endif
 
@@ -1185,9 +1183,14 @@
 void SessionWrapper::initialize(NSURLSessionConfiguration *configuration, NetworkSessionCocoa& networkSession, WebCore::StoredCredentialsPolicy storedCredentialsPolicy, NavigatingToAppBoundDomain isNavigatingToAppBoundDomain)
 {
     UNUSED_PARAM(isNavigatingToAppBoundDomain);
-#if PLATFORM(IOS_FAMILY)
-    NETWORK_SESSION_COCOA_ADDITIONS_1
+
+    auto isFullBrowser = isParentProcessAFullWebBrowser(networkSession.networkProcess());
+#if PLATFORM(MAC)
+    isFullBrowser = WebCore::MacApplication::isSafari();
 #endif
+    if (!configuration._sourceApplicationSecondaryIdentifier && isFullBrowser)
+        configuration._sourceApplicationSecondaryIdentifier = @"com.apple.WebKit.InAppBrowser";
+
     delegate = adoptNS([[WKNetworkSessionDelegate alloc] initWithNetworkSession:networkSession wrapper:*this withCredentials:storedCredentialsPolicy == WebCore::StoredCredentialsPolicy::Use]);
     session = [NSURLSession sessionWithConfiguration:configuration delegate:delegate.get() delegateQueue:[NSOperationQueue mainQueue]];
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to