Index: chrome/common/resource_dispatcher.cc |
=================================================================== |
--- chrome/common/resource_dispatcher.cc (revision 24356) |
+++ chrome/common/resource_dispatcher.cc (working copy) |
@@ -286,8 +286,17 @@ |
return true; |
} |
// Make sure any deferred messages are dispatched before we dispatch more. |
- if (!request_info.deferred_message_queue.empty()) |
+ if (!request_info.deferred_message_queue.empty()) { |
FlushDeferredMessages(request_id); |
+ // The request could have been deferred now. If yes then the current |
+ // message has to be queued up. The request_info instance should remain |
+ // valid here as there are pending messages for it. |
+ DCHECK(pending_requests_.find(request_id) != pending_requests_.end()); |
+ if (request_info.is_deferred) { |
+ request_info.deferred_message_queue.push_back(new IPC::Message(message)); |
+ return true; |
+ } |
+ } |
DispatchMessage(message); |
return true; |