| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| 11 #include <list> | 11 #include <list> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/message_pump.h" | 14 #include "base/message_pump.h" |
| 15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
| 16 #include "base/scoped_handle.h" | |
| 17 #include "base/time.h" | 16 #include "base/time.h" |
| 17 #include "base/win/scoped_handle.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 | 20 |
| 21 // MessagePumpWin serves as the base for specialized versions of the MessagePump | 21 // MessagePumpWin serves as the base for specialized versions of the MessagePump |
| 22 // for Windows. It provides basic functionality like handling of observers and | 22 // for Windows. It provides basic functionality like handling of observers and |
| 23 // controlling the lifetime of the message pump. | 23 // controlling the lifetime of the message pump. |
| 24 class MessagePumpWin : public MessagePump { | 24 class MessagePumpWin : public MessagePump { |
| 25 public: | 25 public: |
| 26 // An Observer is an object that receives global notifications from the | 26 // An Observer is an object that receives global notifications from the |
| 27 // UI MessageLoop. | 27 // UI MessageLoop. |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 | 349 |
| 350 virtual void DoRunLoop(); | 350 virtual void DoRunLoop(); |
| 351 void WaitForWork(); | 351 void WaitForWork(); |
| 352 bool MatchCompletedIOItem(IOHandler* filter, IOItem* item); | 352 bool MatchCompletedIOItem(IOHandler* filter, IOItem* item); |
| 353 bool GetIOItem(DWORD timeout, IOItem* item); | 353 bool GetIOItem(DWORD timeout, IOItem* item); |
| 354 bool ProcessInternalIOItem(const IOItem& item); | 354 bool ProcessInternalIOItem(const IOItem& item); |
| 355 void WillProcessIOEvent(); | 355 void WillProcessIOEvent(); |
| 356 void DidProcessIOEvent(); | 356 void DidProcessIOEvent(); |
| 357 | 357 |
| 358 // The completion port associated with this thread. | 358 // The completion port associated with this thread. |
| 359 ScopedHandle port_; | 359 win::ScopedHandle port_; |
| 360 // This list will be empty almost always. It stores IO completions that have | 360 // This list will be empty almost always. It stores IO completions that have |
| 361 // not been delivered yet because somebody was doing cleanup. | 361 // not been delivered yet because somebody was doing cleanup. |
| 362 std::list<IOItem> completed_io_; | 362 std::list<IOItem> completed_io_; |
| 363 | 363 |
| 364 ObserverList<IOObserver> io_observers_; | 364 ObserverList<IOObserver> io_observers_; |
| 365 }; | 365 }; |
| 366 | 366 |
| 367 } // namespace base | 367 } // namespace base |
| 368 | 368 |
| 369 #endif // BASE_MESSAGE_PUMP_WIN_H_ | 369 #endif // BASE_MESSAGE_PUMP_WIN_H_ |
| OLD | NEW |