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..460e6ed61770a33bdb182910643c00947afcf72a 100644 |
--- a/content/app/content_main_runner.cc |
+++ b/content/app/content_main_runner.cc |
@@ -5,6 +5,8 @@ |
#include "content/public/app/content_main_runner.h" |
#include <stdlib.h> |
+#include <sys/types.h> |
+#include <sys/wait.h> |
#include "base/allocator/allocator_extension.h" |
#include "base/at_exit.h" |
@@ -786,6 +788,13 @@ class ContentMainRunnerImpl : public ContentMainRunner { |
exit_manager_.reset(NULL); |
+ // Wait for children to exit if --child-clean-exit is passed. |
+ if (CommandLine::ForCurrentProcess()-> |
+ HasSwitch(switches::kChildCleanExit)) { |
+ while (wait(NULL) != -1); |
+ } |
+ |
+ |
delegate_ = NULL; |
is_shutdown_ = true; |
} |