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

Unified Diff: content/browser/browser_context.cc

Issue 2852333004: Fix possible deadlock during shutdown by not using the FILE thread. (Closed)
Patch Set: undo temporary change, and add comment linking to mojo bug 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 509baef956e1a3f77358aace528bdfe20057ac38..a834183d8b18007c6109feb5d4c41658cc2d663e 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"
@@ -480,9 +481,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 (http://crbug.com/678155).
info.factory =
base::Bind(&file::CreateFileService,
- BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
+ base::CreateSingleThreadTaskRunnerWithTraits(
+ base::TaskTraits()
gab 2017/05/08 17:14:32 See brand new way to specify TaskTraits as a bag i
Marijn Kruisselbrink 2017/05/08 18:18:01 Ah, nice. Done. The sample code in post_task.h sho
gab 2017/05/08 19:25:14 Ah oops looks like we forgot to update that, will
+ .MayBlock()
+ .WithBaseSyncPrimitives()
gab 2017/05/08 17:14:32 Do you really need WithBaseSyncPrimitives()? (see
Marijn Kruisselbrink 2017/05/08 18:18:01 Ah yes, it indeed seems that to signal on a waitab
+ .WithShutdownBehavior(
+ 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