Title: [255366] trunk/Source/WebKit
Revision
255366
Author
cdu...@apple.com
Date
2020-01-29 10:12:02 -0800 (Wed, 29 Jan 2020)

Log Message

[iOS] Add managed preference to allow legacy sync XHRs during page dismissal
https://bugs.webkit.org/show_bug.cgi?id=206944
<rdar://problem/58440111>

Reviewed by Alex Christensen.

Add managed preference for iOS to allow enterprise customers to keep using legacy sync XHRs
during page dismissal.

* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled):
* Shared/WebPreferencesDefaultValues.h:
* Shared/ios/WebPreferencesDefaultValuesIOS.mm:
(WebKit::allowsDeprecatedSynchronousXMLHttpRequestDuringUnload):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (255365 => 255366)


--- trunk/Source/WebKit/ChangeLog	2020-01-29 18:07:40 UTC (rev 255365)
+++ trunk/Source/WebKit/ChangeLog	2020-01-29 18:12:02 UTC (rev 255366)
@@ -1,3 +1,20 @@
+2020-01-29  Chris Dumez  <cdu...@apple.com>
+
+        [iOS] Add managed preference to allow legacy sync XHRs during page dismissal
+        https://bugs.webkit.org/show_bug.cgi?id=206944
+        <rdar://problem/58440111>
+
+        Reviewed by Alex Christensen.
+
+        Add managed preference for iOS to allow enterprise customers to keep using legacy sync XHRs
+        during page dismissal.
+
+        * Shared/WebPreferencesDefaultValues.cpp:
+        (WebKit::defaultDisallowSyncXHRDuringPageDismissalEnabled):
+        * Shared/WebPreferencesDefaultValues.h:
+        * Shared/ios/WebPreferencesDefaultValuesIOS.mm:
+        (WebKit::allowsDeprecatedSynchronousXMLHttpRequestDuringUnload):
+
 2020-01-29  Carlos Garcia Campos  <cgar...@igalia.com>
 
         Unreviewed. Move unsetenv to WebProcessMain.cpp after r255342

Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp (255365 => 255366)


--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp	2020-01-29 18:07:40 UTC (rev 255365)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp	2020-01-29 18:12:02 UTC (rev 255366)
@@ -71,6 +71,11 @@
         WTFLogAlways("Allowing synchronous XHR during page unload due to managed preference");
         return false;
     }
+#elif PLATFORM(IOS_FAMILY)
+    if (allowsDeprecatedSynchronousXMLHttpRequestDuringUnload()) {
+        WTFLogAlways("Allowing synchronous XHR during page unload due to managed preference");
+        return false;
+    }
 #endif
     return true;
 }

Modified: trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h (255365 => 255366)


--- trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2020-01-29 18:07:40 UTC (rev 255365)
+++ trunk/Source/WebKit/Shared/WebPreferencesDefaultValues.h	2020-01-29 18:12:02 UTC (rev 255366)
@@ -315,5 +315,8 @@
 #if ENABLE(TEXT_AUTOSIZING)
 bool defaultTextAutosizingUsesIdempotentMode();
 #endif
+#if PLATFORM(IOS_FAMILY)
+bool allowsDeprecatedSynchronousXMLHttpRequestDuringUnload();
+#endif
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/Shared/ios/WebPreferencesDefaultValuesIOS.mm (255365 => 255366)


--- trunk/Source/WebKit/Shared/ios/WebPreferencesDefaultValuesIOS.mm	2020-01-29 18:07:40 UTC (rev 255365)
+++ trunk/Source/WebKit/Shared/ios/WebPreferencesDefaultValuesIOS.mm	2020-01-29 18:12:02 UTC (rev 255366)
@@ -29,6 +29,8 @@
 #if PLATFORM(IOS_FAMILY)
 
 #import "UserInterfaceIdiom.h"
+#import <pal/ios/ManagedConfigurationSoftLink.h>
+#import <pal/spi/ios/ManagedConfigurationSPI.h>
 
 namespace WebKit {
 
@@ -41,6 +43,11 @@
 
 #endif
 
+bool allowsDeprecatedSynchronousXMLHttpRequestDuringUnload()
+{
+    return [[PAL::getMCProfileConnectionClass() sharedConnection] effectiveBoolValueForSetting:@"allowDeprecatedWebKitSynchronousXHRLoads"] == MCRestrictedBoolExplicitYes;
+}
+
 } // namespace WebKit
 
 #endif // PLATFORM(IOS_FAMILY)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to