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

Unified Diff: content/child/child_thread.cc

Issue 217403002: Remove kChildCleanExit since it's not used anymore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 9 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/renderer_host/render_process_host_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/child_thread.cc
===================================================================
--- content/child/child_thread.cc (revision 260245)
+++ content/child/child_thread.cc (working copy)
@@ -70,50 +70,6 @@
// plugins), PluginThread has EnsureTerminateMessageFilter.
#if defined(OS_POSIX)
-// A thread delegate that waits for |duration| and then signals the process
-// with SIGALRM.
-class WaitAndExitDelegate : public base::PlatformThread::Delegate {
- public:
- explicit WaitAndExitDelegate(base::TimeDelta duration)
- : duration_(duration) {}
- virtual ~WaitAndExitDelegate() OVERRIDE {}
-
- virtual void ThreadMain() OVERRIDE {
- base::PlatformThread::Sleep(duration_);
- // This used to be implemented with alarm(2). Make sure to not break
- // anything that requires the process being signaled.
- CHECK_EQ(0, raise(SIGALRM));
-
- base::PlatformThread::Sleep((base::TimeDelta::FromSeconds(10)));
- // If something erroneously blocked SIGALRM, this will trigger.
- NOTREACHED();
- _exit(0);
- }
-
- private:
- const base::TimeDelta duration_;
- DISALLOW_COPY_AND_ASSIGN(WaitAndExitDelegate);
-};
-
-// This is similar to using alarm(2), except it will spawn a thread
-// which will sleep for |duration| before raising SIGALRM.
-bool CreateAlarmThread(base::TimeDelta duration) {
- scoped_ptr<WaitAndExitDelegate> delegate(new WaitAndExitDelegate(duration));
-
- const bool thread_created = base::PlatformThread::CreateNonJoinable(
- 0 /* stack_size */, delegate.get());
- if (!thread_created)
- return false;
-
- // A non joinable thread has been created. The thread will either terminate
- // the process or will be terminated by the process. Therefore, keep the
- // delegate object alive for the lifetime of the process.
- WaitAndExitDelegate* leaking_delegate = delegate.release();
- ANNOTATE_LEAKING_OBJECT_PTR(leaking_delegate);
- ignore_result(leaking_delegate);
- return true;
-}
-
class SuicideOnChannelErrorFilter : public IPC::ChannelProxy::MessageFilter {
public:
// IPC::ChannelProxy::MessageFilter
@@ -133,21 +89,7 @@
//
// So, we install a filter on the channel so that we can process this event
// here and kill the process.
- if (CommandLine::ForCurrentProcess()->
- HasSwitch(switches::kChildCleanExit)) {
- // If clean exit is requested, we want to kill this process after giving
- // it 60 seconds to run exit handlers. Exit handlers may including ones
- // that write profile data to disk (which happens under profile collection
- // mode).
- CHECK(CreateAlarmThread(base::TimeDelta::FromSeconds(60)));
-#if defined(LEAK_SANITIZER)
- // Invoke LeakSanitizer early to avoid detecting shutdown-only leaks. If
- // leaks are found, the process will exit here.
- __lsan_do_leak_check();
-#endif
- } else {
- _exit(0);
- }
+ _exit(0);
}
protected:
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698