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

Unified Diff: content/app/content_main_runner.cc

Issue 19231006: chrome: respect --child-clean-exit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made comments better. Created 7 years, 5 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 | « chrome/test/functional/test_clean_exit_with_children.py ('k') | content/browser/child_process_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/content_main_runner.cc
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 5bbdb9b35d81c001374fa3b495ae5430bc16224a..1e80ac034d8eefa3252321daf4be9ae318f0f8f8 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -5,6 +5,12 @@
#include "content/public/app/content_main_runner.h"
#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#if defined(OS_POSIX)
+#include <errno.h>
+#endif // OS_POSIX
+
#include "base/allocator/allocator_extension.h"
#include "base/at_exit.h"
@@ -786,6 +792,18 @@ class ContentMainRunnerImpl : public ContentMainRunner {
exit_manager_.reset(NULL);
+#if defined(OS_POSIX)
+ // Wait for children to exit if --wait-for-children-before-exiting is
+ // passed.
+ if (CommandLine::ForCurrentProcess()->
+ HasSwitch(switches::kWaitForChildrenBeforeExiting)) {
+ for (;;) {
+ if (wait(NULL) < 0 && errno == ECHILD)
+ break;
+ }
+ }
+#endif // OS_POSIX
+
delegate_ = NULL;
is_shutdown_ = true;
}
« no previous file with comments | « chrome/test/functional/test_clean_exit_with_children.py ('k') | content/browser/child_process_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698