Skip to content
Commit ff1439bf authored by Tsuyoshi Horo's avatar Tsuyoshi Horo Committed by Chromium LUCI CQ
Browse files

Pass SegmentedBuffer to Resource

Currently if a BackgroundResponseProcessor consumed the body data, a
SegmentedBuffer is passed to ResourceLoader::DidReceiveResponse() from
the background thread without memory copying the body data. But this
method is calling DidReceiveData() method for each segments, and
Resource::AppendData() method is copying the segments to Resource's
`data_` if `data_buffering_policy` is `kBufferData.

To avoid this memory copying, this CL changes the argument of
Resource::AppendData() from `base::span<const char>` to
`absl::variant<SegmentedBuffer, base::span<const char>>`. And
ResourceLoader::DidReceiveResponse() will pass the SegmentedBuffer to
the Resource.

Bug: 342859647

Change-Id: Ia612e46e6ba143ba63dd57f01c5b8ac19b340a11
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5599363


Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1313162}
parent 7e0b87ec
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment