OLD | NEW |
1 // Copyright (c) 2011 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 |
(...skipping 25 matching lines...) Expand all Loading... |
36 // from Dispatch. | 36 // from Dispatch. |
37 class BASE_EXPORT Dispatcher { | 37 class BASE_EXPORT Dispatcher { |
38 public: | 38 public: |
39 virtual ~Dispatcher() {} | 39 virtual ~Dispatcher() {} |
40 // Dispatches the event. If true is returned processing continues as | 40 // Dispatches the event. If true is returned processing continues as |
41 // normal. If false is returned, the nested loop exits immediately. | 41 // normal. If false is returned, the nested loop exits immediately. |
42 virtual bool Dispatch(const MSG& msg) = 0; | 42 virtual bool Dispatch(const MSG& msg) = 0; |
43 }; | 43 }; |
44 | 44 |
45 MessagePumpWin() : have_work_(0), state_(NULL) {} | 45 MessagePumpWin() : have_work_(0), state_(NULL) {} |
46 virtual ~MessagePumpWin() {} | 46 virtual ~MessagePumpWin(); |
47 | 47 |
48 // Add an Observer, which will start receiving notifications immediately. | 48 // Add an Observer, which will start receiving notifications immediately. |
49 void AddObserver(MessagePumpObserver* observer); | 49 void AddObserver(MessagePumpObserver* observer); |
50 | 50 |
51 // Remove an Observer. It is safe to call this method while an Observer is | 51 // Remove an Observer. It is safe to call this method while an Observer is |
52 // receiving a notification callback. | 52 // receiving a notification callback. |
53 void RemoveObserver(MessagePumpObserver* observer); | 53 void RemoveObserver(MessagePumpObserver* observer); |
54 | 54 |
55 // Give a chance to code processing additional messages to notify the | 55 // Give a chance to code processing additional messages to notify the |
56 // message loop observers that another message has been processed. | 56 // message loop observers that another message has been processed. |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 // This list will be empty almost always. It stores IO completions that have | 345 // This list will be empty almost always. It stores IO completions that have |
346 // not been delivered yet because somebody was doing cleanup. | 346 // not been delivered yet because somebody was doing cleanup. |
347 std::list<IOItem> completed_io_; | 347 std::list<IOItem> completed_io_; |
348 | 348 |
349 ObserverList<IOObserver> io_observers_; | 349 ObserverList<IOObserver> io_observers_; |
350 }; | 350 }; |
351 | 351 |
352 } // namespace base | 352 } // namespace base |
353 | 353 |
354 #endif // BASE_MESSAGE_PUMP_WIN_H_ | 354 #endif // BASE_MESSAGE_PUMP_WIN_H_ |
OLD | NEW |