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

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 59d29623ed5084c2f9438a098592ddfe63f2c99f..96192c4acd8661a21abb9fc79b3038e58c253b3b 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));
}
@@ -153,10 +151,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