Title: [293604] trunk/Source
Revision
293604
Author
[email protected]
Date
2022-04-28 19:24:50 -0700 (Thu, 28 Apr 2022)

Log Message

Remove the AVFoundationNSURLSessionEnabled preference
https://bugs.webkit.org/show_bug.cgi?id=239632

Reviewed by Eric Carlson.

All supported operating systems have supported AVFoundationNSURLSession
for several years. Since we expect AVFoundation to always use WebKit
for network loading (and indeed, expect improper behavior if we do not)
we should remove this toggle to simplify the code and reduce the chance
for users to mistakenly activate it.

Source/WebCore:

* page/DeprecatedGlobalSettings.cpp:
(WebCore::DeprecatedGlobalSettings::setAVFoundationEnabled):
(WebCore::DeprecatedGlobalSettings::setAVFoundationNSURLSessionEnabled): Deleted.
* page/DeprecatedGlobalSettings.h:
(WebCore::DeprecatedGlobalSettings::isAVFoundationEnabled):
(WebCore::DeprecatedGlobalSettings::isAVFoundationNSURLSessionEnabled): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
(WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):

Source/WebKit:

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetAVFoundationNSURLSessionEnabled):
(WKPreferencesGetAVFoundationNSURLSessionEnabled):
* UIProcess/API/C/WKPreferencesRef.h:

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(-[WebPreferences setAVFoundationNSURLSessionEnabled:]):
(-[WebPreferences isAVFoundationNSURLSessionEnabled]):

Source/WTF:

* Scripts/Preferences/WebPreferences.yaml:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (293603 => 293604)


--- trunk/Source/WTF/ChangeLog	2022-04-29 01:59:02 UTC (rev 293603)
+++ trunk/Source/WTF/ChangeLog	2022-04-29 02:24:50 UTC (rev 293604)
@@ -1,3 +1,18 @@
+2022-04-28  Brent Fulgham  <[email protected]>
+
+        Remove the AVFoundationNSURLSessionEnabled preference
+        https://bugs.webkit.org/show_bug.cgi?id=239632
+
+        Reviewed by Eric Carlson.
+
+        All supported operating systems have supported AVFoundationNSURLSession
+        for several years. Since we expect AVFoundation to always use WebKit
+        for network loading (and indeed, expect improper behavior if we do not)
+        we should remove this toggle to simplify the code and reduce the chance
+        for users to mistakenly activate it.
+
+        * Scripts/Preferences/WebPreferences.yaml:
+
 2022-04-28  Yusuke Suzuki  <[email protected]>
 
         Support C files in Unified Builds

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml (293603 => 293604)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml	2022-04-29 01:59:02 UTC (rev 293603)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml	2022-04-29 02:24:50 UTC (rev 293604)
@@ -33,17 +33,6 @@
       "PLATFORM(WATCHOS)": false
       default: true
 
-AVFoundationNSURLSessionEnabled:
-  type: bool
-  getter: isAVFoundationNSURLSessionEnabled
-  webcoreBinding: DeprecatedGlobalSettings
-  condition: USE(AVFOUNDATION)
-  defaultValue:
-    WebKitLegacy:
-      default: true
-    WebKit:
-      default: true
-
 AcceleratedCompositingEnabled:
   type: bool
   webcoreOnChange: setNeedsRecalcStyleInAllFrames

Modified: trunk/Source/WebCore/ChangeLog (293603 => 293604)


--- trunk/Source/WebCore/ChangeLog	2022-04-29 01:59:02 UTC (rev 293603)
+++ trunk/Source/WebCore/ChangeLog	2022-04-29 02:24:50 UTC (rev 293604)
@@ -1,3 +1,27 @@
+2022-04-28  Brent Fulgham  <[email protected]>
+
+        Remove the AVFoundationNSURLSessionEnabled preference
+        https://bugs.webkit.org/show_bug.cgi?id=239632
+
+        Reviewed by Eric Carlson.
+
+        All supported operating systems have supported AVFoundationNSURLSession
+        for several years. Since we expect AVFoundation to always use WebKit
+        for network loading (and indeed, expect improper behavior if we do not)
+        we should remove this toggle to simplify the code and reduce the chance
+        for users to mistakenly activate it.
+
+        * page/DeprecatedGlobalSettings.cpp:
+        (WebCore::DeprecatedGlobalSettings::setAVFoundationEnabled):
+        (WebCore::DeprecatedGlobalSettings::setAVFoundationNSURLSessionEnabled): Deleted.
+        * page/DeprecatedGlobalSettings.h:
+        (WebCore::DeprecatedGlobalSettings::isAVFoundationEnabled):
+        (WebCore::DeprecatedGlobalSettings::isAVFoundationNSURLSessionEnabled): Deleted.
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck const):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
+
 2022-04-28  Patrick Griffis  <[email protected]>
 
         CSP: Fix mixing strict-dynamic and unsafe-inline policies

Modified: trunk/Source/WebCore/page/DeprecatedGlobalSettings.cpp (293603 => 293604)


--- trunk/Source/WebCore/page/DeprecatedGlobalSettings.cpp	2022-04-29 01:59:02 UTC (rev 293603)
+++ trunk/Source/WebCore/page/DeprecatedGlobalSettings.cpp	2022-04-29 02:24:50 UTC (rev 293604)
@@ -34,7 +34,6 @@
 
 #if USE(AVFOUNDATION)
 bool DeprecatedGlobalSettings::gAVFoundationEnabled = true;
-bool DeprecatedGlobalSettings::gAVFoundationNSURLSessionEnabled = true;
 #endif
 
 #if USE(GSTREAMER)
@@ -74,14 +73,6 @@
     gAVFoundationEnabled = enabled;
     HTMLMediaElement::resetMediaEngines();
 }
-
-void DeprecatedGlobalSettings::setAVFoundationNSURLSessionEnabled(bool enabled)
-{
-    if (gAVFoundationNSURLSessionEnabled == enabled)
-        return;
-
-    gAVFoundationNSURLSessionEnabled = enabled;
-}
 #endif
 
 #if USE(GSTREAMER)

Modified: trunk/Source/WebCore/page/DeprecatedGlobalSettings.h (293603 => 293604)


--- trunk/Source/WebCore/page/DeprecatedGlobalSettings.h	2022-04-29 01:59:02 UTC (rev 293603)
+++ trunk/Source/WebCore/page/DeprecatedGlobalSettings.h	2022-04-29 02:24:50 UTC (rev 293604)
@@ -42,8 +42,6 @@
 #if USE(AVFOUNDATION)
     WEBCORE_EXPORT static void setAVFoundationEnabled(bool flag);
     static bool isAVFoundationEnabled() { return gAVFoundationEnabled; }
-    WEBCORE_EXPORT static void setAVFoundationNSURLSessionEnabled(bool flag);
-    static bool isAVFoundationNSURLSessionEnabled() { return gAVFoundationNSURLSessionEnabled; }
 #endif
 
 #if USE(GSTREAMER)
@@ -91,7 +89,6 @@
 private:
 #if USE(AVFOUNDATION)
     WEBCORE_EXPORT static bool gAVFoundationEnabled;
-    WEBCORE_EXPORT static bool gAVFoundationNSURLSessionEnabled;
 #endif
 
 #if USE(GSTREAMER)

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (293603 => 293604)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2022-04-29 01:59:02 UTC (rev 293603)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2022-04-29 02:24:50 UTC (rev 293604)
@@ -1008,14 +1008,8 @@
     AVAssetResourceLoader *resourceLoader = m_avAsset.get().resourceLoader;
     [resourceLoader setDelegate:m_loaderDelegate.get() queue:globalLoaderDelegateQueue()];
 
-    if (DeprecatedGlobalSettings::isAVFoundationNSURLSessionEnabled()
-        && [resourceLoader respondsToSelector:@selector(setURLSession:)]
-        && [resourceLoader respondsToSelector:@selector(URLSessionDataDelegate)]
-        && [resourceLoader respondsToSelector:@selector(URLSessionDataDelegateQueue)]) {
-        RefPtr<PlatformMediaResourceLoader> mediaResourceLoader = player()->createResourceLoader();
-        if (mediaResourceLoader)
-            resourceLoader.URLSession = (NSURLSession *)adoptNS([[WebCoreNSURLSession alloc] initWithResourceLoader:*mediaResourceLoader delegate:resourceLoader.URLSessionDataDelegate delegateQueue:resourceLoader.URLSessionDataDelegateQueue]).get();
-    }
+    if (auto mediaResourceLoader = player()->createResourceLoader())
+        resourceLoader.URLSession = (NSURLSession *)adoptNS([[WebCoreNSURLSession alloc] initWithResourceLoader:*mediaResourceLoader delegate:resourceLoader.URLSessionDataDelegate delegateQueue:resourceLoader.URLSessionDataDelegateQueue]).get();
 
     [[NSNotificationCenter defaultCenter] addObserver:m_objcObserver.get() selector:@selector(chapterMetadataDidChange:) name:AVAssetChapterMetadataGroupsDidChangeNotification object:m_avAsset.get()];
 
@@ -2582,10 +2576,6 @@
 bool MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck() const
 {
     AVAssetResourceLoader *resourceLoader = m_avAsset.get().resourceLoader;
-    if (!DeprecatedGlobalSettings::isAVFoundationNSURLSessionEnabled()
-        || ![resourceLoader respondsToSelector:@selector(URLSession)])
-        return false;
-
     WebCoreNSURLSession *session = (WebCoreNSURLSession *)resourceLoader.URLSession;
     if ([session isKindOfClass:[WebCoreNSURLSession class]])
         return session.didPassCORSAccessChecks;
@@ -2596,10 +2586,6 @@
 std::optional<bool> MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin(const SecurityOrigin& origin) const
 {
     AVAssetResourceLoader *resourceLoader = m_avAsset.get().resourceLoader;
-    if (!DeprecatedGlobalSettings::isAVFoundationNSURLSessionEnabled()
-        || ![resourceLoader respondsToSelector:@selector(URLSession)])
-        return false;
-
     WebCoreNSURLSession *session = (WebCoreNSURLSession *)resourceLoader.URLSession;
     if ([session isKindOfClass:[WebCoreNSURLSession class]])
         return [session wouldTaintOrigin:origin];

Modified: trunk/Source/WebKit/ChangeLog (293603 => 293604)


--- trunk/Source/WebKit/ChangeLog	2022-04-29 01:59:02 UTC (rev 293603)
+++ trunk/Source/WebKit/ChangeLog	2022-04-29 02:24:50 UTC (rev 293604)
@@ -1,3 +1,21 @@
+2022-04-28  Brent Fulgham  <[email protected]>
+
+        Remove the AVFoundationNSURLSessionEnabled preference
+        https://bugs.webkit.org/show_bug.cgi?id=239632
+
+        Reviewed by Eric Carlson.
+
+        All supported operating systems have supported AVFoundationNSURLSession
+        for several years. Since we expect AVFoundation to always use WebKit
+        for network loading (and indeed, expect improper behavior if we do not)
+        we should remove this toggle to simplify the code and reduce the chance
+        for users to mistakenly activate it.
+
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetAVFoundationNSURLSessionEnabled):
+        (WKPreferencesGetAVFoundationNSURLSessionEnabled):
+        * UIProcess/API/C/WKPreferencesRef.h:
+
 2022-04-28  Yusuke Suzuki  <[email protected]>
 
         Support C files in Unified Builds

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp (293603 => 293604)


--- trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2022-04-29 01:59:02 UTC (rev 293603)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2022-04-29 02:24:50 UTC (rev 293604)
@@ -674,16 +674,6 @@
     return toImpl(preferencesRef)->isAVFoundationEnabled();
 }
 
-void WKPreferencesSetAVFoundationNSURLSessionEnabled(WKPreferencesRef preferencesRef, bool enabled)
-{
-    toImpl(preferencesRef)->setAVFoundationNSURLSessionEnabled(enabled);
-}
-
-bool WKPreferencesGetAVFoundationNSURLSessionEnabled(WKPreferencesRef preferencesRef)
-{
-    return toImpl(preferencesRef)->isAVFoundationNSURLSessionEnabled();
-}
-
 void WKPreferencesSetWebSecurityEnabled(WKPreferencesRef preferencesRef, bool enabled)
 {
     toImpl(preferencesRef)->setWebSecurityEnabled(enabled);
@@ -2038,6 +2028,15 @@
 
 // The following are all deprecated and do nothing. They should be removed when possible.
 
+void WKPreferencesSetAVFoundationNSURLSessionEnabled(WKPreferencesRef, bool)
+{
+}
+
+bool WKPreferencesGetAVFoundationNSURLSessionEnabled(WKPreferencesRef)
+{
+    return true;
+}
+
 void WKPreferencesSetPrivateBrowsingEnabled(WKPreferencesRef, bool)
 {
 }

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRef.h (293603 => 293604)


--- trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRef.h	2022-04-29 01:59:02 UTC (rev 293603)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRef.h	2022-04-29 02:24:50 UTC (rev 293604)
@@ -191,9 +191,9 @@
 WK_EXPORT void WKPreferencesSetAVFoundationEnabled(WKPreferencesRef preferencesRef, bool enabled);
 WK_EXPORT bool WKPreferencesGetAVFoundationEnabled(WKPreferencesRef preferencesRef);
 
-// Defaults to false.
-WK_EXPORT void WKPreferencesSetAVFoundationNSURLSessionEnabled(WKPreferencesRef preferencesRef, bool enabled);
-WK_EXPORT bool WKPreferencesGetAVFoundationNSURLSessionEnabled(WKPreferencesRef preferencesRef);
+// Obsolete. Always returns true.
+WK_EXPORT void WKPreferencesSetAVFoundationNSURLSessionEnabled(WKPreferencesRef preferencesRef, bool enabled) WK_C_API_DEPRECATED;
+WK_EXPORT bool WKPreferencesGetAVFoundationNSURLSessionEnabled(WKPreferencesRef preferencesRef) WK_C_API_DEPRECATED;
 
 // Defaults to false
 WK_EXPORT void WKPreferencesSetWebAudioEnabled(WKPreferencesRef preferencesRef, bool enabled);

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (293603 => 293604)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2022-04-29 01:59:02 UTC (rev 293603)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2022-04-29 02:24:50 UTC (rev 293604)
@@ -1,3 +1,21 @@
+2022-04-28  Brent Fulgham  <[email protected]>
+
+        Remove the AVFoundationNSURLSessionEnabled preference
+        https://bugs.webkit.org/show_bug.cgi?id=239632
+
+        Reviewed by Eric Carlson.
+
+        All supported operating systems have supported AVFoundationNSURLSession
+        for several years. Since we expect AVFoundation to always use WebKit
+        for network loading (and indeed, expect improper behavior if we do not)
+        we should remove this toggle to simplify the code and reduce the chance
+        for users to mistakenly activate it.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (-[WebPreferences setAVFoundationNSURLSessionEnabled:]):
+        (-[WebPreferences isAVFoundationNSURLSessionEnabled]):
+
 2022-04-26  Manuel Rego Casasnovas  <[email protected]>
 
         Remove AriaReflectionEnabled runtime flag

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h (293603 => 293604)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2022-04-29 01:59:02 UTC (rev 293603)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2022-04-29 02:24:50 UTC (rev 293604)
@@ -123,7 +123,6 @@
 #define WebKitAsynchronousSpellCheckingEnabledPreferenceKey @"WebKitAsynchronousSpellCheckingEnabled"
 #define WebKitHyperlinkAuditingEnabledPreferenceKey @"WebKitHyperlinkAuditingEnabled"
 #define WebKitAVFoundationEnabledKey @"WebKitAVFoundationEnabled"
-#define WebKitAVFoundationNSURLSessionEnabledKey @"WebKitAVFoundationNSURLSessionEnabled"
 #define WebKitRequiresUserGestureForMediaPlaybackPreferenceKey @"WebKitMediaPlaybackRequiresUserGesture"
 #define WebKitRequiresUserGestureForVideoPlaybackPreferenceKey @"WebKitVideoPlaybackRequiresUserGesture"
 #define WebKitRequiresUserGestureForAudioPlaybackPreferenceKey @"WebKitAudioPlaybackRequiresUserGesture"
@@ -290,3 +289,5 @@
 #define WebKitCSSShadowPartsEnabledPreferenceKey @"WebKitCSSShadowPartsEnabled"
 #define WebKitSubpixelCSSOMElementMetricsEnabledPreferenceKey @"WebKitSubpixelCSSOMElementMetricsEnabled"
 #define WebKitExperimentalNotificationsEnabledPreferenceKey @"WebKitExperimentalNotificationsEnabledPreferenceKey"
+#define WebKitXSSAuditorEnabledPreferenceKey @"WebKitXSSAuditorEnabled"
+#define WebKitAVFoundationNSURLSessionEnabledKey @"WebKitAVFoundationNSURLSessionEnabled"

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm (293603 => 293604)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2022-04-29 01:59:02 UTC (rev 293603)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2022-04-29 02:24:50 UTC (rev 293604)
@@ -2009,12 +2009,11 @@
 
 - (void)setAVFoundationNSURLSessionEnabled:(BOOL)flag
 {
-    [self _setBoolValue:flag forKey:WebKitAVFoundationNSURLSessionEnabledKey];
 }
 
 - (BOOL)isAVFoundationNSURLSessionEnabled
 {
-    return [self _boolValueForKey:WebKitAVFoundationNSURLSessionEnabledKey];
+    return YES;
 }
 
 - (BOOL)isInheritURIQueryComponentEnabled
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to