OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TASK_RUNNER_H_ | 5 #ifndef BASE_TASK_RUNNER_H_ |
6 #define BASE_TASK_RUNNER_H_ | 6 #define BASE_TASK_RUNNER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/base_export.h" | 9 #include "base/base_export.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // | 65 // |
66 // Equivalent to PostDelayedTask(from_here, task, 0). | 66 // Equivalent to PostDelayedTask(from_here, task, 0). |
67 bool PostTask(const tracked_objects::Location& from_here, | 67 bool PostTask(const tracked_objects::Location& from_here, |
68 const Closure& task); | 68 const Closure& task); |
69 | 69 |
70 // Like PostTask, but tries to run the posted task only after | 70 // Like PostTask, but tries to run the posted task only after |
71 // |delay_ms| has passed. | 71 // |delay_ms| has passed. |
72 // | 72 // |
73 // It is valid for an implementation to ignore |delay_ms|; that is, | 73 // It is valid for an implementation to ignore |delay_ms|; that is, |
74 // to have PostDelayedTask behave the same as PostTask. | 74 // to have PostDelayedTask behave the same as PostTask. |
| 75 // |
| 76 // TODO(tedv): Make PostDelayedTask use TimeDelta instead. |
| 77 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 78 const Closure& task, |
| 79 int64 delay_ms) = 0; |
75 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, | 80 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, |
76 const Closure& task, | 81 const Closure& task, |
77 base::TimeDelta delay) = 0; | 82 base::TimeDelta delay) = 0; |
78 | 83 |
79 // Returns true if the current thread is a thread on which a task | 84 // Returns true if the current thread is a thread on which a task |
80 // may be run, and false if no task will be run on the current | 85 // may be run, and false if no task will be run on the current |
81 // thread. | 86 // thread. |
82 // | 87 // |
83 // It is valid for an implementation to always return true, or in | 88 // It is valid for an implementation to always return true, or in |
84 // general to use 'true' as a default value. | 89 // general to use 'true' as a default value. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 virtual void OnDestruct() const; | 150 virtual void OnDestruct() const; |
146 }; | 151 }; |
147 | 152 |
148 struct BASE_EXPORT TaskRunnerTraits { | 153 struct BASE_EXPORT TaskRunnerTraits { |
149 static void Destruct(const TaskRunner* task_runner); | 154 static void Destruct(const TaskRunner* task_runner); |
150 }; | 155 }; |
151 | 156 |
152 } // namespace base | 157 } // namespace base |
153 | 158 |
154 #endif // BASE_TASK_RUNNER_H_ | 159 #endif // BASE_TASK_RUNNER_H_ |
OLD | NEW |