diff options
author | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-29 07:00:47 +0000 |
---|---|---|
committer | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-29 07:00:47 +0000 |
commit | a93885094715c2d23953f9139d61e1071d8006a5 (patch) | |
tree | 9fa47c8472e643e36b59717e7d01d67399d36785 /ipc/ipc_sync_message_filter.h | |
parent | 813076634b1a26300428247a735629ecde96b93c (diff) | |
download | chromium_src-a93885094715c2d23953f9139d61e1071d8006a5.zip chromium_src-a93885094715c2d23953f9139d61e1071d8006a5.tar.gz chromium_src-a93885094715c2d23953f9139d61e1071d8006a5.tar.bz2 |
Make SyncMessageFilter work with WebKit threads.
SyncMessageFilter doesn't work with WebKit threads, because WebKit
threads don't have MessageLoops, so two threads send a message at the
same time, the first thread will stay blocked forever.
Also, it's unclear why we need to use MessageLoops as keys in a
hash_maps. The code doesn't use them at all.
TEST=a DB example that used to deadlock is working now
BUG=45253
Review URL: http://codereview.chromium.org/2360003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48556 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_sync_message_filter.h')
-rw-r--r-- | ipc/ipc_sync_message_filter.h | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/ipc/ipc_sync_message_filter.h b/ipc/ipc_sync_message_filter.h index 71d24c1..87fd612 100644 --- a/ipc/ipc_sync_message_filter.h +++ b/ipc/ipc_sync_message_filter.h @@ -6,28 +6,15 @@ #define IPC_IPC_SYNC_MESSAGE_FILTER_H_ #include "base/basictypes.h" -#include "base/hash_tables.h" #include "base/lock.h" #include "base/ref_counted.h" #include "base/waitable_event.h" #include "ipc/ipc_channel_proxy.h" #include "ipc/ipc_sync_message.h" +#include <set> class MessageLoop; -#if defined(COMPILER_GCC) -// Allows us to use MessageLoop in a hash_map with gcc (MSVC is okay without -// specifying this). -namespace __gnu_cxx { -template<> -struct hash<MessageLoop*> { - size_t operator()(MessageLoop* message_loop) const { - return reinterpret_cast<size_t>(message_loop); - } -}; -} -#endif - namespace IPC { class MessageReplyDeserializer; @@ -63,7 +50,7 @@ class SyncMessageFilter : public ChannelProxy::MessageFilter, MessageLoop* listener_loop_; // The process's main thread. MessageLoop* io_loop_; // The message loop where the Channel lives. - typedef base::hash_map<MessageLoop*, PendingSyncMsg*> PendingSyncMessages; + typedef std::set<PendingSyncMsg*> PendingSyncMessages; PendingSyncMessages pending_sync_messages_; // Locks data members above. |