summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/browser_list.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/browser_list.cc')
-rw-r--r--chrome/browser/ui/browser_list.cc27
1 files changed, 9 insertions, 18 deletions
diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc
index daaead6..6827139 100644
--- a/chrome/browser/ui/browser_list.cc
+++ b/chrome/browser/ui/browser_list.cc
@@ -20,6 +20,7 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "content/browser/tab_contents/navigation_details.h"
+#include "content/public/browser/browser_shutdown.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_process_host.h"
@@ -548,7 +549,12 @@ void BrowserList::ExitCleanly() {
}
#endif
-static void TimeLimitedSessionEnding() {
+// static
+void BrowserList::SessionEnding() {
+ // This is a time-limited shutdown where we need to write as much to
+ // disk as we can as soon as we can, and where we must kill the
+ // process within a hang timeout to avoid user prompts.
+
// Start watching for hang during shutdown, and crash it if takes too long.
// We disarm when |shutdown_watcher| object is destroyed, which is when we
// exit this function.
@@ -582,23 +588,8 @@ static void TimeLimitedSessionEnding() {
content::NotificationService::AllSources(),
content::NotificationService::NoDetails());
- // And shutdown.
- browser_shutdown::Shutdown();
-}
-
-// static
-void BrowserList::SessionEnding() {
- TimeLimitedSessionEnding();
-
-#if defined(OS_WIN)
- // At this point the message loop is still running yet we've shut everything
- // down. If any messages are processed we'll likely crash. Exit now.
- ExitProcess(content::RESULT_CODE_NORMAL_EXIT);
-#elif defined(OS_POSIX) && !defined(OS_MACOSX)
- _exit(content::RESULT_CODE_NORMAL_EXIT);
-#else
- NOTIMPLEMENTED();
-#endif
+ // This will end by terminating the process.
+ content::ImmediateShutdownAndExitProcess();
}
// static