diff options
author | jcampan@google.com <jcampan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-12 01:25:41 +0000 |
---|---|---|
committer | jcampan@google.com <jcampan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-12 01:25:41 +0000 |
commit | d65cab7ac310ea12c5d946ff40242a243ce911da (patch) | |
tree | fe3eaa4a4e6f14a7416c4b4da351e18cd34d34b2 /chrome/common/ipc_sync_channel.h | |
parent | 1a48f315b0ca5c26c4446070edfb5842ed06c8c7 (diff) | |
download | chromium_src-d65cab7ac310ea12c5d946ff40242a243ce911da.zip chromium_src-d65cab7ac310ea12c5d946ff40242a243ce911da.tar.gz chromium_src-d65cab7ac310ea12c5d946ff40242a243ce911da.tar.bz2 |
Enabling sync_channel in the browser to allow accessibility code making blocking calls. This replaces my previous CL that was somehow duplicating some of these functionalities.
BUG=None
TEST=Run the unit tests.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@691 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_sync_channel.h')
-rw-r--r-- | chrome/common/ipc_sync_channel.h | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/chrome/common/ipc_sync_channel.h b/chrome/common/ipc_sync_channel.h index af6e153..bd473d4 100644 --- a/chrome/common/ipc_sync_channel.h +++ b/chrome/common/ipc_sync_channel.h @@ -52,13 +52,20 @@ class SyncMessage; class SyncChannel : public ChannelProxy { public: SyncChannel(const std::wstring& channel_id, Channel::Mode mode, - Channel::Listener* listener, MessageLoop* ipc_message_loop, - bool create_pipe_now); + Channel::Listener* listener, MessageFilter* filter, + MessageLoop* ipc_message_loop, bool create_pipe_now, + HANDLE shutdown_handle); ~SyncChannel(); virtual bool Send(Message* message); + virtual bool SendWithTimeout(Message* message, int timeout_ms); bool UnblockListener(Message* message); + // Whether we allow sending messages with no time-out. + void set_sync_messages_with_no_timeout_allowed(bool value) { + sync_messages_with_no_timeout_allowed_ = value; + } + protected: class ReceivedSyncMsgQueue; friend class ReceivedSyncMsgQueue; @@ -95,6 +102,14 @@ class SyncChannel : public ChannelProxy { // Otherwise the function returns false. bool UnblockListener(const Message* msg); + + // Cleanly remove the top deserializer (and throw it away). + // You need to acquire the deserializers_lock before calling this. + void PopDeserializer(bool close_reply_event); + + // Returns the lock that should be acquired before calling PopDeserializer. + Lock* deserializers_lock() { return &deserializers_lock_; } + private: void OnMessageReceived(const Message& msg); void OnChannelError(); @@ -109,9 +124,6 @@ class SyncChannel : public ChannelProxy { HANDLE reply_event; }; - // Cleanly remove the top deserializer (and throw it away). - void PopDeserializer(); - typedef std::stack<PendingSyncMsg> PendingSyncMessageQueue; PendingSyncMessageQueue deserializers_; Lock deserializers_lock_; @@ -130,6 +142,8 @@ class SyncChannel : public ChannelProxy { std::stack<HANDLE> pump_messages_events_; + bool sync_messages_with_no_timeout_allowed_; + DISALLOW_EVIL_CONSTRUCTORS(SyncChannel); }; |