Title: [280185] branches/safari-612.1.24.11-branch/Source/WebKit
Revision
280185
Author
[email protected]
Date
2021-07-22 11:10:39 -0700 (Thu, 22 Jul 2021)

Log Message

Cherry-pick r280001. rdar://problem/80788656

    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.

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

Modified Paths

Diff

Modified: branches/safari-612.1.24.11-branch/Source/WebKit/ChangeLog (280184 => 280185)


--- branches/safari-612.1.24.11-branch/Source/WebKit/ChangeLog	2021-07-22 18:06:14 UTC (rev 280184)
+++ branches/safari-612.1.24.11-branch/Source/WebKit/ChangeLog	2021-07-22 18:10:39 UTC (rev 280185)
@@ -1,3 +1,44 @@
+2021-07-19  Ruben Turcios  <[email protected]>
+
+        Cherry-pick r280001. rdar://problem/80788656
+
+    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.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-07-16  Kate Cheney  <[email protected]>
+
+            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-14  Jer Noble  <[email protected]>
 
         Unreviewed build fix after r279912 (239661@main); Adopt HAVE(SYSTEM_STATUS) macro.

Modified: branches/safari-612.1.24.11-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (280184 => 280185)


--- branches/safari-612.1.24.11-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2021-07-22 18:06:14 UTC (rev 280184)
+++ branches/safari-612.1.24.11-branch/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm	2021-07-22 18:10:39 UTC (rev 280185)
@@ -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
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to