Commit 0b311afc authored by Sophie Chang's avatar Sophie Chang Committed by Commit Bot

Log correct metrics if there is info in host cache and no store

This was potentially falling back to hint still being fetched if URL
hint hadn't arrived yet

Bug: 1112500
Change-Id: I0307f41f1b49a6901eef48b522dfefe0546f6139
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2369264Reviewed-by: default avatarMichael Crouse <mcrouse@chromium.org>
Commit-Queue: Sophie Chang <sophiechang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800752}
parent c5b505f1
......@@ -1132,13 +1132,16 @@ OptimizationGuideHintsManager::CanApplyOptimization(
const optimization_guide::proto::Hint* loaded_hint =
hint_cache_->GetHostKeyedHintIfLoaded(host);
if (!loaded_hint) {
// If we do not have a hint already loaded and we do not have one in the
// cache, we do not know what to do with the URL so just return.
// Otherwise, we do have information, but we just do not know it yet.
if (optimization_guide::features::ShouldPersistHintsToDisk() &&
hint_cache_->HasHint(host)) {
return optimization_guide::OptimizationTypeDecision::
kHadHintButNotLoadedInTime;
if (hint_cache_->HasHint(host)) {
// If we do not have a hint already loaded and we do not have one in the
// cache, we do not know what to do with the URL so just return.
// Otherwise, we do have information, but we just do not know it yet.
if (optimization_guide::features::ShouldPersistHintsToDisk()) {
return optimization_guide::OptimizationTypeDecision::
kHadHintButNotLoadedInTime;
} else {
return optimization_guide::OptimizationTypeDecision::kNoHintAvailable;
}
}
if (IsHintBeingFetchedForNavigation(navigation_url)) {
......
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