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: base/threading/worker_pool.cc

Issue 1641513004: Update //base to chromium 9659b08ea5a34f889dc4166217f438095ddc10d2 (Closed) Base URL: git@github.com:domokit/mojo.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 | « base/threading/thread_unittest.cc ('k') | base/time/time_posix.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/threading/worker_pool.h" 5 #include "base/threading/worker_pool.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/debug/leak_annotations.h" 9 #include "base/debug/leak_annotations.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/task_runner.h" 11 #include "base/task_runner.h"
12 #include "base/threading/post_task_and_reply_impl.h" 12 #include "base/threading/post_task_and_reply_impl.h"
13 #include "base/tracked_objects.h" 13 #include "base/tracked_objects.h"
14 14
15 namespace base { 15 namespace base {
16 16
17 namespace { 17 namespace {
18 18
19 class PostTaskAndReplyWorkerPool : public internal::PostTaskAndReplyImpl { 19 class PostTaskAndReplyWorkerPool : public internal::PostTaskAndReplyImpl {
20 public: 20 public:
21 explicit PostTaskAndReplyWorkerPool(bool task_is_slow) 21 explicit PostTaskAndReplyWorkerPool(bool task_is_slow)
22 : task_is_slow_(task_is_slow) { 22 : task_is_slow_(task_is_slow) {
23 } 23 }
24 ~PostTaskAndReplyWorkerPool() override = default;
24 25
25 private: 26 private:
26 bool PostTask(const tracked_objects::Location& from_here, 27 bool PostTask(const tracked_objects::Location& from_here,
27 const Closure& task) override { 28 const Closure& task) override {
28 return WorkerPool::PostTask(from_here, task, task_is_slow_); 29 return WorkerPool::PostTask(from_here, task, task_is_slow_);
29 } 30 }
30 31
31 bool task_is_slow_; 32 bool task_is_slow_;
32 }; 33 };
33 34
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 from_here, task, reply); 116 from_here, task, reply);
116 } 117 }
117 118
118 // static 119 // static
119 const scoped_refptr<TaskRunner>& 120 const scoped_refptr<TaskRunner>&
120 WorkerPool::GetTaskRunner(bool tasks_are_slow) { 121 WorkerPool::GetTaskRunner(bool tasks_are_slow) {
121 return g_taskrunners.Get().taskrunners_[tasks_are_slow]; 122 return g_taskrunners.Get().taskrunners_[tasks_are_slow];
122 } 123 }
123 124
124 } // namespace base 125 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/thread_unittest.cc ('k') | base/time/time_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698