diff options
author | stoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-20 21:32:32 +0000 |
---|---|---|
committer | stoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-20 21:32:32 +0000 |
commit | 314a0696abc62a1a036faa45f90d9acd43e8525e (patch) | |
tree | a738178022398caa85d5640381ce151cad20274f /chrome_frame/cfproxy_support.cc | |
parent | 93aa89c7533db379bb6bab05be9f5e33af233487 (diff) | |
download | chromium_src-314a0696abc62a1a036faa45f90d9acd43e8525e.zip chromium_src-314a0696abc62a1a036faa45f90d9acd43e8525e.tar.gz chromium_src-314a0696abc62a1a036faa45f90d9acd43e8525e.tar.bz2 |
Fill some gaps.
Tests for ExternalTabProxy.
Review URL: http://codereview.chromium.org/3888005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63262 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/cfproxy_support.cc')
-rw-r--r-- | chrome_frame/cfproxy_support.cc | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/chrome_frame/cfproxy_support.cc b/chrome_frame/cfproxy_support.cc index 6b74a48..42e6a28 100644 --- a/chrome_frame/cfproxy_support.cc +++ b/chrome_frame/cfproxy_support.cc @@ -4,6 +4,7 @@ #include "chrome_frame/cfproxy_private.h" +#include <vector> #include "base/atomic_sequence_num.h" #include "base/command_line.h" #include "base/process_util.h" @@ -227,9 +228,29 @@ void SyncMsgSender::QueueSyncMessage(const IPC::SyncMessage* msg, } } +// Cancel all outgoing calls for this delegate. void SyncMsgSender::Cancel(ChromeProxyDelegate* delegate) { - // TODO(stoyan): Cancel all outgoing calls for this delegate - // We may not need this. :) + std::vector<SingleSentMessage*> cancelled; + { + AutoLock lock(messages_lock_); + SentMessages::iterator it = messages_.begin(); + for (; it != messages_.end(); ) { + SingleSentMessage* origin = it->second; + if (origin->delegate_ == delegate) { + cancelled.push_back(origin); + it = messages_.erase(it); + } else { + ++it; + } + } + } + + for (std::vector<SingleSentMessage*>::iterator it = cancelled.begin(); + it != cancelled.end(); ++it) { + SingleSentMessage* origin = *it; + DispatchReplyFail(origin->type_, delegate, origin->ctx_); + delete origin; + } } SyncMsgSender::SingleSentMessage* SyncMsgSender::RemoveMessage(int id) { |