Chromium Code Reviews| Index: ipc/ipc_sync_channel.h |
| =================================================================== |
| --- ipc/ipc_sync_channel.h (revision 83074) |
| +++ ipc/ipc_sync_channel.h (working copy) |
| @@ -90,6 +90,21 @@ |
| // of some particular channels to not re-enter in such cases. |
| void SetRestrictDispatchToSameChannel(bool value); |
| + // Interface for a filter to be imposed on outgoing messages which can |
| + // re-write the message. Used mainly for testing. |
| + class OutgoingMessageFilter { |
| + public: |
| + virtual ~OutgoingMessageFilter() = 0; |
| + |
| + // Returns a re-written message, freeing the original, or simply the |
| + // original unchanged if no rewrite indicated. |
| + virtual Message *Rewrite(Message *message) = 0; |
| + }; |
| + |
| + void set_outgoing_message_filter(OutgoingMessageFilter *filter) { |
| + outgoing_message_filter_ = filter; |
| + } |
| + |
| protected: |
| class ReceivedSyncMsgQueue; |
| friend class ReceivedSyncMsgQueue; |
| @@ -168,6 +183,7 @@ |
| base::WaitableEvent* shutdown_event_; |
| base::WaitableEventWatcher shutdown_watcher_; |
| bool restrict_dispatch_; |
| + |
|
jam
2011/04/27 21:58:07
nit
|
| }; |
| private: |
| @@ -188,6 +204,7 @@ |
| static void WaitForReplyWithNestedMessageLoop(SyncContext* context); |
| bool sync_messages_with_no_timeout_allowed_; |
| + OutgoingMessageFilter *outgoing_message_filter_; |
| // Used to signal events between the IPC and listener threads. |
| base::WaitableEventWatcher dispatch_watcher_; |