Append service-worker body size information in BodyDataReceivedImpl
In the last CL[1], the size information of the body intercepted by
service-worker was forwareded to navigation timing. However, the total
size is appended in DocumentLoader::DecodedBodyDataReceived()
, which
is called when the body load is done in the background thread. If the
background thread is not used, DocumentLoader::BodyDataReceived()
is
called instead, and in that case total_body_size_from_service_worker_
is not set at all.
The background thread is used if the mime-type is text/html, but not
used for other mime-type resources. Whether the background thread is
used or not is determined in
DocumentLoader::MaybeStartLoadingBodyInBackground()
[2].
This CL moves the code from DecodedBodyDataReceived()
to
BodyDataReceivedImpl()
, which is called from both BodyDataReceived()
and DecodedBodyDataReceived()
.
https://crbug.com/41494176#comment18 has more context.
[1] crrev.com/c/5463285
[2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/loader/document_loader.cc;l=3499-3520;drc=b74be264a68fdb02cb216ad60ea610562d2f800d;bpv=1;bpt=1
Bug: 334977808
Change-Id: Ib1ab987a011c5a7cb983dc48d7906b96378f3a88
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526558
Reviewed-by: Kouhei Ueno kouhei@chromium.org
Commit-Queue: Kouhei Ueno kouhei@chromium.org
Reviewed-by: Yoshisato Yanagisawa yyanagisawa@chromium.org
Cr-Commit-Position: refs/heads/main@{#1298573}