Commit c16fdebe authored by Sunny Sachanandani's avatar Sunny Sachanandani Committed by Commit Bot

Revert "Do not block shutdown for process launch on Windows"

This reverts commit 1a9c502d.

Reason for revert: Speculative revert to fix headless_browsertests hangs https://ci.chromium.org/buildbot/chromium.win/Win7%20Tests%20%281%29/79454

Original change's description:
> Do not block shutdown for process launch on Windows
> 
> Launching a process is racy with browser shutdown, and blocks it. So we
> see shutdown hangs when process launch takes a long time. This CL makes
> the process launcher use a CONTINUE_ON_SHUTDOWN instead of
> BLOCK_SHUTDOWN task on Windows where it's presumably safe to do so given
> no non-leaky globals are used, and based on local testing. This is not
> safe on Linux since the process launcher there uses SandboxHostLinux
> which is a non-leaky base::Singleton.
> 
> R=​brucedawson,gab
> BUG=830954
> 
> Change-Id: Ia8c5295924288819dcfdcc087d282a05e6ee7e55
> Reviewed-on: https://chromium-review.googlesource.com/1020720
> Reviewed-by: Antoine Labour <piman@chromium.org>
> Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#553294}

TBR=gab@chromium.org,sunnyps@chromium.org,brucedawson@chromium.org,piman@chromium.org

Change-Id: I4999a60d9f805fe441f416803dbb71fab8747f1b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 830954
Reviewed-on: https://chromium-review.googlesource.com/1026437Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553388}
parent d97939d2
...@@ -208,25 +208,13 @@ base::SingleThreadTaskRunner* GetProcessLauncherTaskRunner() { ...@@ -208,25 +208,13 @@ base::SingleThreadTaskRunner* GetProcessLauncherTaskRunner() {
launcher_task_runner( launcher_task_runner(
android::LauncherThread::GetMessageLoop()->task_runner()); android::LauncherThread::GetMessageLoop()->task_runner());
return (*launcher_task_runner).get(); return (*launcher_task_runner).get();
#else // defined(OS_ANDROID) #else // defined(OS_ANDROID)
// TODO(http://crbug.com/820200): Investigate whether we could use // TODO(http://crbug.com/820200): Investigate whether we could use
// SequencedTaskRunner on platforms other than Windows. // SequencedTaskRunner on platforms other than Windows.
// Do not block shutdown as process creation can take a while and be reported as
// a hang. This doesn't work on Linux because of SandboxHostLinux non-leaky
// singleton, so only enable this on Windows where the hang was reported, and
// it is safe to do so.
#if defined(OS_WIN)
constexpr base::TaskShutdownBehavior shutdown_behavior =
base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN;
#else
constexpr base::TaskShutdownBehavior shutdown_behavior =
base::TaskShutdownBehavior::BLOCK_SHUTDOWN;
#endif // defined(OS_WIN)
static base::LazySingleThreadTaskRunner launcher_task_runner = static base::LazySingleThreadTaskRunner launcher_task_runner =
LAZY_SINGLE_THREAD_TASK_RUNNER_INITIALIZER( LAZY_SINGLE_THREAD_TASK_RUNNER_INITIALIZER(
base::TaskTraits({base::MayBlock(), base::TaskPriority::USER_BLOCKING, base::TaskTraits({base::MayBlock(), base::TaskPriority::USER_BLOCKING,
shutdown_behavior}), base::TaskShutdownBehavior::BLOCK_SHUTDOWN}),
base::SingleThreadTaskRunnerThreadMode::DEDICATED); base::SingleThreadTaskRunnerThreadMode::DEDICATED);
return launcher_task_runner.Get().get(); return launcher_task_runner.Get().get();
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
......
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