Commit 0471c669 authored by weiliangc's avatar weiliangc Committed by Commit bot

Add ScopedAllowWait to TaskGraphRunner to Avoid Crash in Shutdown

When shutting down, TaskGraphRunner will clear out tasks that are ready
to run and wait for running tasks to finish running. Wait is disallowed
in main thread and crashes in single thread impl-side painting.

R=danakj, jam, brettw
BUG=369653

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

Cr-Commit-Position: refs/heads/master@{#318265}
parent 7d13f84e
......@@ -22,6 +22,7 @@ class ScopedAllowWaitForLegacyWebViewApi;
namespace cc {
class CompletionEvent;
class TaskGraphRunner;
}
namespace chromeos {
class BlockingMethodCaller;
......@@ -177,6 +178,7 @@ class BASE_EXPORT ThreadRestrictions {
friend class ::HistogramSynchronizer;
friend class ::ScopedAllowWaitForLegacyWebViewApi;
friend class cc::CompletionEvent;
friend class cc::TaskGraphRunner;
friend class mojo::common::WatcherThreadManager;
friend class remoting::AutoThread;
friend class MessagePumpDefault;
......
......@@ -290,6 +290,7 @@ void TaskGraphRunner::WaitForTasksToFinishRunning(NamespaceToken token) {
{
base::AutoLock lock(lock_);
base::ThreadRestrictions::ScopedAllowWait allow_wait;
TaskNamespaceMap::const_iterator it = namespaces_.find(token.id_);
if (it == namespaces_.end())
......
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