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

Unified Diff: content/renderer/renderer_main.cc

Issue 9936002: Added code so renderer would cleanly exit. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added ifdef around alarm(30). Created 8 years, 8 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/public/common/content_switches.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/renderer_main.cc
diff --git a/content/renderer/renderer_main.cc b/content/renderer/renderer_main.cc
index 80ec45d59b49637786a9833c4ccc53c59917968f..becc623a0ebd3cd20893994193eab63207bc76ce 100644
--- a/content/renderer/renderer_main.cc
+++ b/content/renderer/renderer_main.cc
@@ -89,8 +89,17 @@ class SuicideOnChannelErrorFilter : public IPC::ChannelProxy::MessageFilter {
//
// So, we install a filter on the channel so that we can process this event
// here and kill the process.
-
- _exit(0);
+ //
+ // We want to kill this process after giving it 30 seconds to run the exit
+ // handlers. SIGALRM has a default disposition of terminating the
+ // application.
+#if defined(OS_POSIX)
+ if (CommandLine::ForCurrentProcess()->
+ HasSwitch(switches::kRendererCleanExit))
+ alarm(30);
+ else
+#endif
+ _exit(0);
}
};
« no previous file with comments | « content/public/common/content_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698