0

Add experimental setup for MultiBufferNeverDefer.

This adds the field trial config and the WebView kill switch.

R=tmathmeyer

Bug: 41161335
Change-Id: I3bd03cdf031cca82517252165681d6e18c320872
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6426623
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Ted (Chromium) Meyer <tmathmeyer@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1442523}
This commit is contained in:
Dale Curtis
2025-04-03 17:51:02 -07:00
committed by Chromium LUCI CQ
parent 287fa97d65
commit 1bf7cd5ce6
5 changed files with 34 additions and 9 deletions
android_webview/java/src/org/chromium/android_webview/common
media/base
testing/variations
third_party/blink/renderer/platform/media

@ -1076,6 +1076,9 @@ public final class ProductionSupportedFlagList {
NetworkServiceFeatures.INCREASE_COOKIE_ACCESS_CACHE_SIZE,
"When enabled, keep more cookies in the cache to be able to skip redundant access"
+ " notifications."),
Flag.baseFeature(
MediaFeatures.MULTI_BUFFER_NEVER_DEFER,
"Controls behavior of network deferrals during media src=file playbacks."),
// Add new commandline switches and features above. The final entry should have a
// trailing comma for cleaner diffs.
};

@ -542,6 +542,14 @@ BASE_FEATURE(kMemoryPressureBasedSourceBufferGC,
"MemoryPressureBasedSourceBufferGC",
base::FEATURE_DISABLED_BY_DEFAULT);
// Forces SuggestProviderState() to only suggest deferring when range requests
// aren't supported. Will cause us to buffer up to preload then release the
// loader -- creating a new one to refill beyond the preload amount. Increases
// the number of network connections used during loading, but may prevent hangs.
BASE_FEATURE(kMultiBufferNeverDefer,
"MultiBufferNeverDefer",
base::FEATURE_DISABLED_BY_DEFAULT);
// Controls whether the Mirroring Service will fetch, analyze, and store
// information on the quality of the session using RTCP logs.
BASE_FEATURE(kEnableRtcpReporting,

@ -310,6 +310,7 @@ MEDIA_EXPORT BASE_DECLARE_FEATURE(kMediaLearningSmoothnessExperiment);
MEDIA_EXPORT BASE_DECLARE_FEATURE(kMediaOptimizer);
MEDIA_EXPORT BASE_DECLARE_FEATURE(kMediaPowerExperiment);
MEDIA_EXPORT BASE_DECLARE_FEATURE(kMemoryPressureBasedSourceBufferGC);
MEDIA_EXPORT BASE_DECLARE_FEATURE(kMultiBufferNeverDefer);
MEDIA_EXPORT BASE_DECLARE_FEATURE(kOverlayFullscreenVideo);
MEDIA_EXPORT BASE_DECLARE_FEATURE(kPauseBackgroundMutedAudio);
#if !BUILDFLAG(IS_ANDROID)

@ -15027,6 +15027,26 @@
]
}
],
"MultiBufferNeverDefer": [
{
"platforms": [
"android",
"android_webview",
"chromeos",
"linux",
"mac",
"windows"
],
"experiments": [
{
"name": "Enabled",
"enable_features": [
"MultiBufferNeverDefer"
]
}
]
}
],
"MultiCalendarSupport": [
{
"platforms": [

@ -13,20 +13,13 @@
#include "base/memory/raw_ptr.h"
#include "base/not_fatal_until.h"
#include "base/task/single_thread_task_runner.h"
#include "media/base/media_switches.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
namespace blink {
// Forces SuggestProviderState() to only suggest deferring when range requests
// aren't supported. Will cause us to buffer up to preload then release the
// loader -- creating a new one to refill beyond the preload amount. Increases
// the number of network connections used during loading, but may prevent hangs.
BASE_FEATURE(kMultiBufferNeverDefer,
"MultiBufferNeverDefer",
base::FEATURE_DISABLED_BY_DEFAULT);
// Prune 80 blocks per 30 seconds.
// This means a full cache will go away in ~5 minutes.
enum {
@ -379,7 +372,7 @@ MultiBuffer::ProviderState MultiBuffer::SuggestProviderState(
MultiBufferBlockId previous_writer_pos =
ClosestPreviousEntry(writer_index_, pos - 1);
if (previous_writer_pos < previous_reader_pos) {
if (base::FeatureList::IsEnabled(kMultiBufferNeverDefer) &&
if (base::FeatureList::IsEnabled(media::kMultiBufferNeverDefer) &&
RangeSupported()) {
return ProviderStateDead;
}