| 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_MESSAGE_LOOP_MESSAGE_PUMP_H_ | 5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_H_ |
| 6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_H_ | 6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/message_loop/timer_slack.h" |
| 10 #include "base/threading/non_thread_safe.h" | 11 #include "base/threading/non_thread_safe.h" |
| 11 | 12 |
| 12 namespace base { | 13 namespace base { |
| 13 | 14 |
| 14 class TimeDelta; | 15 class TimeDelta; |
| 15 class TimeTicks; | 16 class TimeTicks; |
| 16 | 17 |
| 17 class BASE_EXPORT MessagePump : public NonThreadSafe { | 18 class BASE_EXPORT MessagePump : public NonThreadSafe { |
| 18 public: | 19 public: |
| 19 // Please see the comments above the Run method for an illustration of how | 20 // Please see the comments above the Run method for an illustration of how |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // Schedule a DoWork callback to happen reasonably soon. Does nothing if a | 128 // Schedule a DoWork callback to happen reasonably soon. Does nothing if a |
| 128 // DoWork callback is already scheduled. This method may be called from any | 129 // DoWork callback is already scheduled. This method may be called from any |
| 129 // thread. Once this call is made, DoWork should not be "starved" at least | 130 // thread. Once this call is made, DoWork should not be "starved" at least |
| 130 // until it returns a value of false. | 131 // until it returns a value of false. |
| 131 virtual void ScheduleWork() = 0; | 132 virtual void ScheduleWork() = 0; |
| 132 | 133 |
| 133 // Schedule a DoDelayedWork callback to happen at the specified time, | 134 // Schedule a DoDelayedWork callback to happen at the specified time, |
| 134 // cancelling any pending DoDelayedWork callback. This method may only be | 135 // cancelling any pending DoDelayedWork callback. This method may only be |
| 135 // used on the thread that called Run. | 136 // used on the thread that called Run. |
| 136 virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) = 0; | 137 virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) = 0; |
| 138 |
| 139 // Sets the timer slack to the specified value. |
| 140 virtual void SetTimerSlack(TimerSlack timer_slack); |
| 137 }; | 141 }; |
| 138 | 142 |
| 139 } // namespace base | 143 } // namespace base |
| 140 | 144 |
| 141 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_H_ | 145 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_H_ |
| OLD | NEW |