| 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/message_loop/timer_slack.h" | 9 #include "base/message_loop/timer_slack.h" |
| 10 #include "base/threading/non_thread_safe.h" | 10 #include "base/sequence_checker.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 | 13 |
| 14 class TimeTicks; | 14 class TimeTicks; |
| 15 | 15 |
| 16 class BASE_EXPORT MessagePump : public NonThreadSafe { | 16 class BASE_EXPORT MessagePump { |
| 17 public: | 17 public: |
| 18 // Please see the comments above the Run method for an illustration of how | 18 // Please see the comments above the Run method for an illustration of how |
| 19 // these delegate methods are used. | 19 // these delegate methods are used. |
| 20 class BASE_EXPORT Delegate { | 20 class BASE_EXPORT Delegate { |
| 21 public: | 21 public: |
| 22 virtual ~Delegate() {} | 22 virtual ~Delegate() {} |
| 23 | 23 |
| 24 // Called from within Run in response to ScheduleWork or when the message | 24 // Called from within Run in response to ScheduleWork or when the message |
| 25 // pump would otherwise call DoDelayedWork. Returns true to indicate that | 25 // pump would otherwise call DoDelayedWork. Returns true to indicate that |
| 26 // work was done. DoDelayedWork will still be called if DoWork returns | 26 // work was done. DoDelayedWork will still be called if DoWork returns |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // used on the thread that called Run. | 122 // used on the thread that called Run. |
| 123 virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) = 0; | 123 virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) = 0; |
| 124 | 124 |
| 125 // Sets the timer slack to the specified value. | 125 // Sets the timer slack to the specified value. |
| 126 virtual void SetTimerSlack(TimerSlack timer_slack); | 126 virtual void SetTimerSlack(TimerSlack timer_slack); |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 } // namespace base | 129 } // namespace base |
| 130 | 130 |
| 131 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_H_ | 131 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_H_ |
| OLD | NEW |