Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Unified Diff: ipc/ipc_channel_proxy.h

Issue 975903002: Add a flag to dump IPC messages sent from the renderer to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup in external_ipc_dumper.cc Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698