Commit e45f97e7 authored by Tsuyoshi Horo's avatar Tsuyoshi Horo Committed by Commit Bot

Set was_fetched_via_cache when we set was_in_prefetch_cache

Currently when a main SXG is served from PrefetchedSignedExchangeCache
was_in_prefetch_cache flag is set, but was_fetched_via_cache flag is not
set. So "Cached" suffixed PageLoad.Clients.SignedExchange UMAs are not
recorded.

To fix this, this CL set was_fetched_via_cache flag when we set
was_in_prefetch_cache flag.

Bug: 935267
Change-Id: I22bbd9554b871ad1f1c9e3268af113ed9c22de59
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1696961Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#676299}
parent 37701981
......@@ -85,6 +85,7 @@ class RedirectResponseURLLoader : public network::mojom::URLLoader {
network::ResourceResponseHead response_head =
signed_exchange_utils::CreateRedirectResponseHead(
outer_response, false /* is_fallback_redirect */);
response_head.was_fetched_via_cache = true;
response_head.was_in_prefetch_cache = true;
UpdateRequestResponseStartTime(&response_head);
client_->OnReceiveRedirect(signed_exchange_utils::CreateRedirectInfo(
......
......@@ -52,6 +52,7 @@ void PrefetchedSignedExchangeCacheAdapter::OnReceiveInnerResponse(
const network::ResourceResponseHead& response) {
std::unique_ptr<network::ResourceResponseHead> inner_response =
std::make_unique<network::ResourceResponseHead>(response);
inner_response->was_fetched_via_cache = true;
inner_response->was_in_prefetch_cache = true;
cached_exchange_->SetInnerResponse(std::move(inner_response));
}
......
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