Clang roll script: fix error when GYP_DEFINES isn't defined
[chromium-blink-merge.git] / mojo / shell / task_runners.cc
blob119ccd1d1beecea713311b0478417fc90ef740af
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/message_loop/message_loop_proxy.h"
8 #include "base/threading/thread.h"
10 namespace mojo {
11 namespace shell {
12 namespace {
14 scoped_ptr<base::Thread> CreateIOThread(const char* name) {
15 scoped_ptr<base::Thread> thread(new base::Thread(name));
16 base::Thread::Options options;
17 options.message_loop_type = base::MessageLoop::TYPE_IO;
18 thread->StartWithOptions(options);
19 return thread.Pass();
22 } // namespace
24 TaskRunners::TaskRunners(base::SingleThreadTaskRunner* ui_runner)
25 : ui_runner_(ui_runner),
26 cache_thread_(CreateIOThread("cache_thread")),
27 io_thread_(CreateIOThread("io_thread")),
28 file_thread_(new base::Thread("file_thread")) {
29 file_thread_->Start();
32 TaskRunners::~TaskRunners() {
35 } // namespace shell
36 } // namespace mojo