OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "base/message_pump_default.h" | 5 #include <stdbool.h> |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/mac/scoped_nsautorelease_pool.h" | 8 #include "base/mac/scoped_nsautorelease_pool.h" |
| 9 #include "base/message_pump.h" |
| 10 #include "base/message_pump_default.h" |
| 11 #include "base/synchronization/waitable_event.h" |
| 12 #include "base/time.h" |
9 | 13 |
10 namespace base { | 14 namespace base { |
11 | 15 |
12 MessagePumpDefault::MessagePumpDefault() | 16 MessagePumpDefault::MessagePumpDefault() |
13 : keep_running_(true), | 17 : keep_running_(true), |
14 event_(false, false) { | 18 event_(false, false) { |
15 } | 19 } |
16 | 20 |
17 void MessagePumpDefault::Run(Delegate* delegate) { | 21 void MessagePumpDefault::Run(Delegate* delegate) { |
18 DCHECK(keep_running_) << "Quit must have been called outside of Run!"; | 22 DCHECK(keep_running_) << "Quit must have been called outside of Run!"; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 73 |
70 void MessagePumpDefault::ScheduleDelayedWork( | 74 void MessagePumpDefault::ScheduleDelayedWork( |
71 const TimeTicks& delayed_work_time) { | 75 const TimeTicks& delayed_work_time) { |
72 // We know that we can't be blocked on Wait right now since this method can | 76 // We know that we can't be blocked on Wait right now since this method can |
73 // only be called on the same thread as Run, so we only need to update our | 77 // only be called on the same thread as Run, so we only need to update our |
74 // record of how long to sleep when we do sleep. | 78 // record of how long to sleep when we do sleep. |
75 delayed_work_time_ = delayed_work_time; | 79 delayed_work_time_ = delayed_work_time; |
76 } | 80 } |
77 | 81 |
78 } // namespace base | 82 } // namespace base |
OLD | NEW |