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

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

Issue 2546773002: TaskScheduler: Add internal::GetTaskPriorityForCurrentThread(). (Closed)
Patch Set: rename to scoped_set_task_priority_for_current_thread.h/cc 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
« no previous file with comments | « base/BUILD.gn ('k') | base/task_scheduler/scoped_set_task_priority_for_current_thread.cc » ('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 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_SCOPED_SET_TASK_PRIORITY_FOR_CURRENT_THREAD_H_
6 #define BASE_TASK_SCHEDULER_SCOPED_SET_TASK_PRIORITY_FOR_CURRENT_THREAD_H_
7
8 #include "base/base_export.h"
9 #include "base/macros.h"
10 #include "base/task_scheduler/task_traits.h"
11
12 namespace base {
13 namespace internal {
14
15 class BASE_EXPORT ScopedSetTaskPriorityForCurrentThread {
16 public:
17 // Within the scope of this object, GetTaskPriorityForCurrentThread() will
18 // return |priority|.
19 ScopedSetTaskPriorityForCurrentThread(TaskPriority priority);
20 ~ScopedSetTaskPriorityForCurrentThread();
21
22 private:
23 const TaskPriority priority_;
24
25 DISALLOW_COPY_AND_ASSIGN(ScopedSetTaskPriorityForCurrentThread);
26 };
27
28 // Returns the priority of the TaskScheduler task running on the current thread,
29 // or TaskPriority::USER_VISIBLE if no TaskScheduler task is running on the
30 // current thread.
31 BASE_EXPORT TaskPriority GetTaskPriorityForCurrentThread();
32
33 } // namespace internal
34 } // namespace base
35
36 #endif // BASE_TASK_SCHEDULER_SCOPED_SET_TASK_PRIORITY_FOR_CURRENT_THREAD_H_
OLDNEW
« no previous file with comments | « base/BUILD.gn ('k') | base/task_scheduler/scoped_set_task_priority_for_current_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698