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

Unified Diff: chrome/browser/ui/browser_list.cc

Issue 8718012: Revert 111695 - Have content/ create and destroy its own threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 | « chrome/browser/sync/tools/sync_listen_notifications.cc ('k') | chrome/browser/ui/gtk/gtk_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_list.cc
===================================================================
--- chrome/browser/ui/browser_list.cc (revision 111697)
+++ chrome/browser/ui/browser_list.cc (working copy)
@@ -20,7 +20,6 @@
#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"
@@ -549,12 +548,7 @@
}
#endif
-// 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.
-
+static void TimeLimitedSessionEnding() {
// 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.
@@ -588,11 +582,26 @@
content::NotificationService::AllSources(),
content::NotificationService::NoDetails());
- // This will end by terminating the process.
- content::ImmediateShutdownAndExitProcess();
+ // 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
+}
+
+// static
bool BrowserList::HasBrowserWithProfile(Profile* profile) {
return FindBrowserMatching(BrowserList::begin(),
BrowserList::end(),
« no previous file with comments | « chrome/browser/sync/tools/sync_listen_notifications.cc ('k') | chrome/browser/ui/gtk/gtk_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698