summaryrefslogtreecommitdiffstats
path: root/content/common/child_process_host.cc
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-12 23:13:55 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-12 23:13:55 +0000
commit36d53bf52f46ab054a8cd28e97199bc2ec84c893 (patch)
tree1b4e5d039b0755f991233c670347c433c1589903 /content/common/child_process_host.cc
parent1546aed9cf55bcb65ffd28fa8a0c5aa478b08734 (diff)
downloadchromium_src-36d53bf52f46ab054a8cd28e97199bc2ec84c893.zip
chromium_src-36d53bf52f46ab054a8cd28e97199bc2ec84c893.tar.gz
chromium_src-36d53bf52f46ab054a8cd28e97199bc2ec84c893.tar.bz2
Ignore messages at ListenerHook after ChildProcessHost's destructor starts.
ChildProcessHost's pure virtuals get called by ListenerHook. This prevents that. BUG=96239 TEST=none Review URL: http://codereview.chromium.org/7870005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100799 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/child_process_host.cc')
-rw-r--r--content/common/child_process_host.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/content/common/child_process_host.cc b/content/common/child_process_host.cc
index 13d6ba6..bcaca6d 100644
--- a/content/common/child_process_host.cc
+++ b/content/common/child_process_host.cc
@@ -76,6 +76,7 @@ ChildProcessHost::~ChildProcessHost() {
filters_[i]->OnChannelClosing();
filters_[i]->OnFilterRemoved();
}
+ listener_.Shutdown();
}
void ChildProcessHost::AddFilter(IPC::ChannelProxy::MessageFilter* filter) {
@@ -234,8 +235,15 @@ ChildProcessHost::ListenerHook::ListenerHook(ChildProcessHost* host)
: host_(host) {
}
+void ChildProcessHost::ListenerHook::Shutdown() {
+ host_ = NULL;
+}
+
bool ChildProcessHost::ListenerHook::OnMessageReceived(
const IPC::Message& msg) {
+ if (!host_)
+ return true;
+
#ifdef IPC_MESSAGE_LOG_ENABLED
IPC::Logging* logger = IPC::Logging::GetInstance();
if (msg.type() == IPC_LOGGING_ID) {
@@ -272,6 +280,8 @@ bool ChildProcessHost::ListenerHook::OnMessageReceived(
}
void ChildProcessHost::ListenerHook::OnChannelConnected(int32 peer_pid) {
+ if (!host_)
+ return;
host_->opening_channel_ = false;
host_->OnChannelConnected(peer_pid);
// Notify in the main loop of the connection.
@@ -282,6 +292,8 @@ void ChildProcessHost::ListenerHook::OnChannelConnected(int32 peer_pid) {
}
void ChildProcessHost::ListenerHook::OnChannelError() {
+ if (!host_)
+ return;
host_->opening_channel_ = false;
host_->OnChannelError();