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

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

Issue 2546773002: TaskScheduler: Add internal::GetTaskPriorityForCurrentThread(). (Closed)
Patch Set: traits -> priority 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_TASK_PRIORITY_FOR_CURRENT_THREAD_H_
6 #define BASE_TASK_SCHEDULER_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 {
robliao 2016/12/01 19:27:27 The file name should match the class. scoped_set_t
fdoray 2016/12/01 19:41:07 Even if this file also declares a GetTaskPriorityF
robliao 2016/12/01 20:08:57 That's the convention we've used so far. It goes w
fdoray 2016/12/01 20:23:36 Done.
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_TASK_PRIORITY_FOR_CURRENT_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698