fix: copy received data in URLPipeLoader to prevent corruption (#29567)

This commit is contained in:
David Sanders 2021-06-13 18:18:52 -07:00 committed by GitHub
parent af7181b93f
commit e8c9a814d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -85,7 +85,7 @@ void URLPipeLoader::OnDataReceived(base::StringPiece string_piece,
producer_->Write(
std::make_unique<mojo::StringDataSource>(
string_piece, mojo::StringDataSource::AsyncWritingMode::
STRING_STAYS_VALID_UNTIL_COMPLETION),
STRING_MAY_BE_INVALIDATED_BEFORE_COMPLETION),
base::BindOnce(&URLPipeLoader::OnWrite, weak_factory_.GetWeakPtr(),
std::move(resume)));
}