Commit fdb3061c authored by Will Harris's avatar Will Harris Committed by Commit Bot

Always set shutdown parameters for child processes.

This CL sets the shutdown parameters of child processes regardless of
whether the build is Google Chrome or Chromium. This fixes the issue
where sad tabs might briefly appear during logoff/shutdown on
Chromium builds.

BUG=1043938
TEST=load tabs in Chromium, log off user, check no sad tabs appear.

Change-Id: I488f3d276a4ea93892527c39561d15a64e247127
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2025771Reviewed-by: default avatarGreg Thompson <grt@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736569}
parent 4d20c3b8
......@@ -197,6 +197,15 @@ int MainDllLoader::Launch(HINSTANCE instance,
if (!dll_)
return chrome::RESULT_CODE_MISSING_DATA;
if (!is_browser) {
// Set non-browser processes up to be killed by the system after the
// browser goes away. The browser uses the default shutdown order, which
// is 0x280. Note that lower numbers here denote "kill later" and higher
// numbers mean "kill sooner". This gets rid of most of those unsightly
// sad tabs on logout and shutdown.
::SetProcessShutdownParameters(0x280 - 1, SHUTDOWN_NORETRY);
}
OnBeforeLaunch(cmd_line, process_type_, file);
DLL_MAIN chrome_main =
reinterpret_cast<DLL_MAIN>(::GetProcAddress(dll_, "ChromeMain"));
......@@ -251,13 +260,6 @@ void ChromeDllLoader::OnBeforeLaunch(const base::CommandLine& cmd_line,
base::Bind(&GenerateChromeWatcherCommandLine, exe_path)));
chrome_watcher_client_->LaunchWatcher();
}
} else {
// Set non-browser processes up to be killed by the system after the browser
// goes away. The browser uses the default shutdown order, which is 0x280.
// Note that lower numbers here denote "kill later" and higher numbers mean
// "kill sooner".
// This gets rid of most of those unsighly sad tabs on logout and shutdown.
::SetProcessShutdownParameters(0x280 - 1, SHUTDOWN_NORETRY);
}
}
......
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