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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 // this pump goes into a wait state. In most cases, this message pump handles | 71 // this pump goes into a wait state. In most cases, this message pump handles |
72 // all processing. | 72 // all processing. |
73 // | 73 // |
74 // However, when a task, or windows event, invokes on the stack a native dialog | 74 // However, when a task, or windows event, invokes on the stack a native dialog |
75 // box or such, that window typically provides a bare bones (native?) message | 75 // box or such, that window typically provides a bare bones (native?) message |
76 // pump. That bare-bones message pump generally supports little more than a | 76 // pump. That bare-bones message pump generally supports little more than a |
77 // peek of the Windows message queue, followed by a dispatch of the peeked | 77 // peek of the Windows message queue, followed by a dispatch of the peeked |
78 // message. MessageLoop extends that bare-bones message pump to also service | 78 // message. MessageLoop extends that bare-bones message pump to also service |
79 // Tasks, at the cost of some complexity. | 79 // Tasks, at the cost of some complexity. |
80 // | 80 // |
81 // The basic structure of the extension (refered to as a sub-pump) is that a | 81 // The basic structure of the extension (referred to as a sub-pump) is that a |
82 // special message, kMsgHaveWork, is repeatedly injected into the Windows | 82 // special message, kMsgHaveWork, is repeatedly injected into the Windows |
83 // Message queue. Each time the kMsgHaveWork message is peeked, checks are | 83 // Message queue. Each time the kMsgHaveWork message is peeked, checks are |
84 // made for an extended set of events, including the availability of Tasks to | 84 // made for an extended set of events, including the availability of Tasks to |
85 // run. | 85 // run. |
86 // | 86 // |
87 // After running a task, the special message kMsgHaveWork is again posted to | 87 // After running a task, the special message kMsgHaveWork is again posted to |
88 // the Windows Message queue, ensuring a future time slice for processing a | 88 // the Windows Message queue, ensuring a future time slice for processing a |
89 // future event. To prevent flooding the Windows Message queue, care is taken | 89 // future event. To prevent flooding the Windows Message queue, care is taken |
90 // to be sure that at most one kMsgHaveWork message is EVER pending in the | 90 // to be sure that at most one kMsgHaveWork message is EVER pending in the |
91 // Window's Message queue. | 91 // Window's Message queue. |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 // This list will be empty almost always. It stores IO completions that have | 332 // This list will be empty almost always. It stores IO completions that have |
333 // not been delivered yet because somebody was doing cleanup. | 333 // not been delivered yet because somebody was doing cleanup. |
334 std::list<IOItem> completed_io_; | 334 std::list<IOItem> completed_io_; |
335 | 335 |
336 ObserverList<IOObserver> io_observers_; | 336 ObserverList<IOObserver> io_observers_; |
337 }; | 337 }; |
338 | 338 |
339 } // namespace base | 339 } // namespace base |
340 | 340 |
341 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_WIN_H_ | 341 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_WIN_H_ |
OLD | NEW |