Avoid using the default feature param when the feature is disabled
This CL is a follow up CL of https://crrev.com/c/3781826.
GetLazyAdsSkipFrameCount() and GetLazyEmbedsSkipFrameCount() started
checking if these are not called when the features are disabled. This CL
applies the same check to GetLazyEmbedsTimeoutMs() and
GetLazyAdsTimeoutMs().
Bug: 1346532
Change-Id: Ie5a1069655b5f9ad4c4ac896c29c50953e3b5aa8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3780335
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Commit-Queue: Minoru Chikamune <chikamune@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1030379}
diff --git a/third_party/blink/renderer/core/html/html_frame_owner_element.cc b/third_party/blink/renderer/core/html/html_frame_owner_element.cc
index 67f79dd..d6159549 100644
--- a/third_party/blink/renderer/core/html/html_frame_owner_element.cc
+++ b/third_party/blink/renderer/core/html/html_frame_owner_element.cc
@@ -316,21 +316,16 @@
}
const base::TimeDelta GetLazyEmbedsTimeoutMs() {
- if (!base::FeatureList::IsEnabled(
- features::kAutomaticLazyFrameLoadingToEmbeds)) {
- return base::Milliseconds(
- features::kTimeoutMillisForLazyEmbeds.default_value);
- }
-
+ DCHECK(base::FeatureList::IsEnabled(
+ features::kAutomaticLazyFrameLoadingToEmbeds));
static const base::TimeDelta timeout_ms =
base::Milliseconds(features::kTimeoutMillisForLazyEmbeds.Get());
return timeout_ms;
}
const base::TimeDelta GetLazyAdsTimeoutMs() {
- if (!base::FeatureList::IsEnabled(features::kAutomaticLazyFrameLoadingToAds))
- return base::Milliseconds(features::kTimeoutMillisForLazyAds.default_value);
-
+ DCHECK(
+ base::FeatureList::IsEnabled(features::kAutomaticLazyFrameLoadingToAds));
static const base::TimeDelta timeout_ms =
base::Milliseconds(features::kTimeoutMillisForLazyAds.Get());
return timeout_ms;