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 #ifndef BASE_MESSAGE_PUMP_WIN_H_ | 5 #ifndef BASE_MESSAGE_PUMP_WIN_H_ |
6 #define BASE_MESSAGE_PUMP_WIN_H_ | 6 #define BASE_MESSAGE_PUMP_WIN_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // queue can provide, up to some fixed number (to avoid any infinite loops). | 117 // queue can provide, up to some fixed number (to avoid any infinite loops). |
118 void PumpOutPendingPaintMessages(); | 118 void PumpOutPendingPaintMessages(); |
119 | 119 |
120 // Like MessagePump::Run, but MSG objects are routed through dispatcher. | 120 // Like MessagePump::Run, but MSG objects are routed through dispatcher. |
121 void RunWithDispatcher(Delegate* delegate, Dispatcher* dispatcher); | 121 void RunWithDispatcher(Delegate* delegate, Dispatcher* dispatcher); |
122 | 122 |
123 // MessagePump methods: | 123 // MessagePump methods: |
124 virtual void Run(Delegate* delegate) { RunWithDispatcher(delegate, NULL); } | 124 virtual void Run(Delegate* delegate) { RunWithDispatcher(delegate, NULL); } |
125 virtual void Quit(); | 125 virtual void Quit(); |
126 virtual void ScheduleWork(); | 126 virtual void ScheduleWork(); |
127 virtual void ScheduleDelayedWork(const Time& delayed_work_time); | 127 virtual void ScheduleDelayedWork(const base::Time& delayed_work_time); |
128 | 128 |
129 protected: | 129 protected: |
130 struct RunState { | 130 struct RunState { |
131 Delegate* delegate; | 131 Delegate* delegate; |
132 Dispatcher* dispatcher; | 132 Dispatcher* dispatcher; |
133 | 133 |
134 // Used to flag that the current Run() invocation should return ASAP. | 134 // Used to flag that the current Run() invocation should return ASAP. |
135 bool should_quit; | 135 bool should_quit; |
136 | 136 |
137 // Used to count how many Run() invocations are on the stack. | 137 // Used to count how many Run() invocations are on the stack. |
(...skipping 10 matching lines...) Expand all Loading... |
148 bool ProcessMessageHelper(const MSG& msg); | 148 bool ProcessMessageHelper(const MSG& msg); |
149 bool ProcessPumpReplacementMessage(); | 149 bool ProcessPumpReplacementMessage(); |
150 int GetCurrentDelay() const; | 150 int GetCurrentDelay() const; |
151 | 151 |
152 // A hidden message-only window. | 152 // A hidden message-only window. |
153 HWND message_hwnd_; | 153 HWND message_hwnd_; |
154 | 154 |
155 ObserverList<Observer> observers_; | 155 ObserverList<Observer> observers_; |
156 | 156 |
157 // The time at which delayed work should run. | 157 // The time at which delayed work should run. |
158 Time delayed_work_time_; | 158 base::Time delayed_work_time_; |
159 | 159 |
160 // A boolean value used to indicate if there is a kMsgDoWork message pending | 160 // A boolean value used to indicate if there is a kMsgDoWork message pending |
161 // in the Windows Message queue. There is at most one such message, and it | 161 // in the Windows Message queue. There is at most one such message, and it |
162 // can drive execution of tasks when a native message pump is running. | 162 // can drive execution of tasks when a native message pump is running. |
163 LONG have_work_; | 163 LONG have_work_; |
164 | 164 |
165 // State for the current invocation of Run. | 165 // State for the current invocation of Run. |
166 RunState* state_; | 166 RunState* state_; |
167 }; | 167 }; |
168 | 168 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 std::vector<Watcher*> watchers_; | 243 std::vector<Watcher*> watchers_; |
244 | 244 |
245 // The completion port associated with this thread. | 245 // The completion port associated with this thread. |
246 ScopedHandle port_; | 246 ScopedHandle port_; |
247 }; | 247 }; |
248 | 248 |
249 } // namespace base | 249 } // namespace base |
250 | 250 |
251 #endif // BASE_MESSAGE_PUMP_WIN_H_ | 251 #endif // BASE_MESSAGE_PUMP_WIN_H_ |
252 | 252 |
OLD | NEW |