Commit a513ce37 authored by Mythri Alle's avatar Mythri Alle Committed by Commit Bot

Fix URLLoaderClientImpl to correctly handle deferring

URLLoaderClientImpl should check for both is_deferred flag and for any
pending messages in the DeferredMessage queue (NeedsStoringMessages)
when handling messages. We already use NeedsStoringMessages check when
handling certain messages. This cl also adds this check for the remaining
types: ResponseBody and TransferSizeUpdates.

Change-Id: Iac710721f23a7bd60340956b03dcbeae8eee338d
Reviewed-on: https://chromium-review.googlesource.com/1207251Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#589130}
parent 8d8638d5
......@@ -285,7 +285,7 @@ void URLLoaderClientImpl::OnReceiveCachedMetadata(
}
void URLLoaderClientImpl::OnTransferSizeUpdated(int32_t transfer_size_diff) {
if (is_deferred_) {
if (NeedsStoringMessage()) {
accumulated_transfer_size_diff_during_deferred_ += transfer_size_diff;
} else {
resource_dispatcher_->OnTransferSizeUpdated(request_id_,
......@@ -307,7 +307,7 @@ void URLLoaderClientImpl::OnStartLoadingResponseBody(
body_consumer_ = new URLResponseBodyConsumer(
request_id_, resource_dispatcher_, std::move(body), task_runner_);
if (is_deferred_) {
if (NeedsStoringMessage()) {
body_consumer_->SetDefersLoading();
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment