Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1362)

Unified Diff: content/child/url_loader_client_impl.cc

Issue 2633123002: [Mojo-Loading] OnStartLoadingResponseBody should be called after OnReceiveResponse (Closed)
Patch Set: fix Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/child/url_loader_client_impl.cc
diff --git a/content/child/url_loader_client_impl.cc b/content/child/url_loader_client_impl.cc
index 04aee613ace7c63b19db4b3b8c5f995f9cf9ba30..72e539364f39bbdfc1615decdedb5df8d3ac0e28 100644
--- a/content/child/url_loader_client_impl.cc
+++ b/content/child/url_loader_client_impl.cc
@@ -114,8 +114,6 @@ void URLLoaderClientImpl::OnReceiveResponse(
const ResourceResponseHead& response_head,
mojom::DownloadedTempFilePtr downloaded_file) {
has_received_response_ = true;
- if (body_consumer_)
- body_consumer_->Start();
downloaded_file_ = std::move(downloaded_file);
Dispatch(ResourceMsg_ReceivedResponse(request_id_, response_head));
}
@@ -146,10 +144,9 @@ void URLLoaderClientImpl::OnTransferSizeUpdated(int32_t transfer_size_diff) {
void URLLoaderClientImpl::OnStartLoadingResponseBody(
mojo::ScopedDataPipeConsumerHandle body) {
DCHECK(!body_consumer_);
+ DCHECK(has_received_response_);
body_consumer_ = new URLResponseBodyConsumer(
request_id_, resource_dispatcher_, std::move(body), task_runner_);
- if (has_received_response_)
- body_consumer_->Start();
if (is_deferred_)
body_consumer_->SetDefersLoading();
}

Powered by Google App Engine
This is Rietveld 408576698