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

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 324143002: Decouple IPC::MessageFilter from IPC::Channel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing compilation errors Created 6 years, 6 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: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 66cbbcf07f6d979a629e60363068d586d449450d..5a339203070bd5fd04a88ffb70d9ae2ba46ac60b 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -43,6 +43,7 @@
#include "content/browser/browser_child_process_host_impl.h"
#include "content/browser/browser_main.h"
#include "content/browser/browser_main_loop.h"
+#include "content/browser/browser_message_filter_peer.h"
#include "content/browser/browser_plugin/browser_plugin_message_filter.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/device_sensors/device_motion_message_filter.h"
@@ -450,6 +451,7 @@ RenderProcessHostImpl::RenderProcessHostImpl(
mojo_activation_required_(false),
visible_widgets_(0),
backgrounded_(true),
+ filter_peer_(new BrowserMessageFilterPeer()),
is_initialized_(false),
id_(ChildProcessHostImpl::GenerateChildProcessUniqueId()),
browser_context_(browser_context),
@@ -1411,6 +1413,7 @@ void RenderProcessHostImpl::OnChannelConnected(int32 peer_pid) {
IPC::Logging::GetInstance()->Enabled()));
#endif
+ filter_peer_->set_pid(peer_pid);
tracked_objects::ThreadData::Status status =
tracked_objects::ThreadData::status();
Send(new ChildProcessMsg_SetProfilerStatus(status));
@@ -1600,6 +1603,8 @@ IPC::ChannelProxy* RenderProcessHostImpl::GetChannel() {
}
void RenderProcessHostImpl::AddFilter(BrowserMessageFilter* filter) {
+ // OnFilterRemovedFromHost() is called by BrowserMessageFilter::Internal.
+ filter->OnFilterAddedToHost(filter_peer_.get());
channel_->AddFilter(filter->GetFilter());
}

Powered by Google App Engine
This is Rietveld 408576698