Disable AppSSO for web processes and plugin processes
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jun 2019 21:39:07 +0000 (21:39 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jun 2019 21:39:07 +0000 (21:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=198843
<rdar://problem/51642920>

Reviewed by Sam Weinig.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:
Adds a SPI to disable AppSSO for CFNetwork.

Source/WebKit:

This patch moves the disabling of AppSSO from AuxiliaryProcess to PluginProcess
and WebProcess such that NetworkingProcess will not be affected.

* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::platformInitializePluginProcess):
* Shared/ios/AuxiliaryProcessIOS.mm:
(WebKit::AuxiliaryProcess::platformInitialize):
* Shared/mac/AuxiliaryProcessMac.mm:
(WebKit::AuxiliaryProcess::platformInitialize):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeProcess):

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

Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/cf/CFNetworkSPI.h
Source/WebKit/ChangeLog
Source/WebKit/PluginProcess/mac/PluginProcessMac.mm
Source/WebKit/Shared/ios/AuxiliaryProcessIOS.mm
Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm
Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm

index 7d873f5..ee05678 100644 (file)
@@ -1,3 +1,14 @@
+2019-06-14  Jiewen Tan  <jiewen_tan@apple.com>
+
+        Disable AppSSO for web processes and plugin processes
+        https://bugs.webkit.org/show_bug.cgi?id=198843
+        <rdar://problem/51642920>
+
+        Reviewed by Sam Weinig.
+
+        * pal/spi/cf/CFNetworkSPI.h:
+        Adds a SPI to disable AppSSO for CFNetwork.
+
 2019-06-12  Antoine Quint  <graouts@apple.com>
 
         Show the web page URL when sharing an AR model
index 897af04..182ff8b 100644 (file)
@@ -232,11 +232,14 @@ typedef NS_ENUM(NSInteger, NSURLSessionCompanionProxyPreference) {
 @end
 #endif
 
-#if HAVE(CFNETWORK_NSURLSESSION_STRICTRUSTEVALUATE)
 @interface NSURLSession (SPI)
+#if HAVE(CFNETWORK_NSURLSESSION_STRICTRUSTEVALUATE)
 + (void)_strictTrustEvaluate:(NSURLAuthenticationChallenge *)challenge queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSURLAuthenticationChallenge *challenge, OSStatus trustResult))cb;
-@end
 #endif
+#if HAVE(LOAD_OPTIMIZER)
++ (void)_disableAppSSO;
+#endif
+@end
 
 extern NSString * const NSURLAuthenticationMethodOAuth;
 
index 9f5ee2b..f8e3b01 100644 (file)
@@ -1,3 +1,23 @@
+2019-06-14  Jiewen Tan  <jiewen_tan@apple.com>
+
+        Disable AppSSO for web processes and plugin processes
+        https://bugs.webkit.org/show_bug.cgi?id=198843
+        <rdar://problem/51642920>
+
+        Reviewed by Sam Weinig.
+
+        This patch moves the disabling of AppSSO from AuxiliaryProcess to PluginProcess
+        and WebProcess such that NetworkingProcess will not be affected.
+
+        * PluginProcess/mac/PluginProcessMac.mm:
+        (WebKit::PluginProcess::platformInitializePluginProcess):
+        * Shared/ios/AuxiliaryProcessIOS.mm:
+        (WebKit::AuxiliaryProcess::platformInitialize):
+        * Shared/mac/AuxiliaryProcessMac.mm:
+        (WebKit::AuxiliaryProcess::platformInitialize):
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformInitializeProcess):
+
 2019-06-14  Megan Gardner  <megan_gardner@apple.com>
 
         Move Synthetic Editing Commands to behind an experimental feature flag
index bd3ab08..787bcba 100644 (file)
@@ -47,6 +47,7 @@
 #import <mach/mach_vm.h>
 #import <mach/vm_statistics.h>
 #import <objc/runtime.h>
+#import <pal/spi/cf/CFNetworkSPI.h>
 #import <pal/spi/cg/CoreGraphicsSPI.h>
 #import <pal/spi/cocoa/LaunchServicesSPI.h>
 #import <pal/spi/mac/HIToolboxSPI.h>
@@ -404,6 +405,9 @@ void PluginProcess::platformInitializePluginProcess(PluginProcessCreationParamet
     // Disable Dark Mode in the plugin process to avoid rendering issues.
     [NSApp setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameAqua]];
 #endif
+#if HAVE(LOAD_OPTIMIZER)
+    [NSURLSession _disableAppSSO];
+#endif
 }
 
 void PluginProcess::platformInitializeProcess(const AuxiliaryProcessInitializationParameters& parameters)
index 00e243c..e5e946f 100644 (file)
 #import <wtf/spi/darwin/SandboxSPI.h>
 #endif
 
-#if USE(APPLE_INTERNAL_SDK)
-#include <WebKitAdditions/AuxiliaryProcessAdditions.h>
-#endif
-
 namespace WebKit {
 
 void AuxiliaryProcess::platformInitialize()
@@ -55,9 +51,6 @@ void AuxiliaryProcess::platformInitialize()
     floatingPointEnvironment.enableDenormalSupport(); 
     floatingPointEnvironment.saveMainThreadEnvironment(); 
     [[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] bundlePath]];
-#if HAVE(LOAD_OPTIMIZER)
-AUXILIARYPROCESS_LOADOPTIMIZER_ADDITIONS
-#endif
 }
 
 void AuxiliaryProcess::initializeSandbox(const AuxiliaryProcessInitializationParameters& parameters, SandboxInitializationParameters& sandboxParameters)
index ac0f2d8..b157fcb 100644 (file)
@@ -57,7 +57,6 @@
 
 #if USE(APPLE_INTERNAL_SDK)
 #import <ApplicationServices/ApplicationServicesPriv.h>
-#import <WebKitAdditions/AuxiliaryProcessAdditions.h>
 #import <rootless.h>
 #endif
 
@@ -160,9 +159,6 @@ void AuxiliaryProcess::platformInitialize()
 {
     initializeTimerCoalescingPolicy();
     [[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] bundlePath]];
-#if HAVE(LOAD_OPTIMIZER)
-AUXILIARYPROCESS_LOADOPTIMIZER_ADDITIONS
-#endif
 }
 
 static OSStatus enableSandboxStyleFileQuarantine()
index 551e37a..37eb4af 100644 (file)
@@ -67,6 +67,7 @@
 #import <algorithm>
 #import <dispatch/dispatch.h>
 #import <objc/runtime.h>
+#import <pal/spi/cf/CFNetworkSPI.h>
 #import <pal/spi/cf/CFUtilitiesSPI.h>
 #import <pal/spi/cg/CoreGraphicsSPI.h>
 #import <pal/spi/cocoa/LaunchServicesSPI.h>
@@ -455,6 +456,10 @@ void WebProcess::platformInitializeProcess(const AuxiliaryProcessInitializationP
 #if USE(OS_STATE)
     registerWithStateDumper();
 #endif
+
+#if HAVE(LOAD_OPTIMIZER)
+    [NSURLSession _disableAppSSO];
+#endif
 }
 
 #if USE(APPKIT)