summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-14 12:13:23 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-14 12:15:06 +0000
commitf1652c9eb3f30ae80757b87b8978b570efa9810e (patch)
treeec6153ca3872ca186a7fd86a384e24967d8cecf9 /content
parentcc3dd4244d3496e7f1d28d66ff39bdb2dd8e678c (diff)
downloadchromium_src-f1652c9eb3f30ae80757b87b8978b570efa9810e.zip
chromium_src-f1652c9eb3f30ae80757b87b8978b570efa9810e.tar.gz
chromium_src-f1652c9eb3f30ae80757b87b8978b570efa9810e.tar.bz2
Mojo: Add the ability to notify a Mojo Channel that it's going to be destroyed soon.
* The actual destruction will typically happen on a different thread. * We'd like to suppress warnings about the OS "pipe" being broken (which it often will, because we kill processes rather than shut them down). * We'd like to know if we're still sending stuff on the channel even though it's about to go away. R=yzshen@chromium.org, sky@chromium.org Review URL: https://codereview.chromium.org/472603002 Cr-Commit-Position: refs/heads/master@{#289531} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289531 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/mojo/mojo_application_host.cc4
-rw-r--r--content/browser/mojo/mojo_application_host.h2
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc7
3 files changed, 11 insertions, 2 deletions
diff --git a/content/browser/mojo/mojo_application_host.cc b/content/browser/mojo/mojo_application_host.cc
index 2491252..3af7974 100644
--- a/content/browser/mojo/mojo_application_host.cc
+++ b/content/browser/mojo/mojo_application_host.cc
@@ -59,4 +59,8 @@ bool MojoApplicationHost::Activate(IPC::Sender* sender,
return did_activate_;
}
+void MojoApplicationHost::WillDestroySoon() {
+ channel_init_.WillDestroySoon();
+}
+
} // namespace content
diff --git a/content/browser/mojo/mojo_application_host.h b/content/browser/mojo/mojo_application_host.h
index ae57104..27a43f8 100644
--- a/content/browser/mojo/mojo_application_host.h
+++ b/content/browser/mojo/mojo_application_host.h
@@ -32,6 +32,8 @@ class MojoApplicationHost {
bool Init();
bool Activate(IPC::Sender* sender, base::ProcessHandle process_handle);
+ void WillDestroySoon();
+
bool did_activate() const { return did_activate_; }
ServiceRegistry* service_registry() { return &service_registry_; }
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 5da8d51..399244e 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -923,8 +923,7 @@ void RenderProcessHostImpl::NotifyTimezoneChange() {
}
ServiceRegistry* RenderProcessHostImpl::GetServiceRegistry() {
- if (!mojo_application_host_)
- return NULL;
+ DCHECK(mojo_application_host_);
return mojo_application_host_->service_registry();
}
@@ -1922,6 +1921,8 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead) {
RenderProcessExited(this, GetHandle(), status, exit_code));
within_process_died_observer_ = false;
+ mojo_application_host_->WillDestroySoon();
+
child_process_launcher_.reset();
channel_.reset();
gpu_message_filter_ = NULL;
@@ -2024,6 +2025,8 @@ void RenderProcessHostImpl::OnShutdownRequest() {
Source<RenderProcessHost>(this),
NotificationService::NoDetails());
+ mojo_application_host_->WillDestroySoon();
+
Send(new ChildProcessMsg_Shutdown());
}