summaryrefslogtreecommitdiffstats
path: root/content/browser/child_process_launcher.cc
diff options
context:
space:
mode:
authorasharif@chromium.org <asharif@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-10 20:37:33 +0000
committerasharif@chromium.org <asharif@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-10 20:37:33 +0000
commit08c426a4ac0d42ed71844d5abe7d3ed6ed1cd081 (patch)
tree59f79087e072185fa5cd48445c07e37df6ffac3f /content/browser/child_process_launcher.cc
parent484c8e1091e758544ea2442fc655af72e279e2e8 (diff)
downloadchromium_src-08c426a4ac0d42ed71844d5abe7d3ed6ed1cd081.zip
chromium_src-08c426a4ac0d42ed71844d5abe7d3ed6ed1cd081.tar.gz
chromium_src-08c426a4ac0d42ed71844d5abe7d3ed6ed1cd081.tar.bz2
Added code so renderer would cleanly exit.
This code is only invoked when --renderer-clean-exit is passed to Chrome. It does the following: 1. Makes the browser process not send a SIGTERM to its children. 2. Makes the renderer process not call _exit() in OnChannelError(). Why is this needed? The renderer process in Chrome does not exit cleanly currently so when Chrome is profiled for optimization we do not get representative data and miss out on optimization opportunities. This CL addresses that problem by ensuring that exit handlers including profile dumpers get run before the renderer exits. BUG=107584 TEST=Rebuilt Chrome with -fprofile-generate. Verified that the renderer process' profile is included when Chrome is closed. Review URL: http://codereview.chromium.org/9936002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131625 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/child_process_launcher.cc')
-rw-r--r--content/browser/child_process_launcher.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc
index cb7d031..759ddad 100644
--- a/content/browser/child_process_launcher.cc
+++ b/content/browser/child_process_launcher.cc
@@ -48,12 +48,17 @@ class ChildProcessLauncher::Context
client_thread_id_(BrowserThread::UI),
termination_status_(base::TERMINATION_STATUS_NORMAL_TERMINATION),
exit_code_(content::RESULT_CODE_NORMAL_EXIT),
- starting_(true),
- terminate_child_on_shutdown_(true)
+ starting_(true)
#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
, zygote_(false)
#endif
{
+#if defined(OS_POSIX)
+ terminate_child_on_shutdown_ = !CommandLine::ForCurrentProcess()->
+ HasSwitch(switches::kRendererCleanExit);
+#else
+ terminate_child_on_shutdown_ = true;
+#endif
}
void Launch(