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

Side by Side Diff: mojo/runner/task_runners.cc

Issue 1630823002: Move mojo/runner to mojo/shell/standalone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « mojo/runner/task_runners.h ('k') | mojo/runner/test/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #include "mojo/runner/task_runners.h"
6
7 #include <stddef.h>
8
9 #include "base/threading/sequenced_worker_pool.h"
10
11 namespace mojo {
12 namespace runner {
13
14 namespace {
15
16 const size_t kMaxBlockingPoolThreads = 3;
17
18 scoped_ptr<base::Thread> CreateIOThread(const char* name) {
19 scoped_ptr<base::Thread> thread(new base::Thread(name));
20 base::Thread::Options options;
21 options.message_loop_type = base::MessageLoop::TYPE_IO;
22 thread->StartWithOptions(options);
23 return thread;
24 }
25
26 } // namespace
27
28 TaskRunners::TaskRunners(
29 const scoped_refptr<base::SingleThreadTaskRunner>& shell_runner)
30 : shell_runner_(shell_runner),
31 io_thread_(CreateIOThread("io_thread")),
32 blocking_pool_(new base::SequencedWorkerPool(kMaxBlockingPoolThreads,
33 "blocking_pool")) {
34 }
35
36 TaskRunners::~TaskRunners() {
37 blocking_pool_->Shutdown();
38 }
39
40 } // namespace runner
41 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/runner/task_runners.h ('k') | mojo/runner/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698