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

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

Issue 879533006: Send notification when render process has failed to launch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fafd773952f52b74baab4d052d8c229f64407e8b..4493e28a39557ff20a5af9874f11caf60dcfc9ce 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1438,7 +1438,7 @@ bool RenderProcessHostImpl::FastShutdownIfPossible() {
// died due to fast shutdown versus another cause.
fast_shutdown_started_ = true;
- ProcessDied(false /* already_dead */);
+ ProcessDied(false /* already_dead */, nullptr);
return true;
}
@@ -1532,7 +1532,7 @@ void RenderProcessHostImpl::OnChannelConnected(int32 peer_pid) {
}
void RenderProcessHostImpl::OnChannelError() {
- ProcessDied(true /* already_dead */);
+ ProcessDied(true /* already_dead */, nullptr);
}
void RenderProcessHostImpl::OnBadMessageReceived(const IPC::Message& message) {
@@ -2003,7 +2003,8 @@ void RenderProcessHostImpl::RegisterProcessHostForSite(
map->RegisterProcess(site, process);
}
-void RenderProcessHostImpl::ProcessDied(bool already_dead) {
+void RenderProcessHostImpl::ProcessDied(bool already_dead,
+ RendererClosedDetails* known_details) {
// Our child process has died. If we didn't expect it, it's a crash.
// In any case, we need to let everyone know it's gone.
// The OnChannelError notification can fire multiple times due to nested sync
@@ -2019,12 +2020,15 @@ void RenderProcessHostImpl::ProcessDied(bool already_dead) {
// child_process_launcher_ can be NULL in single process mode or if fast
// termination happened.
+ base::TerminationStatus status = base::TERMINATION_STATUS_NORMAL_TERMINATION;
int exit_code = 0;
- base::TerminationStatus status =
- child_process_launcher_.get() ?
- child_process_launcher_->GetChildTerminationStatus(already_dead,
- &exit_code) :
- base::TERMINATION_STATUS_NORMAL_TERMINATION;
+ if (known_details) {
+ status = known_details->status;
+ exit_code = known_details->exit_code;
+ } else if (child_process_launcher_.get()) {
+ status = child_process_launcher_->GetChildTerminationStatus(already_dead,
+ &exit_code);
+ }
RendererClosedDetails details(status, exit_code);
mojo_application_host_->WillDestroySoon();
@@ -2237,6 +2241,12 @@ void RenderProcessHostImpl::OnProcessLaunched() {
#endif
}
+void RenderProcessHostImpl::OnProcessLaunchFailed() {
+ RendererClosedDetails details { base::TERMINATION_STATUS_PROCESS_WAS_KILLED,
+ -1 };
+ ProcessDied(true, &details);
+}
+
scoped_refptr<AudioRendererHost>
RenderProcessHostImpl::audio_renderer_host() const {
return audio_renderer_host_;
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698