Use std::string::append(base::StringPiece) instead of decomposing

std::string_view is special because std::string knows how to integrate
with it. Happily, the STL uses a StringViewLike concept, so just by
adding the implicit conversion, we can now write
str.append(piece) instead str.append(piece.data(), piece.size()).

While small, this change keeps us using safe constructs. Clear these out
so we get a little closer to being able to flag accesses of data() as
unsafe. (That's a long ways off, but let's get the easy stuff out of the way.)

A few places (content/web_test/renderer/blink_test_helpers.cc and
net/test/embedded_test_server/http2_connection.cc) were even wrong as
they used .data() without .size() on a string_view/StringPiece.

Bug: 691162
Change-Id: Ib58e00db5f8c2527908c9e7971d28a0b53e68e65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4574755
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Commit-Queue: David Benjamin <davidben@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1151252}
NOKEYCHECK=True
GitOrigin-RevId: 2eb24c24d2fb7c302710ad7f00bcc32c9015770e
1 file changed