diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-24 22:16:31 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-24 22:16:31 +0000 |
commit | 2b89cb916a32323432bd26ce87834bd485aa9d2d (patch) | |
tree | beb343531e6eac792aa6d4c679083b3abb27edd8 /chrome/browser/browser_shutdown.cc | |
parent | d7cf069b24322b95745d75ec6fa3244488900d20 (diff) | |
download | chromium_src-2b89cb916a32323432bd26ce87834bd485aa9d2d.zip chromium_src-2b89cb916a32323432bd26ce87834bd485aa9d2d.tar.gz chromium_src-2b89cb916a32323432bd26ce87834bd485aa9d2d.tar.bz2 |
Chrome OS: Shutdown without blocking when SIGTERM is received.
Made ShuttingDownWithoutCloseBrowsers a explicit flag.
Use END_SESSION shutdown type if chrome recieves SIGTERM AND there are tabs that may
block shutdown.
Make sure APP_TERMINATING is sent only once.
This fixes SIGABORT crash in two shutdown scenarios:
1) powering off when chrome has beforeunload handler, or
downloads in progress.
2) singout from screen locker when chrome has beforeunload handler or downloads in progress.
This is simple version of fix to merge to release branch. I'm working on
another CL that will (hopefully) cleanup a bit more.
BUG=chromium-os:20460
TEST=see bug for repro step
Review URL: http://codereview.chromium.org/8262009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106988 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_shutdown.cc')
-rw-r--r-- | chrome/browser/browser_shutdown.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc index 25f0233..0a7ff28 100644 --- a/chrome/browser/browser_shutdown.cc +++ b/chrome/browser/browser_shutdown.cc @@ -59,6 +59,9 @@ namespace browser_shutdown { // Whether the browser is trying to quit (e.g., Quit chosen from menu). bool g_trying_to_quit = false; +// Whether the browser should quit without closing browsers. +bool g_shutting_down_without_closing_browsers = false; + Time shutdown_started_; ShutdownType shutdown_type_ = NOT_VALID; int shutdown_num_processes_; @@ -309,11 +312,11 @@ bool IsTryingToQuit() { } bool ShuttingDownWithoutClosingBrowsers() { -#if defined(USE_X11) - if (GetShutdownType() == browser_shutdown::END_SESSION) - return true; -#endif - return false; + return g_shutting_down_without_closing_browsers; +} + +void SetShuttingDownWithoutClosingBrowsers(bool without_close) { + g_shutting_down_without_closing_browsers = without_close; } } // namespace browser_shutdown |