Chromium Code Reviews| Index: content/child/resource_dispatcher.cc |
| diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc |
| index 89a604da2ca3f47c1bd89a4b333fad4a76b9e8d0..daec87e79e21536661ab2a7ce2f48014d6e15f25 100644 |
| --- a/content/child/resource_dispatcher.cc |
| +++ b/content/child/resource_dispatcher.cc |
| @@ -114,6 +114,11 @@ class URLLoaderClientImpl final : public mojom::URLLoaderClient { |
| ResourceMsg_DataDownloaded(request_id_, data_len, encoded_data_len)); |
| } |
| + void OnTransferSizeUpdated(int64_t transfer_size_diff) override { |
| + resource_dispatcher_->OnTransferSizeUpdated(request_id_, |
| + transfer_size_diff); |
| + } |
| + |
| void OnStartLoadingResponseBody( |
| mojo::ScopedDataPipeConsumerHandle body) override { |
| DCHECK(!body_consumer_); |
| @@ -576,6 +581,16 @@ void ResourceDispatcher::DidChangePriority(int request_id, |
| request_id, new_priority, intra_priority_value)); |
| } |
| +void ResourceDispatcher::OnTransferSizeUpdated(int request_id, |
| + int transfer_size_diff) { |
|
dcheng
2016/12/15 06:29:02
Can we use int64_t or int uniformly? It seems like
yhirano
2016/12/15 11:28:00
I added a TODO comment.
|
| + DCHECK_GT(transfer_size_diff, 0); |
| + PendingRequestInfo* request_info = GetPendingRequestInfo(request_id); |
|
dcheng
2016/12/15 06:29:02
Unrelated, but I wish this class used GetPendingRe
yhirano
2016/12/15 11:28:00
There are four pending_request_.find() in this fil
|
| + if (!request_info) |
| + return; |
| + |
| + request_info->peer->OnTransferSizeUpdated(transfer_size_diff); |
| +} |
| + |
| ResourceDispatcher::PendingRequestInfo::PendingRequestInfo( |
| std::unique_ptr<RequestPeer> peer, |
| ResourceType resource_type, |