summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_channel_proxy.cc
diff options
context:
space:
mode:
authortsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-04 17:14:16 +0000
committertsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-04 17:14:16 +0000
commit894803199a98888bcbf913557e0952ae64cd0bf5 (patch)
tree53de7430f6db15e914e3ec5c965e2f3735cc4f91 /ipc/ipc_channel_proxy.cc
parent2ad3f3364a83bf499a43fdc8967f32d34c52ce7c (diff)
downloadchromium_src-894803199a98888bcbf913557e0952ae64cd0bf5.zip
chromium_src-894803199a98888bcbf913557e0952ae64cd0bf5.tar.gz
chromium_src-894803199a98888bcbf913557e0952ae64cd0bf5.tar.bz2
IPC outgoing message filters interpose yourself in a message stream. Minimally invasive baseline for building IPC tests to abuse browser along the lines of a compromised renderer.
Review URL: http://codereview.chromium.org/6711024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84076 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_channel_proxy.cc')
-rw-r--r--ipc/ipc_channel_proxy.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index 8f981f4..cbc18bc 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -283,7 +283,8 @@ ChannelProxy::ChannelProxy(const IPC::ChannelHandle& channel_handle,
Channel::Mode mode,
Channel::Listener* listener,
base::MessageLoopProxy* ipc_thread)
- : context_(new Context(listener, ipc_thread)) {
+ : context_(new Context(listener, ipc_thread)),
+ outgoing_message_filter_(NULL) {
Init(channel_handle, mode, ipc_thread, true);
}
@@ -292,7 +293,8 @@ ChannelProxy::ChannelProxy(const IPC::ChannelHandle& channel_handle,
base::MessageLoopProxy* ipc_thread,
Context* context,
bool create_pipe_now)
- : context_(context) {
+ : context_(context),
+ outgoing_message_filter_(NULL) {
Init(channel_handle, mode, ipc_thread, create_pipe_now);
}
@@ -343,6 +345,9 @@ void ChannelProxy::Close() {
}
bool ChannelProxy::Send(Message* message) {
+ if (outgoing_message_filter())
+ message = outgoing_message_filter()->Rewrite(message);
+
#ifdef IPC_MESSAGE_LOG_ENABLED
Logging::GetInstance()->OnSendMessage(message, context_->channel_id());
#endif