| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef BASE_MESSAGE_LOOP_INCOMING_TASK_QUEUE_H_ | 5 #ifndef BASE_MESSAGE_LOOP_INCOMING_TASK_QUEUE_H_ |
| 6 #define BASE_MESSAGE_LOOP_INCOMING_TASK_QUEUE_H_ | 6 #define BASE_MESSAGE_LOOP_INCOMING_TASK_QUEUE_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 explicit IncomingTaskQueue(MessageLoop* message_loop); | 29 explicit IncomingTaskQueue(MessageLoop* message_loop); |
| 30 | 30 |
| 31 // Appends a task to the incoming queue. Posting of all tasks is routed though | 31 // Appends a task to the incoming queue. Posting of all tasks is routed though |
| 32 // AddToIncomingQueue() or TryAddToIncomingQueue() to make sure that posting | 32 // AddToIncomingQueue() or TryAddToIncomingQueue() to make sure that posting |
| 33 // task is properly synchronized between different threads. | 33 // task is properly synchronized between different threads. |
| 34 // | 34 // |
| 35 // Returns true if the task was successfully added to the queue, otherwise | 35 // Returns true if the task was successfully added to the queue, otherwise |
| 36 // returns false. In all cases, the ownership of |task| is transferred to the | 36 // returns false. In all cases, the ownership of |task| is transferred to the |
| 37 // called method. | 37 // called method. |
| 38 bool AddToIncomingQueue(const tracked_objects::Location& from_here, | 38 bool AddToIncomingQueue(const tracked_objects::Location& from_here, |
| 39 const Closure& task, | 39 OnceClosure task, |
| 40 TimeDelta delay, | 40 TimeDelta delay, |
| 41 bool nestable); | 41 bool nestable); |
| 42 | 42 |
| 43 // Returns true if the queue contains tasks that require higher than default | 43 // Returns true if the queue contains tasks that require higher than default |
| 44 // timer resolution. Currently only needed for Windows. | 44 // timer resolution. Currently only needed for Windows. |
| 45 bool HasHighResolutionTasks(); | 45 bool HasHighResolutionTasks(); |
| 46 | 46 |
| 47 // Returns true if the message loop is "idle". Provided for testing. | 47 // Returns true if the message loop is "idle". Provided for testing. |
| 48 bool IsIdleForTesting(); | 48 bool IsIdleForTesting(); |
| 49 | 49 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // False until StartScheduling() is called. | 106 // False until StartScheduling() is called. |
| 107 bool is_ready_for_scheduling_; | 107 bool is_ready_for_scheduling_; |
| 108 | 108 |
| 109 DISALLOW_COPY_AND_ASSIGN(IncomingTaskQueue); | 109 DISALLOW_COPY_AND_ASSIGN(IncomingTaskQueue); |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 } // namespace internal | 112 } // namespace internal |
| 113 } // namespace base | 113 } // namespace base |
| 114 | 114 |
| 115 #endif // BASE_MESSAGE_LOOP_INCOMING_TASK_QUEUE_H_ | 115 #endif // BASE_MESSAGE_LOOP_INCOMING_TASK_QUEUE_H_ |
| OLD | NEW |