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

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: Remove BUILD.gn changes, since the IPC fuzzer doesn't work with gn Created 5 years, 9 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
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | ipc/ipc_channel_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy.h
diff --git a/ipc/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h
index a660aeb0eafbec5e6e95df59477b0ea934f48620..0ac2fa9cef2d4deae448a034af208a3e17e43e50 100644
--- a/ipc/ipc_channel_proxy.h
+++ b/ipc/ipc_channel_proxy.h
@@ -57,6 +57,15 @@ class SendCallbackHelper;
//
class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
public:
+#if defined(ENABLE_IPC_FUZZER)
+ // Interface for a filter to be imposed on outgoing messages which can
+ // re-write the message. Used for testing.
+ class OutgoingMessageFilter {
+ public:
+ virtual Message* Rewrite(Message* message) = 0;
+ };
+#endif
+
// 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 +121,12 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
void AddFilter(MessageFilter* filter);
void RemoveFilter(MessageFilter* filter);
+#if defined(ENABLE_IPC_FUZZER)
+ void set_outgoing_message_filter(OutgoingMessageFilter* filter) {
+ outgoing_message_filter_ = filter;
+ }
+#endif
+
// 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 +247,12 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
Context* context() { return context_.get(); }
+#if defined(ENABLE_IPC_FUZZER)
+ OutgoingMessageFilter* outgoing_message_filter() const {
+ return outgoing_message_filter_;
+ }
+#endif
+
private:
friend class IpcSecurityTestUtil;
@@ -242,6 +263,10 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
// Whether the channel has been initialized.
bool did_init_;
+
+#if defined(ENABLE_IPC_FUZZER)
+ OutgoingMessageFilter* outgoing_message_filter_;
+#endif
};
} // namespace IPC
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | ipc/ipc_channel_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698