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

Unified Diff: content/browser/child_process_launcher.cc

Issue 7053008: Revert 86532 - Revert 86517 - Don't terminate plugin processes from the browser during browser sh... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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/child_process_launcher.h ('k') | content/browser/plugin_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/child_process_launcher.cc
===================================================================
--- content/browser/child_process_launcher.cc (revision 86552)
+++ content/browser/child_process_launcher.cc (working copy)
@@ -44,7 +44,8 @@
Context()
: client_(NULL),
client_thread_id_(BrowserThread::UI),
- starting_(true)
+ starting_(true),
+ terminate_child_on_shutdown_(true)
#if defined(OS_LINUX)
, zygote_(false)
#endif
@@ -87,6 +88,10 @@
client_ = NULL;
}
+ void set_terminate_child_on_shutdown(bool terminate_on_shutdown) {
+ terminate_child_on_shutdown_ = terminate_on_shutdown;
+ }
+
private:
friend class base::RefCountedThreadSafe<ChildProcessLauncher::Context>;
friend class ChildProcessLauncher;
@@ -210,6 +215,9 @@
if (!process_.handle())
return;
+ if (!terminate_child_on_shutdown_)
+ return;
+
// On Posix, EnsureProcessTerminated can lead to 2 seconds of sleep! So
// don't this on the UI/IO threads.
BrowserThread::PostTask(
@@ -257,6 +265,9 @@
BrowserThread::ID client_thread_id_;
base::Process process_;
bool starting_;
+ // Controls whether the child process should be terminated on browser
+ // shutdown. Default behavior is to terminate the child.
+ bool terminate_child_on_shutdown_;
#if defined(OS_LINUX)
bool zygote_;
@@ -333,3 +344,10 @@
&ChildProcessLauncher::Context::SetProcessBackgrounded,
background));
}
+
+void ChildProcessLauncher::SetTerminateChildOnShutdown(
+ bool terminate_on_shutdown) {
+ if (context_)
+ context_->set_terminate_child_on_shutdown(terminate_on_shutdown);
+}
+
« no previous file with comments | « content/browser/child_process_launcher.h ('k') | content/browser/plugin_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698