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

Unified Diff: chrome/common/resource_dispatcher.cc

Issue 39104: Implementation of ResourceDispatcher::OnDownloadProgress (Closed)
Patch Set: Created 11 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/resource_dispatcher.cc
diff --git a/chrome/common/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc
index 709efed00e21e046a0e59b58122635a9f455d7d1..0ecc6b716c4d5b0a8f30e9b88aeb3452bdfd74cf 100644
--- a/chrome/common/resource_dispatcher.cc
+++ b/chrome/common/resource_dispatcher.cc
@@ -280,9 +280,24 @@ bool ResourceDispatcher::OnMessageReceived(const IPC::Message& message) {
void ResourceDispatcher::OnDownloadProgress(
int request_id, int64 position, int64 size) {
- // TODO(hclam): delegate this message to
- // ResourceLoaderBridge::Peer::OnDownloadProgress and send an ACK message
- // back to ResourceDispatcherHost.
+ PendingRequestList::iterator it = pending_requests_.find(request_id);
+ if (it == pending_requests_.end()) {
+ DLOG(WARNING) << "Got download progress for a nonexistant or "
Erik does not do reviews 2009/03/04 17:55:44 should this be a DCHECK?
Alpha Left Google 2009/03/05 00:32:06 I guess browser process can accidentally send reso
+ " finished requests";
+ return;
+ }
+
+ PendingRequestInfo& request_info = it->second;
+
+ RESOURCE_LOG("Dispatching download progress for " <<
Erik does not do reviews 2009/03/04 17:55:44 this log macro looks different than our normal sty
Alpha Left Google 2009/03/05 00:32:06 It looks strange to me too, but seems the whole fi
+ request_info.peer->GetURLForDebugging());
+ request_info.peer->OnDownloadProgress(position, size);
Erik does not do reviews 2009/03/04 17:55:44 is request_info.peer guaranteed to be non-null? D
Alpha Left Google 2009/03/05 00:32:06 This assumption is made throughout this file too.
+
+ // Send the ACK message back.
+ IPC::Message::Sender* sender = message_sender();
+ if (sender)
Erik does not do reviews 2009/03/04 17:55:44 Since the contents of the if wrap to multiple line
Alpha Left Google 2009/03/05 00:32:06 Done.
+ sender->Send(
+ new ViewHostMsg_DownloadProgress_ACK(MSG_ROUTING_NONE, request_id));
}
void ResourceDispatcher::OnUploadProgress(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698