| 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; | |
| 80 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, | 75 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 81 const Closure& task, | 76 const Closure& task, |
| 82 base::TimeDelta delay) = 0; | 77 base::TimeDelta delay) = 0; |
| 83 | 78 |
| 84 // Returns true if the current thread is a thread on which a task | 79 // Returns true if the current thread is a thread on which a task |
| 85 // may be run, and false if no task will be run on the current | 80 // may be run, and false if no task will be run on the current |
| 86 // thread. | 81 // thread. |
| 87 // | 82 // |
| 88 // It is valid for an implementation to always return true, or in | 83 // It is valid for an implementation to always return true, or in |
| 89 // general to use 'true' as a default value. | 84 // general to use 'true' as a default value. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 virtual void OnDestruct() const; | 145 virtual void OnDestruct() const; |
| 151 }; | 146 }; |
| 152 | 147 |
| 153 struct BASE_EXPORT TaskRunnerTraits { | 148 struct BASE_EXPORT TaskRunnerTraits { |
| 154 static void Destruct(const TaskRunner* task_runner); | 149 static void Destruct(const TaskRunner* task_runner); |
| 155 }; | 150 }; |
| 156 | 151 |
| 157 } // namespace base | 152 } // namespace base |
| 158 | 153 |
| 159 #endif // BASE_TASK_RUNNER_H_ | 154 #endif // BASE_TASK_RUNNER_H_ |
| OLD | NEW |