[WPE] don't put page with multimedia to bfCache on low-end devices#1698
Open
pgorszkowski-igalia wants to merge 1 commit into
Conversation
https://bugs.webkit.org/show_bug.cgi?id=318851 Reviewed by Alicia Boya Garcia. Add a new WPE-only feature `BackForwardCacheWithMediaEnabled` that allows applications to control whether pages containing audio or video elements can be placed in the back/forward cache. When disabled, pages with media elements are excluded from the back/forward cache. This is particularly useful on low-end embedded devices with a limited number of hardware decoders, where keeping a suspended media pipeline alive in the cache may prevent other pages from acquiring the decoder. The feature is enabled by default (preserving existing behavior). Two new WPE layout tests verify the behavior: - page-cache-video-media-disabled.html: verifies pages with media are not cached when the feature is disabled. - page-cache-video-media-enabled.html: verifies pages with media can enter and be restored from the back/forward cache when the feature is enabled. Tests: platform/wpe/fast/history/page-cache-video-media-disabled.html platform/wpe/fast/history/page-cache-video-media-enabled.html * LayoutTests/platform/wpe/fast/history/page-cache-video-media-disabled-expected.txt: Added. * LayoutTests/platform/wpe/fast/history/page-cache-video-media-disabled.html: Added. * LayoutTests/platform/wpe/fast/history/page-cache-video-media-enabled-expected.txt: Added. * LayoutTests/platform/wpe/fast/history/page-cache-video-media-enabled.html: Added. * LayoutTests/platform/wpe/fast/history/resources/page-cache-helper.html: Added. * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebCore/history/BackForwardCache.cpp: (WebCore::canCachePage): Canonical link: https://commits.webkit.org/316840@main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://bugs.webkit.org/show_bug.cgi?id=318851
Reviewed by Alicia Boya Garcia.
Add a new WPE-only feature
BackForwardCacheWithMediaEnabledthat allows applications to control whether pages containing audio or video elements can be placed in the back/forward cache.When disabled, pages with media elements are excluded from the back/forward cache. This is particularly useful on low-end embedded devices with a limited number of hardware decoders, where keeping a suspended media pipeline alive in the cache may prevent other pages from acquiring the decoder.
The feature is enabled by default (preserving existing behavior).
Two new WPE layout tests verify the behavior:
Tests: platform/wpe/fast/history/page-cache-video-media-disabled.html
platform/wpe/fast/history/page-cache-video-media-enabled.html
Canonical link: https://commits.webkit.org/316840@main
5cf00fe