Index: chrome/browser/lifetime/application_lifetime.cc |
diff --git a/chrome/browser/lifetime/application_lifetime.cc b/chrome/browser/lifetime/application_lifetime.cc |
index 7e377a83cf581c26467528f1d155d0af4b054b8c..883dc6d7a6beed2104663793dfbe8a7d636be395 100644 |
--- a/chrome/browser/lifetime/application_lifetime.cc |
+++ b/chrome/browser/lifetime/application_lifetime.cc |
@@ -12,6 +12,8 @@ |
#include "base/memory/scoped_ptr.h" |
#include "base/message_loop/message_loop.h" |
#include "base/prefs/pref_service.h" |
+#include "base/process/kill.h" |
+#include "base/process/process.h" |
#include "build/build_config.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/browser_process_platform_part.h" |
@@ -276,6 +278,13 @@ void SessionEnding() { |
// Write important data first. |
g_browser_process->EndSession(); |
+#if defined(OS_WIN) |
+ // On Windows 7 and later, the system will consider the process ripe for |
+ // termination as soon as it hides or destroys its windows. Since any |
+ // execution past that point will be non-deterministically cut short, we |
+ // might as well put ourselves out of that misery deterministically. |
+ base::KillProcess(base::Process::Current().handle(), 0, false); |
+#else |
CloseAllBrowsers(); |
// Send out notification. This is used during testing so that the test harness |
@@ -285,11 +294,9 @@ void SessionEnding() { |
content::NotificationService::AllSources(), |
content::NotificationService::NoDetails()); |
-#if defined(OS_WIN) |
- base::win::SetShouldCrashOnProcessDetach(false); |
gab
2014/06/23 21:09:54
Don't you still want to set this before killing th
Sigurður Ásgeirsson
2014/06/23 21:39:59
It really doesn't matter, as TerminateProcess impl
|
-#endif |
// This will end by terminating the process. |
content::ImmediateShutdownAndExitProcess(); |
+#endif // defined(OS_WIN) |
} |
void IncrementKeepAliveCount() { |