 Chromium Code Reviews
 Chromium Code Reviews Issue 2852333004:
  Fix possible deadlock during shutdown by not using the FILE thread.  (Closed)
    
  
    Issue 2852333004:
  Fix possible deadlock during shutdown by not using the FILE thread.  (Closed) 
  | Index: content/browser/browser_context.cc | 
| diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc | 
| index 8755124590014af25d76024faf890a1d113a9c76..a81eb503a9db451a577b22ffb60e81183a96bf51 100644 | 
| --- a/content/browser/browser_context.cc | 
| +++ b/content/browser/browser_context.cc | 
| @@ -21,6 +21,7 @@ | 
| #include "base/macros.h" | 
| #include "base/memory/ptr_util.h" | 
| #include "base/rand_util.h" | 
| +#include "base/task_scheduler/post_task.h" | 
| #include "base/threading/thread_task_runner_handle.h" | 
| #include "build/build_config.h" | 
| #include "content/browser/blob_storage/chrome_blob_storage_context.h" | 
| @@ -479,9 +480,16 @@ void BrowserContext::Initialize( | 
| if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 
| switches::kMojoLocalStorage)) { | 
| ServiceInfo info; | 
| + // TODO(mek): Use sequenced task runner rather than single thread task | 
| + // runner when mojo supports that. | 
| 
gab
2017/05/03 20:18:57
Add http://crbug.com/678155 for ease of searching.
 | 
| info.factory = | 
| base::Bind(&file::CreateFileService, | 
| - BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 
| + base::CreateSingleThreadTaskRunnerWithTraits( | 
| + base::TaskTraits() | 
| + .MayBlock() | 
| + .WithBaseSyncPrimitives() | 
| + .WithShutdownBehavior( | 
| + base::TaskShutdownBehavior::BLOCK_SHUTDOWN)), | 
| BrowserThread::GetTaskRunnerForThread(BrowserThread::DB)); | 
| connection->AddEmbeddedService(file::mojom::kServiceName, info); | 
| } |