Index: chrome/renderer/mock_render_thread.cc |
diff --git a/chrome/renderer/mock_render_thread.cc b/chrome/renderer/mock_render_thread.cc |
index 1fa513fe0c138533696645b82c5d0681fcc71958..35383cbc370728a0a5f472cca3b25557b7ac1134 100644 |
--- a/chrome/renderer/mock_render_thread.cc |
+++ b/chrome/renderer/mock_render_thread.cc |
@@ -34,6 +34,16 @@ void MockRenderThread::RemoveRoute(int32 routing_id) { |
widget_ = NULL; |
} |
+// Called by, for example, RenderView::Init(), when adding a new message filter |
+void MockRenderThread::AddFilter(IPC::ChannelProxy::MessageFilter* filter) { |
+ filter->OnFilterAdded(&sink()); |
+} |
+ |
+// Called when the filter is removed |
+void MockRenderThread::RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) { |
+ filter->OnFilterRemoved(); |
+} |
+ |
// Called by the Widget. Used to send messages to the browser. |
// We short-circuit the mechanim and handle the messages right here on this |
// class. |
@@ -66,7 +76,7 @@ void MockRenderThread::SendCloseMessage() { |
void MockRenderThread::OnMessageReceived(const IPC::Message& msg) { |
// Save the message in the sink. |
- sink_.OnMessageReceived(msg); |
+ sink_.Send(const_cast<IPC::Message*>(&msg)); |
// Some messages we do special handling. |
bool handled = true; |