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

Side by Side Diff: shell/task_runners.cc

Issue 1408793006: Convert "return local_var.Pass();" to "return local_var;". (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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 | « shell/application_manager/network_fetcher.cc ('k') | no next file » | 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 "shell/task_runners.h" 5 #include "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 shell { 9 namespace shell {
10 10
11 namespace { 11 namespace {
12 12
13 const size_t kMaxBlockingPoolThreads = 3; 13 const size_t kMaxBlockingPoolThreads = 3;
14 14
15 scoped_ptr<base::Thread> CreateIOThread(const char* name) { 15 scoped_ptr<base::Thread> CreateIOThread(const char* name) {
16 scoped_ptr<base::Thread> thread(new base::Thread(name)); 16 scoped_ptr<base::Thread> thread(new base::Thread(name));
17 base::Thread::Options options; 17 base::Thread::Options options;
18 options.message_loop_type = base::MessageLoop::TYPE_IO; 18 options.message_loop_type = base::MessageLoop::TYPE_IO;
19 thread->StartWithOptions(options); 19 thread->StartWithOptions(options);
20 return thread.Pass(); 20 return thread;
21 } 21 }
22 22
23 } // namespace 23 } // namespace
24 24
25 TaskRunners::TaskRunners( 25 TaskRunners::TaskRunners(
26 const scoped_refptr<base::SingleThreadTaskRunner>& shell_runner) 26 const scoped_refptr<base::SingleThreadTaskRunner>& shell_runner)
27 : shell_runner_(shell_runner), 27 : shell_runner_(shell_runner),
28 io_thread_(CreateIOThread("io_thread")), 28 io_thread_(CreateIOThread("io_thread")),
29 blocking_pool_(new base::SequencedWorkerPool(kMaxBlockingPoolThreads, 29 blocking_pool_(new base::SequencedWorkerPool(kMaxBlockingPoolThreads,
30 "blocking_pool")) { 30 "blocking_pool")) {
31 } 31 }
32 32
33 TaskRunners::~TaskRunners() { 33 TaskRunners::~TaskRunners() {
34 blocking_pool_->Shutdown(); 34 blocking_pool_->Shutdown();
35 } 35 }
36 36
37 } // namespace shell 37 } // namespace shell
OLDNEW
« no previous file with comments | « shell/application_manager/network_fetcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698