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

Unified Diff: content/browser/browser_context.cc

Issue 2852333004: Fix possible deadlock during shutdown by not using the FILE thread. (Closed)
Patch Set: use new way of specifying task traits Created 3 years, 7 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
« no previous file with comments | « no previous file | content/browser/dom_storage/dom_storage_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_context.cc
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index 3f68fd7ddb74ddb39d146c12e7841884b94b6507..f0ec2ff7a4ae258d0f641fd384d3ce1ded640138 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"
@@ -481,10 +482,13 @@ void BrowserContext::Initialize(
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kMojoLocalStorage)) {
ServiceInfo info;
- info.factory =
- base::Bind(&file::CreateFileService,
- BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
- BrowserThread::GetTaskRunnerForThread(BrowserThread::DB));
+ // TODO(mek): Use sequenced task runner rather than single thread task
+ // runner when mojo supports that (http://crbug.com/678155).
+ info.factory = base::Bind(
+ &file::CreateFileService,
+ base::CreateSingleThreadTaskRunnerWithTraits(
+ {base::MayBlock(), base::TaskShutdownBehavior::BLOCK_SHUTDOWN}),
+ BrowserThread::GetTaskRunnerForThread(BrowserThread::DB));
connection->AddEmbeddedService(file::mojom::kServiceName, info);
}
« no previous file with comments | « no previous file | content/browser/dom_storage/dom_storage_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698