Skip to content

Commit

Permalink
Remove FetchAPIKeepAliveEnabled preference
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=264154
rdar://117903614

Reviewed by Brent Fulgham.

This has been enabled since 2019. Remove quite a bit of cruft and
deprecate the parts that might have an external dependency.

* LayoutTests/http/wpt/beacon/beacon-legacy-code-path-expected.txt: Removed.
* LayoutTests/http/wpt/beacon/beacon-legacy-code-path.html: Removed.
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/Modules/fetch/FetchRequest.idl:
* Source/WebCore/page/DeprecatedGlobalSettings.h:
(WebCore::DeprecatedGlobalSettings::fetchAPIKeepAliveEnabled): Deleted.
(WebCore::DeprecatedGlobalSettings::setFetchAPIKeepAliveEnabled): Deleted.
* Source/WebCore/testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setFetchAPIKeepAliveEnabled): Deleted.
* Source/WebCore/testing/InternalSettings.h:
* Source/WebCore/testing/InternalSettings.idl:
* Source/WebKit/UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetFetchAPIKeepAliveEnabled):
(WKPreferencesGetFetchAPIKeepAliveEnabled):
* Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h:
* Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::usePingLoad const): Deleted.
* Source/WebKit/WebProcess/Network/WebLoaderStrategy.h:
* Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h:
* Source/WebKitLegacy/mac/WebView/WebPreferences.mm:
(-[WebPreferences setFetchAPIKeepAliveEnabled:]):
(-[WebPreferences fetchAPIKeepAliveEnabled]):
* Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h:

Canonical link: https://commits.webkit.org/270198@main
  • Loading branch information
annevk committed Nov 3, 2023
1 parent 2e41d88 commit 97076b3
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 104 deletions.

This file was deleted.

36 changes: 0 additions & 36 deletions LayoutTests/http/wpt/beacon/beacon-legacy-code-path.html

This file was deleted.

15 changes: 0 additions & 15 deletions Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2644,21 +2644,6 @@ FasterClicksEnabled:
WebKit:
default: true

# FIXME: This seems to be accidentally enabled for WebKit1 right now due to the old code using the
# wrong preference key in some places. We should identify whether it really makes sense to keep this
# enabled.
FetchAPIKeepAliveEnabled:
type: bool
status: mature
humanReadableName: "Fetch API Request KeepAlive"
humanReadableDescription: "Enable Fetch API Request KeepAlive"
webcoreBinding: DeprecatedGlobalSettings
defaultValue:
WebKitLegacy:
default: true
WebKit:
default: true

FetchMetadataEnabled:
type: bool
status: stable
Expand Down
2 changes: 1 addition & 1 deletion Source/WebCore/Modules/fetch/FetchRequest.idl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ typedef (FetchRequest or USVString) RequestInfo;
readonly attribute FetchRequestCache cache;
readonly attribute FetchRequestRedirect redirect;
readonly attribute DOMString integrity;
[EnabledByDeprecatedGlobalSetting=FetchAPIKeepAliveEnabled] readonly attribute boolean keepalive;
readonly attribute boolean keepalive;
// FIXME: Implement 'isReloadNavigation'.
// readonly attribute boolean isReloadNavigation;
// FIXME: Implement 'isHistoryNavigation'.
Expand Down
4 changes: 0 additions & 4 deletions Source/WebCore/page/DeprecatedGlobalSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ class DeprecatedGlobalSettings {
static void setCustomPasteboardDataEnabled(bool isEnabled) { shared().m_isCustomPasteboardDataEnabled = isEnabled; }
static bool customPasteboardDataEnabled() { return shared().m_isCustomPasteboardDataEnabled; }

static bool fetchAPIKeepAliveEnabled() { return shared().m_fetchAPIKeepAliveEnabled; }
static void setFetchAPIKeepAliveEnabled(bool isEnabled) { shared().m_fetchAPIKeepAliveEnabled = isEnabled; }

static void setRestrictedHTTPResponseAccess(bool isEnabled) { shared().m_isRestrictedHTTPResponseAccess = isEnabled; }
static bool restrictedHTTPResponseAccess() { return shared().m_isRestrictedHTTPResponseAccess; }

Expand Down Expand Up @@ -213,7 +210,6 @@ class DeprecatedGlobalSettings {
bool m_isPaintTimingEnabled { false };

bool m_isCustomPasteboardDataEnabled { false };
bool m_fetchAPIKeepAliveEnabled { false };
bool m_isRestrictedHTTPResponseAccess { true };
bool m_isServerTimingEnabled { false };
bool m_attrStyleEnabled { false };
Expand Down
10 changes: 0 additions & 10 deletions Source/WebCore/testing/InternalSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ InternalSettings::Backup::Backup(Settings& settings)
, m_forcedPrefersContrastAccessibilityValue(settings.forcedPrefersContrastAccessibilityValue())
, m_forcedPrefersReducedMotionAccessibilityValue(settings.forcedPrefersReducedMotionAccessibilityValue())
, m_fontLoadTimingOverride(settings.fontLoadTimingOverride())
, m_fetchAPIKeepAliveAPIEnabled(DeprecatedGlobalSettings::fetchAPIKeepAliveEnabled())
, m_customPasteboardDataEnabled(DeprecatedGlobalSettings::customPasteboardDataEnabled())
, m_originalMockScrollbarsEnabled(DeprecatedGlobalSettings::mockScrollbarsEnabled())
#if USE(AUDIO_SESSION)
Expand Down Expand Up @@ -113,7 +112,6 @@ void InternalSettings::Backup::restoreTo(Settings& settings)
settings.setForcedPrefersReducedMotionAccessibilityValue(m_forcedPrefersReducedMotionAccessibilityValue);
settings.setFontLoadTimingOverride(m_fontLoadTimingOverride);

DeprecatedGlobalSettings::setFetchAPIKeepAliveEnabled(m_fetchAPIKeepAliveAPIEnabled);
DeprecatedGlobalSettings::setCustomPasteboardDataEnabled(m_customPasteboardDataEnabled);

#if USE(AUDIO_SESSION)
Expand Down Expand Up @@ -407,14 +405,6 @@ void InternalSettings::setForcedSupportsHighDynamicRangeValue(InternalSettings::
settings().setForcedSupportsHighDynamicRangeValue(value);
}

ExceptionOr<void> InternalSettings::setFetchAPIKeepAliveEnabled(bool enabled)
{
if (!m_page)
return Exception { InvalidAccessError };
DeprecatedGlobalSettings::setFetchAPIKeepAliveEnabled(enabled);
return { };
}

bool InternalSettings::vp9DecoderEnabled() const
{
#if ENABLE(VP9)
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/testing/InternalSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ class InternalSettings : public InternalSettingsGenerated {
ExceptionOr<void> setAllowAnimationControlsOverride(bool);

// DeprecatedGlobalSettings.
ExceptionOr<void> setFetchAPIKeepAliveEnabled(bool);
ExceptionOr<void> setCustomPasteboardDataEnabled(bool);

bool vp9DecoderEnabled() const;
Expand Down Expand Up @@ -156,7 +155,6 @@ class InternalSettings : public InternalSettingsGenerated {
WebCore::FontLoadTimingOverride m_fontLoadTimingOverride;

// DeprecatedGlobalSettings
bool m_fetchAPIKeepAliveAPIEnabled;
bool m_customPasteboardDataEnabled;
bool m_originalMockScrollbarsEnabled;
#if USE(AUDIO_SESSION)
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/testing/InternalSettings.idl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ enum UserInterfaceDirectionPolicy { "Content", "System" };
attribute ForcedAccessibilityValue forcedSupportsHighDynamicRangeValue;

// DeprecatedGlobalSettings.
undefined setFetchAPIKeepAliveEnabled(boolean enabled);
undefined setCustomPasteboardDataEnabled(boolean enabled);

readonly attribute boolean vp9DecoderEnabled;
Expand Down
19 changes: 9 additions & 10 deletions Source/WebKit/UIProcess/API/C/WKPreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1586,16 +1586,6 @@ WK_EXPORT bool WKPreferencesGetIsAccessibilityIsolatedTreeEnabled(WKPreferencesR
return toImpl(preferencesRef)->isAccessibilityIsolatedTreeEnabled();
}

void WKPreferencesSetFetchAPIKeepAliveEnabled(WKPreferencesRef preferencesRef, bool flag)
{
toImpl(preferencesRef)->setFetchAPIKeepAliveEnabled(flag);
}

bool WKPreferencesGetFetchAPIKeepAliveEnabled(WKPreferencesRef preferencesRef)
{
return toImpl(preferencesRef)->fetchAPIKeepAliveEnabled();
}

void WKPreferencesSetAllowsPictureInPictureMediaPlayback(WKPreferencesRef preferencesRef, bool enabled)
{
toImpl(preferencesRef)->setAllowsPictureInPictureMediaPlayback(enabled);
Expand Down Expand Up @@ -2000,6 +1990,15 @@ bool WKPreferencesGetFetchAPIEnabled(WKPreferencesRef)
return true;
}

void WKPreferencesSetFetchAPIKeepAliveEnabled(WKPreferencesRef preferencesRef, bool)
{
}

bool WKPreferencesGetFetchAPIKeepAliveEnabled(WKPreferencesRef)
{
return true;
}

void WKPreferencesSetIsSecureContextAttributeEnabled(WKPreferencesRef, bool)
{
}
Expand Down
6 changes: 2 additions & 4 deletions Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,6 @@ WK_EXPORT bool WKPreferencesGetWebShareEnabled(WKPreferencesRef);
WK_EXPORT void WKPreferencesSetPaintTimingEnabled(WKPreferencesRef, bool flag);
WK_EXPORT bool WKPreferencesGetPaintTimingEnabled(WKPreferencesRef);

// Defaults to false
WK_EXPORT void WKPreferencesSetFetchAPIKeepAliveEnabled(WKPreferencesRef, bool flag);
WK_EXPORT bool WKPreferencesGetFetchAPIKeepAliveEnabled(WKPreferencesRef);

// Defaults to false
WK_EXPORT void WKPreferencesSetWebRTCPlatformCodecsInGPUProcessEnabled(WKPreferencesRef, bool flag);
WK_EXPORT bool WKPreferencesGetWebRTCPlatformCodecsInGPUProcessEnabled(WKPreferencesRef);
Expand Down Expand Up @@ -533,6 +529,8 @@ WK_EXPORT void WKPreferencesSetHixie76WebSocketProtocolEnabled(WKPreferencesRef,
WK_EXPORT bool WKPreferencesGetHixie76WebSocketProtocolEnabled(WKPreferencesRef) WK_C_API_DEPRECATED;
WK_EXPORT void WKPreferencesSetFetchAPIEnabled(WKPreferencesRef, bool) WK_C_API_DEPRECATED;
WK_EXPORT bool WKPreferencesGetFetchAPIEnabled(WKPreferencesRef) WK_C_API_DEPRECATED;
WK_EXPORT void WKPreferencesSetFetchAPIKeepAliveEnabled(WKPreferencesRef, bool) WK_C_API_DEPRECATED;
WK_EXPORT bool WKPreferencesGetFetchAPIKeepAliveEnabled(WKPreferencesRef) WK_C_API_DEPRECATED;
WK_EXPORT void WKPreferencesSetIsSecureContextAttributeEnabled(WKPreferencesRef, bool) WK_C_API_DEPRECATED;
WK_EXPORT bool WKPreferencesGetIsSecureContextAttributeEnabled(WKPreferencesRef) WK_C_API_DEPRECATED;
WK_EXPORT void WKPreferencesSetUserTimingEnabled(WKPreferencesRef, bool) WK_C_API_DEPRECATED;
Expand Down
5 changes: 0 additions & 5 deletions Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,11 +807,6 @@ void WebLoaderStrategy::browsingContextRemoved(LocalFrame& frame)
networkProcessConnection->connection().send(Messages::NetworkConnectionToWebProcess::BrowsingContextRemoved(page.webPageProxyIdentifier(), page.identifier(), WebFrame::fromCoreFrame(frame)->frameID()), 0);
}

bool WebLoaderStrategy::usePingLoad() const
{
return !DeprecatedGlobalSettings::fetchAPIKeepAliveEnabled();
}

void WebLoaderStrategy::startPingLoad(LocalFrame& frame, ResourceRequest& request, const HTTPHeaderMap& originalRequestHeaders, const FetchOptions& options, ContentSecurityPolicyImposition policyCheck, PingLoadCompletionHandler&& completionHandler)
{
auto webFrame = WebFrame::fromCoreFrame(frame);
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/WebProcess/Network/WebLoaderStrategy.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class WebLoaderStrategy final : public WebCore::LoaderStrategy {
void suspendPendingRequests() final;
void resumePendingRequests() final;

bool usePingLoad() const final;
bool usePingLoad() const final { return false; }
void startPingLoad(WebCore::LocalFrame&, WebCore::ResourceRequest&, const WebCore::HTTPHeaderMap& originalRequestHeaders, const WebCore::FetchOptions&, WebCore::ContentSecurityPolicyImposition, PingLoadCompletionHandler&&) final;
void didFinishPingLoad(WebCore::ResourceLoaderIdentifier pingLoadIdentifier, WebCore::ResourceError&&, WebCore::ResourceResponse&&);

Expand Down
2 changes: 1 addition & 1 deletion Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@
#define WebKitCSSCustomPropertiesAndValuesEnabledPreferenceKey @"WebKitCSSCustomPropertiesAndValuesEnabled"
#define WebKitResizeObserverEnabledPreferenceKey @"WebKitResizeObserverEnabled"
#define WebKitPrivateClickMeasurementEnabledPreferenceKey @"WebKitPrivateClickMeasurementEnabled"
#define WebKitFetchAPIKeepAliveEnabledPreferenceKey @"WebKitFetchAPIKeepAliveEnabled"
#define WebKitGenericCueAPIEnabledKey @"WebKitGenericCueAPIEnabled"
#define WebKitAspectRatioOfImgFromWidthAndHeightEnabledPreferenceKey @"WebKitAspectRatioOfImgFromWidthAndHeightEnabled"
#define WebKitCoreMathMLEnabledPreferenceKey @"WebKitCoreMathMLEnabled"
Expand All @@ -269,6 +268,7 @@
#define WebKitHixie76WebSocketProtocolEnabledKey @"WebKitHixie76WebSocketProtocolEnabled"
#define WebKitCustomElementsEnabledPreferenceKey @"WebKitCustomElementsEnabled"
#define WebKitFetchAPIEnabledPreferenceKey @"WebKitFetchAPIEnabled"
#define WebKitFetchAPIKeepAliveEnabledPreferenceKey @"WebKitFetchAPIKeepAliveEnabled"
#define WebKitIsSecureContextAttributeEnabledPreferenceKey @"WebKitIsSecureContextAttributeEnabled"
#define WebKitCSSShadowPartsEnabledPreferenceKey @"WebKitCSSShadowPartsEnabled"
#define WebKitSubpixelCSSOMElementMetricsEnabledPreferenceKey @"WebKitSubpixelCSSOMElementMetricsEnabled"
Expand Down
19 changes: 9 additions & 10 deletions Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3026,16 +3026,6 @@ - (void)setPrivateClickMeasurementEnabled:(BOOL)flag
[self _setBoolValue:flag forKey:WebKitPrivateClickMeasurementEnabledPreferenceKey];
}

- (BOOL)fetchAPIKeepAliveEnabled
{
return [self _boolValueForKey:WebKitFetchAPIEnabledPreferenceKey];
}

- (void)setFetchAPIKeepAliveEnabled:(BOOL)flag
{
[self _setBoolValue:flag forKey:WebKitFetchAPIEnabledPreferenceKey];
}

- (BOOL)genericCueAPIEnabled
{
return [self _boolValueForKey:WebKitGenericCueAPIEnabledKey];
Expand Down Expand Up @@ -3217,6 +3207,15 @@ - (BOOL)fetchAPIEnabled
return YES;
}

- (void)setFetchAPIKeepAliveEnabled:(BOOL)flag
{
}

- (BOOL)fetchAPIKeepAliveEnabled
{
return YES;
}

- (void)setShadowDOMEnabled:(BOOL)flag
{
}
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR
@property (nonatomic) BOOL CSSCustomPropertiesAndValuesEnabled;
@property (nonatomic) BOOL resizeObserverEnabled;
@property (nonatomic) BOOL privateClickMeasurementEnabled;
@property (nonatomic) BOOL fetchAPIKeepAliveEnabled;
@property (nonatomic) BOOL genericCueAPIEnabled;
@property (nonatomic) BOOL aspectRatioOfImgFromWidthAndHeightEnabled;
@property (nonatomic) BOOL coreMathMLEnabled;
Expand All @@ -342,6 +341,7 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR
@property (nonatomic, getter=cssShadowPartsEnabled) BOOL CSSShadowPartsEnabled;
@property (nonatomic) BOOL isSecureContextAttributeEnabled;
@property (nonatomic) BOOL fetchAPIEnabled;
@property (nonatomic) BOOL fetchAPIKeepAliveEnabled;
@property (nonatomic) BOOL shadowDOMEnabled;
@property (nonatomic) BOOL customElementsEnabled;
@property (nonatomic) BOOL keygenElementEnabled;
Expand Down

0 comments on commit 97076b3

Please sign in to comment.