Commit 46482700 authored by tapted@chromium.org's avatar tapted@chromium.org

Ensure the Desktop App Launcher warmup window is not created while trying to quit.

When relaunching from Metro there is a lengthier time-window where
BrowserProcess::IsShuttingDown() is false, but 
browser_shutdown::IsTryingToQuit() is true. If the app launcher delayed
warmup (and the non-delayed asynchronous profile load it triggers) is
unlucky enough to get scheduled here, then it can create a window after
Widget::CloseAllSecondaryWidgets() has been called on the shutdown path,
which otherwise would have mopped up the app launcher resources.

Checking browser_shutdown::IsTryingToQuit ensures the app launcher
window won't be created after Widget::CloseAllSecondaryWidgets() would
have been called during shutdown.

BUG=333350

Review URL: https://codereview.chromium.org/149323002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247906 0039d316-1c4b-4281-b951-d872f2087c98
parent 3aaa5b05
......@@ -23,6 +23,7 @@
#include "base/win/windows_version.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
......@@ -507,8 +508,10 @@ void AppListServiceWin::ScheduleWarmup() {
}
bool AppListServiceWin::IsWarmupNeeded() {
if (!g_browser_process || g_browser_process->IsShuttingDown())
if (!g_browser_process || g_browser_process->IsShuttingDown() ||
browser_shutdown::IsTryingToQuit()) {
return false;
}
// We only need to initialize the view if there's no view already created and
// there's no profile loading to be shown.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment