Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(684)

Unified Diff: content/browser/browser_context.cc

Issue 2852333004: Fix possible deadlock during shutdown by not using the FILE thread. (Closed)
Patch Set: temporary change to show problem with task scheduler shutdown Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
« no previous file with comments | « chrome/browser/extensions/extension_service_test_base.cc ('k') | content/browser/dom_storage/dom_storage_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698