Commit bbe8da9b authored by Viktor Semeniuk's avatar Viktor Semeniuk Committed by Commit Bot

Add condition to avoid prefetching a change password URL if already available.

This CL adds a condition to avoid prefetching a change password URL for requested facet, if Affiliation Service already stores data for this facet from previous prefetch. The change affects WellKnownChangePasswordNavigationThrottle and saves time that would be spent on unnecessary prefetch.

Bug: 1108279
Change-Id: Idcab44f3a6a277298c97a0fdde6c6f6e88f40cec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2443655
Commit-Queue: Viktor Semeniuk <vsemeniuk@google.com>
Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825286}
parent cdf050f6
...@@ -117,8 +117,10 @@ WellKnownChangePasswordNavigationThrottle:: ...@@ -117,8 +117,10 @@ WellKnownChangePasswordNavigationThrottle::
affiliation_service_ = affiliation_service_ =
AffiliationServiceFactory::GetForProfile(Profile::FromBrowserContext( AffiliationServiceFactory::GetForProfile(Profile::FromBrowserContext(
handle->GetWebContents()->GetBrowserContext())); handle->GetWebContents()->GetBrowserContext()));
well_known_change_password_state_.PrefetchChangePasswordURLs( if (affiliation_service_->GetChangePasswordURL(request_url_).is_empty()) {
affiliation_service_, {request_url_}); well_known_change_password_state_.PrefetchChangePasswordURLs(
affiliation_service_, {request_url_});
}
} else { } else {
change_password_url_service_ = change_password_url_service_ =
ChangePasswordUrlServiceFactory::GetForBrowserContext( ChangePasswordUrlServiceFactory::GetForBrowserContext(
......
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