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_WIN_H_ | 5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_WIN_H_ |
6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_WIN_H_ | 6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override; | 165 void ScheduleDelayedWork(const TimeTicks& delayed_work_time) override; |
166 | 166 |
167 private: | 167 private: |
168 // MessagePumpWin methods: | 168 // MessagePumpWin methods: |
169 void DoRunLoop() override; | 169 void DoRunLoop() override; |
170 | 170 |
171 void WaitForWork(); | 171 void WaitForWork(); |
172 bool ProcessNextMessage(); | 172 bool ProcessNextMessage(); |
173 | 173 |
174 const HANDLE event_; | 174 const HANDLE event_; |
| 175 |
| 176 // Used to help diagnose hangs. |
| 177 // TODO(stanisc): crbug.com/596190: Remove these once the bug is fixed. |
| 178 TimeTicks last_set_event_timeticks_; |
175 }; | 179 }; |
176 | 180 |
177 //----------------------------------------------------------------------------- | 181 //----------------------------------------------------------------------------- |
178 // MessagePumpForIO extends MessagePumpWin with methods that are particular to a | 182 // MessagePumpForIO extends MessagePumpWin with methods that are particular to a |
179 // MessageLoop instantiated with TYPE_IO. This version of MessagePump does not | 183 // MessageLoop instantiated with TYPE_IO. This version of MessagePump does not |
180 // deal with Windows mesagges, and instead has a Run loop based on Completion | 184 // deal with Windows mesagges, and instead has a Run loop based on Completion |
181 // Ports so it is better suited for IO operations. | 185 // Ports so it is better suited for IO operations. |
182 // | 186 // |
183 class BASE_EXPORT MessagePumpForIO : public MessagePumpWin { | 187 class BASE_EXPORT MessagePumpForIO : public MessagePumpWin { |
184 public: | 188 public: |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 // The completion port associated with this thread. | 284 // The completion port associated with this thread. |
281 win::ScopedHandle port_; | 285 win::ScopedHandle port_; |
282 // This list will be empty almost always. It stores IO completions that have | 286 // This list will be empty almost always. It stores IO completions that have |
283 // not been delivered yet because somebody was doing cleanup. | 287 // not been delivered yet because somebody was doing cleanup. |
284 std::list<IOItem> completed_io_; | 288 std::list<IOItem> completed_io_; |
285 }; | 289 }; |
286 | 290 |
287 } // namespace base | 291 } // namespace base |
288 | 292 |
289 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_WIN_H_ | 293 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_WIN_H_ |
OLD | NEW |