Commit b4a7a0d0 authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Remove Stale while revalidate setting

Now that SWR is shipped for a few releases we can remove the code to
dynamically enable/disable it.

BUG=348877

Change-Id: If708c2ef1c414d6d64c3c0ca93d4845239452562
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1816732Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699343}
parent f0530d1a
......@@ -515,9 +515,6 @@ void SetIndividualRuntimeFeatures(
WebRuntimeFeatures::EnableSkipTouchEventFilter(
base::FeatureList::IsEnabled(features::kSkipTouchEventFilter));
WebRuntimeFeatures::EnableStaleWhileRevalidate(
base::FeatureList::IsEnabled(features::kStaleWhileRevalidate));
if (!base::FeatureList::IsEnabled(features::kSmsReceiver))
WebRuntimeFeatures::EnableSmsReceiver(false);
......
......@@ -525,11 +525,6 @@ const base::Feature kSmsReceiver{"SmsReceiver",
const base::Feature kSpareRendererForSitePerProcess{
"SpareRendererForSitePerProcess", base::FEATURE_ENABLED_BY_DEFAULT};
// Enables StaleWhileRevalidate support.
// https://www.chromestatus.com/features/5050913014153216
const base::Feature kStaleWhileRevalidate{"StaleWhileRevalidate",
base::FEATURE_ENABLED_BY_DEFAULT};
// Enables Storage Pressure notifications and settings pages.
const base::Feature kStoragePressureUI{"StoragePressureUI",
base::FEATURE_DISABLED_BY_DEFAULT};
......
......@@ -118,7 +118,6 @@ CONTENT_EXPORT extern const base::Feature kSignedHTTPExchange;
CONTENT_EXPORT extern const base::Feature kSignedHTTPExchangePingValidity;
CONTENT_EXPORT extern const base::Feature kSmsReceiver;
CONTENT_EXPORT extern const base::Feature kSpareRendererForSitePerProcess;
CONTENT_EXPORT extern const base::Feature kStaleWhileRevalidate;
CONTENT_EXPORT extern const base::Feature kStoragePressureUI;
CONTENT_EXPORT extern const base::Feature kStrictOriginIsolation;
CONTENT_EXPORT extern const base::Feature kSyntheticPointerActions;
......
......@@ -235,7 +235,6 @@ class WebRuntimeFeatures {
bool);
BLINK_PLATFORM_EXPORT static void EnableIdleDetection(bool);
BLINK_PLATFORM_EXPORT static void EnableSkipTouchEventFilter(bool);
BLINK_PLATFORM_EXPORT static void EnableStaleWhileRevalidate(bool);
BLINK_PLATFORM_EXPORT static void EnableSmsReceiver(bool);
BLINK_PLATFORM_EXPORT static void EnableDisplayLocking(bool);
BLINK_PLATFORM_EXPORT static void
......
......@@ -1637,10 +1637,6 @@ void DocumentLoader::InstallNewDocument(
OriginTrialContext::ActivateNavigationFeaturesFromInitiator(
document, &initiator_origin_trial_features_);
}
bool stale_while_revalidate_enabled =
RuntimeEnabledFeatures::StaleWhileRevalidateEnabled(document);
document->Fetcher()->SetStaleWhileRevalidateEnabled(
stale_while_revalidate_enabled);
bool opted_out_mixed_autoupgrade = EqualIgnoringASCIICase(
response_.HttpHeaderField("mixed-content"), "noupgrade");
......@@ -1651,11 +1647,6 @@ void DocumentLoader::InstallNewDocument(
UMA_HISTOGRAM_BOOLEAN("MixedAutoupgrade.Navigation.OptedOut",
opted_out_mixed_autoupgrade);
// If stale while revalidate is enabled via Origin Trials count it as such.
if (stale_while_revalidate_enabled &&
!RuntimeEnabledFeatures::StaleWhileRevalidateEnabledByRuntimeFlag())
UseCounter::Count(document, WebFeature::kStaleWhileRevalidateEnabled);
parser_ = document->OpenForNavigation(parsing_policy, mime_type, encoding);
// If this is a scriptable parser and there is a resource, register the
......
......@@ -668,10 +668,6 @@ void WebRuntimeFeatures::EnableSkipTouchEventFilter(bool enable) {
RuntimeEnabledFeatures::SetSkipTouchEventFilterEnabled(enable);
}
void WebRuntimeFeatures::EnableStaleWhileRevalidate(bool enable) {
RuntimeEnabledFeatures::SetStaleWhileRevalidateEnabled(enable);
}
void WebRuntimeFeatures::EnableSmsReceiver(bool enable) {
RuntimeEnabledFeatures::SetSmsReceiverEnabled(enable);
}
......
......@@ -573,8 +573,6 @@ ResourceFetcher::ResourceFetcher(const ResourceFetcherInit& init)
allow_stale_resources_(false),
image_fetched_(false),
should_log_request_as_invalid_in_imported_document_(false) {
stale_while_revalidate_enabled_ =
RuntimeEnabledFeatures::StaleWhileRevalidateEnabledByRuntimeFlag();
InstanceCounters::IncrementCounter(InstanceCounters::kResourceFetcherCounter);
if (IsMainThread())
MainThreadFetchersSet().insert(this);
......@@ -871,8 +869,7 @@ base::Optional<ResourceRequestBlockedReason> ResourceFetcher::PrepareRequest(
// stale resource is returned a StaleRevalidation request will be scheduled.
// Explicitly disallow stale responses for fetchers that don't have SWR
// enabled (via origin trial), and non-GET requests.
resource_request.SetAllowStaleResponse(stale_while_revalidate_enabled_ &&
resource_request.HttpMethod() ==
resource_request.SetAllowStaleResponse(resource_request.HttpMethod() ==
http_names::kGET &&
!params.IsStaleRevalidation());
......@@ -2075,10 +2072,6 @@ void ResourceFetcher::PrepareForLeakDetection() {
StopFetchingIncludingKeepaliveLoaders();
}
void ResourceFetcher::SetStaleWhileRevalidateEnabled(bool enabled) {
stale_while_revalidate_enabled_ = enabled;
}
void ResourceFetcher::StopFetchingInternal(StopFetchingTarget target) {
// TODO(toyoshim): May want to suspend scheduler while canceling loaders so
// that the cancellations below do not awake unnecessary scheduling.
......
......@@ -244,8 +244,6 @@ class PLATFORM_EXPORT ResourceFetcher
// counting.
void PrepareForLeakDetection();
void SetStaleWhileRevalidateEnabled(bool enabled);
using ResourceFetcherSet = HeapHashSet<WeakMember<ResourceFetcher>>;
static const ResourceFetcherSet& MainThreadFetchers();
......
......@@ -945,7 +945,6 @@ TEST_F(ResourceFetcherTest, StaleWhileRevalidate) {
EXPECT_TRUE(resource->IsLoaded());
EXPECT_TRUE(GetMemoryCache()->Contains(resource));
fetcher->SetStaleWhileRevalidateEnabled(true);
ResourceRequest resource_request(url);
resource_request.SetRequestContext(mojom::RequestContextType::INTERNAL);
fetch_params = FetchParameters(resource_request);
......
......@@ -1564,11 +1564,6 @@
name: "StackedCSSPropertyAnimations",
status: "experimental",
},
{
name: "StaleWhileRevalidate",
origin_trial_feature_name: "StaleWhileRevalidate",
status: "stable",
},
{
// Enabled when blink::features::kStorageAccessAPI is enabled.
name: "StorageAccessAPI",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment