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

Side by Side Diff: base/task_scheduler/task_traits_for_current_thread.h

Issue 2546773002: TaskScheduler: Add internal::GetTaskPriorityForCurrentThread(). (Closed)
Patch Set: self-review Created 4 years 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
OLDNEW
(Empty)
1 // Copyright 2016 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 #ifndef BASE_TASK_SCHEDULER_CURRENT_TASK_TRAITS_H_
6 #define BASE_TASK_SCHEDULER_CURRENT_TASK_TRAITS_H_
7
8 #include "base/base_export.h"
9 #include "base/logging.h"
10 #include "base/macros.h"
11
12 namespace base {
13
14 class TaskTraits;
15
16 namespace internal {
17
18 class BASE_EXPORT ScopedSetTaskTraitsForCurrentThread {
19 public:
20 // Within the scope of this object, GetTaskTraitsForCurrentThread() will
21 // return |traits|.
22 ScopedSetTaskTraitsForCurrentThread(const TaskTraits* traits);
23 ~ScopedSetTaskTraitsForCurrentThread();
24
25 private:
26 #if DCHECK_IS_ON()
27 const TaskTraits* const traits_;
28 #endif
29
30 DISALLOW_COPY_AND_ASSIGN(ScopedSetTaskTraitsForCurrentThread);
31 };
32
33 // Returns the TaskTraits of the task running on the current thread.
34 BASE_EXPORT const TaskTraits* GetTaskTraitsForCurrentThread();
35
36 } // namespace internal
37 } // namespace base
38
39 #endif // BASE_TASK_SCHEDULER_CURRENT_TASK_TRAITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698