Chromium Code Reviews| Index: ipc/ipc_channel_proxy.h |
| diff --git a/ipc/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h |
| index a660aeb0eafbec5e6e95df59477b0ea934f48620..3849530d7d7b885c6f1ef282bade87b0f2ff2036 100644 |
| --- a/ipc/ipc_channel_proxy.h |
| +++ b/ipc/ipc_channel_proxy.h |
| @@ -57,6 +57,13 @@ class SendCallbackHelper; |
| // |
| class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe { |
| public: |
| + // Interface for a filter to be imposed on outgoing messages which can |
|
inferno
2015/03/05 18:46:48
All code ifdefed.
|
| + // re-write the message. Used for testing. |
| + class OutgoingMessageFilter { |
| + public: |
| + virtual Message* Rewrite(Message* message) = 0; |
| + }; |
| + |
| // Initializes a channel proxy. The channel_handle and mode parameters are |
| // passed directly to the underlying IPC::Channel. The listener is called on |
| // the thread that creates the ChannelProxy. The filter's OnMessageReceived |
| @@ -112,6 +119,10 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe { |
| void AddFilter(MessageFilter* filter); |
| void RemoveFilter(MessageFilter* filter); |
| + void set_outgoing_message_filter(OutgoingMessageFilter* filter) { |
| + outgoing_message_filter_ = filter; |
| + } |
| + |
| // Set the task runner on which dispatched messages are posted. Both the new |
| // task runner and the existing task runner must run on the same thread, and |
| // must belong to the calling thread. |
| @@ -232,6 +243,10 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe { |
| Context* context() { return context_.get(); } |
| + OutgoingMessageFilter* outgoing_message_filter() { |
|
inferno
2015/03/05 18:46:48
() const {
|
| + return outgoing_message_filter_; |
| + } |
| + |
| private: |
| friend class IpcSecurityTestUtil; |
| @@ -242,6 +257,8 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe { |
| // Whether the channel has been initialized. |
| bool did_init_; |
| + |
| + OutgoingMessageFilter* outgoing_message_filter_; |
| }; |
| } // namespace IPC |