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

Unified Diff: content/child/resource_dispatcher.cc

Issue 2566943002: Dispatch transfer size update notification on mojo-loading (Closed)
Patch Set: fix Created 4 years 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/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) {
+ DCHECK_GT(transfer_size_diff, 0);
+ PendingRequestInfo* request_info = GetPendingRequestInfo(request_id);
+ if (!request_info)
+ return;
+
+ request_info->peer->OnTransferSizeUpdated(transfer_size_diff);
+}
+
ResourceDispatcher::PendingRequestInfo::PendingRequestInfo(
std::unique_ptr<RequestPeer> peer,
ResourceType resource_type,

Powered by Google App Engine
This is Rietveld 408576698