fix: ensure object is not used after move (#26115)

This commit is contained in:
David Sanders 2020-10-26 11:56:08 -07:00 committed by GitHub
parent 29016b42c7
commit f714556a12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -549,9 +549,10 @@ void ElectronURLLoaderFactory::SendContents(
write_data->data = std::move(data);
write_data->producer =
std::make_unique<mojo::DataPipeProducer>(std::move(producer));
auto* producer_ptr = write_data->producer.get();
base::StringPiece string_piece(write_data->data);
write_data->producer->Write(
producer_ptr->Write(
std::make_unique<mojo::StringDataSource>(
string_piece, mojo::StringDataSource::AsyncWritingMode::
STRING_STAYS_VALID_UNTIL_COMPLETION),