diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-26 05:10:31 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-26 05:10:31 +0000 |
commit | e896d031066a0b64a16453305b484f0285af0d7b (patch) | |
tree | 774ad08539aa8a7f23e8420270caacd86a4457ec | |
parent | 3fbcb7ad47965c36555052600d0b6d61c165d63d (diff) | |
download | chromium_src-e896d031066a0b64a16453305b484f0285af0d7b.zip chromium_src-e896d031066a0b64a16453305b484f0285af0d7b.tar.gz chromium_src-e896d031066a0b64a16453305b484f0285af0d7b.tar.bz2 |
One more deferred load fix. The ResourceDispatcher on receiving a message checks whether there are pending requests for the corresponding request id and if yes dispatches those first.
However the request can get deferred in this context and hence the new message needs to be queued up.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=19393
This fixes an issue where flash videos on youtube would not work correctly at times.
Bug=19393
Review URL: http://codereview.chromium.org/174499
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24432 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/common/resource_dispatcher.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/chrome/common/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc index 82bd5af..e075fc3 100644 --- a/chrome/common/resource_dispatcher.cc +++ b/chrome/common/resource_dispatcher.cc @@ -286,8 +286,17 @@ bool ResourceDispatcher::OnMessageReceived(const IPC::Message& message) { 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; |