Index: ipc/ipc_sync_channel.h |
=================================================================== |
--- ipc/ipc_sync_channel.h (revision 83227) |
+++ ipc/ipc_sync_channel.h (working copy) |
@@ -25,6 +25,7 @@ |
class SyncMessage; |
class MessageReplyDeserializer; |
+class OutgoingMessageFilter; |
// This is similar to ChannelProxy, with the added feature of supporting sending |
// synchronous messages. |
@@ -90,6 +91,11 @@ |
// of some particular channels to not re-enter in such cases. |
void SetRestrictDispatchToSameChannel(bool value); |
+ // Sets this channel to rewrite its outgoing messages. |
+ void set_outgoing_message_filter(OutgoingMessageFilter *filter) { |
+ outgoing_message_filter_ = filter; |
+ } |
+ |
protected: |
class ReceivedSyncMsgQueue; |
friend class ReceivedSyncMsgQueue; |
@@ -188,6 +194,7 @@ |
static void WaitForReplyWithNestedMessageLoop(SyncContext* context); |
bool sync_messages_with_no_timeout_allowed_; |
+ OutgoingMessageFilter *outgoing_message_filter_; |
jam
2011/04/28 23:43:46
nit: * then space
|
// Used to signal events between the IPC and listener threads. |
base::WaitableEventWatcher dispatch_watcher_; |
@@ -195,6 +202,15 @@ |
DISALLOW_COPY_AND_ASSIGN(SyncChannel); |
}; |
+// Interface for a filter to be imposed on outgoing messages which can |
+// re-write the message. Used mainly for testing. |
+class OutgoingMessageFilter { |
jam
2011/04/28 23:43:46
since this doesn't have to do with sync messages,
|
+ public: |
+ // Returns a re-written message, freeing the original, or simply the |
+ // original unchanged if no rewrite indicated. |
+ virtual Message *Rewrite(Message *message) = 0; |
+}; |
+ |
} // namespace IPC |
#endif // IPC_IPC_SYNC_SENDER_H__ |