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

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

Issue 323593002: Mojo: Use network service to load non-local Mojo Apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « mojo/shell/task_runners.h ('k') | mojo/shell/url_request_context_getter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/shell/task_runners.h" 5 #include "mojo/shell/task_runners.h"
6 6
7 #include "base/threading/sequenced_worker_pool.h" 7 #include "base/threading/sequenced_worker_pool.h"
8 8
9 namespace mojo { 9 namespace mojo {
10 namespace shell { 10 namespace shell {
11 11
12 namespace { 12 namespace {
13 13
14 const size_t kMaxBlockingPoolThreads = 3; 14 const size_t kMaxBlockingPoolThreads = 3;
15 15
16 scoped_ptr<base::Thread> CreateIOThread(const char* name) { 16 scoped_ptr<base::Thread> CreateIOThread(const char* name) {
17 scoped_ptr<base::Thread> thread(new base::Thread(name)); 17 scoped_ptr<base::Thread> thread(new base::Thread(name));
18 base::Thread::Options options; 18 base::Thread::Options options;
19 options.message_loop_type = base::MessageLoop::TYPE_IO; 19 options.message_loop_type = base::MessageLoop::TYPE_IO;
20 thread->StartWithOptions(options); 20 thread->StartWithOptions(options);
21 return thread.Pass(); 21 return thread.Pass();
22 } 22 }
23 23
24 } // namespace 24 } // namespace
25 25
26 TaskRunners::TaskRunners(base::SingleThreadTaskRunner* ui_runner) 26 TaskRunners::TaskRunners(base::SingleThreadTaskRunner* ui_runner)
27 : ui_runner_(ui_runner), 27 : ui_runner_(ui_runner),
28 cache_thread_(CreateIOThread("cache_thread")),
29 io_thread_(CreateIOThread("io_thread")), 28 io_thread_(CreateIOThread("io_thread")),
30 file_thread_(new base::Thread("file_thread")),
31 blocking_pool_(new base::SequencedWorkerPool(kMaxBlockingPoolThreads, 29 blocking_pool_(new base::SequencedWorkerPool(kMaxBlockingPoolThreads,
32 "blocking_pool")) { 30 "blocking_pool")) {
33 file_thread_->Start();
34 } 31 }
35 32
36 TaskRunners::~TaskRunners() { 33 TaskRunners::~TaskRunners() {
37 blocking_pool_->Shutdown(); 34 blocking_pool_->Shutdown();
38 } 35 }
39 36
40 } // namespace shell 37 } // namespace shell
41 } // namespace mojo 38 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/task_runners.h ('k') | mojo/shell/url_request_context_getter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698