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( |