[SyncFS] Build indexes from FileTracker entries on disk.
[chromium-blink-merge.git] / mojo / shell / task_runners.cc
blob573dca6ea298315cf1b07e62ac696de88654497d
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "mojo/shell/task_runners.h"
7 #include "base/threading/sequenced_worker_pool.h"
9 namespace mojo {
10 namespace shell {
12 namespace {
14 const size_t kMaxBlockingPoolThreads = 3;
16 scoped_ptr<base::Thread> CreateIOThread(const char* name) {
17 scoped_ptr<base::Thread> thread(new base::Thread(name));
18 base::Thread::Options options;
19 options.message_loop_type = base::MessageLoop::TYPE_IO;
20 thread->StartWithOptions(options);
21 return thread.Pass();
24 } // namespace
26 TaskRunners::TaskRunners(base::SingleThreadTaskRunner* ui_runner)
27 : ui_runner_(ui_runner),
28 io_thread_(CreateIOThread("io_thread")),
29 blocking_pool_(new base::SequencedWorkerPool(kMaxBlockingPoolThreads,
30 "blocking_pool")) {
33 TaskRunners::~TaskRunners() {
34 blocking_pool_->Shutdown();
37 } // namespace shell
38 } // namespace mojo