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

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

Issue 740813004: Use StopChildProcess instead of base::KillProcess to kill a renderer process (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typos Created 6 years, 1 month 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 463a9b5b558ba4a8c3cda087449756dbe602944e..d9ff5628ccba7ed315b5cdfb4111dc7a8b16179b 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -149,6 +149,7 @@
#include "ui/native_theme/native_theme_switches.h"
#if defined(OS_ANDROID)
+#include "content/browser/android/child_process_launcher_android.h"
#include "content/browser/media/android/browser_demuxer_android.h"
#include "content/browser/screen_orientation/screen_orientation_message_filter_android.h"
#endif
@@ -964,8 +965,7 @@ void RenderProcessHostImpl::ReceivedBadMessage() {
}
// We kill the renderer but don't include a NOTREACHED, because we want the
// browser to try to survive when it gets illegal messages from the renderer.
- base::KillProcess(GetHandle(), RESULT_CODE_KILLED_BAD_MESSAGE,
- false);
+ FastShutdown(RESULT_CODE_KILLED_BAD_MESSAGE, false);
}
void RenderProcessHostImpl::WidgetRestored() {
@@ -1340,6 +1340,19 @@ bool RenderProcessHostImpl::FastShutdownIfPossible() {
return true;
}
+bool RenderProcessHostImpl::FastShutdown(int exit_code, bool wait) {
+ if (run_renderer_in_process())
+ return false; // Single process mode never shutdown the renderer.
Charlie Reis 2014/12/01 19:44:09 nit: shutdown -> shuts down
Jaekyun Seok (inactive) 2014/12/02 00:50:38 Done.
+
+#if defined(OS_ANDROID)
no sievers 2014/12/01 21:32:13 I'm still confused why we need an ifdef here. Why
Jaekyun Seok (inactive) 2014/12/02 00:50:38 I wanted not to change any execution flow on non-a
+ // Android requires a different approach for killing.
+ StopChildProcess(GetHandle());
+ return true;
+#else
+ return base::KillProcess(GetHandle(), exit_code, wait);
+#endif
+}
+
void RenderProcessHostImpl::DumpHandles() {
#if defined(OS_WIN)
Send(new ChildProcessMsg_DumpHandles());

Powered by Google App Engine
This is Rietveld 408576698