OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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_MESSAGE_LOOP_HIGH_PRIORITY_TASK_RUNNER_H_ |
| 6 #define BASE_MESSAGE_LOOP_HIGH_PRIORITY_TASK_RUNNER_H_ |
| 7 |
| 8 #include "base/base_export.h" |
| 9 #include "base/callback_forward.h" |
| 10 #include "base/memory/ref_counted.h" |
| 11 |
| 12 namespace tracked_objects { |
| 13 class Location; |
| 14 } // namespace tracked_objects |
| 15 |
| 16 namespace base { |
| 17 |
| 18 namespace internal { |
| 19 class IncomingTaskQueue; |
| 20 } |
| 21 |
| 22 class MessageLoop; |
| 23 class TaskQueue; |
| 24 |
| 25 class BASE_EXPORT HighPriorityTaskRunner |
| 26 : public RefCountedThreadSafe<HighPriorityTaskRunner> { |
| 27 public: |
| 28 explicit HighPriorityTaskRunner(MessageLoop* message_loop); |
| 29 |
| 30 void PostTask(const tracked_objects::Location& from_here, |
| 31 const Closure& task); |
| 32 |
| 33 void ReloadWorkQueue(TaskQueue* target_work_queue); |
| 34 |
| 35 private: |
| 36 friend class RefCountedThreadSafe<HighPriorityTaskRunner>; |
| 37 |
| 38 virtual ~HighPriorityTaskRunner(); |
| 39 |
| 40 scoped_refptr<internal::IncomingTaskQueue> incoming_queue_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(HighPriorityTaskRunner); |
| 43 }; |
| 44 |
| 45 } // namespace base |
| 46 |
| 47 #endif // BASE_MESSAGE_LOOP_HIGH_PRIORITY_TASK_RUNNER_H_ |
OLD | NEW |