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_H_ | 5 #ifndef BASE_MESSAGE_LOOP_H_ |
6 #define BASE_MESSAGE_LOOP_H_ | 6 #define BASE_MESSAGE_LOOP_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
624 void AddIOObserver(IOObserver* io_observer) { | 624 void AddIOObserver(IOObserver* io_observer) { |
625 pump_io()->AddIOObserver(io_observer); | 625 pump_io()->AddIOObserver(io_observer); |
626 } | 626 } |
627 | 627 |
628 void RemoveIOObserver(IOObserver* io_observer) { | 628 void RemoveIOObserver(IOObserver* io_observer) { |
629 pump_io()->RemoveIOObserver(io_observer); | 629 pump_io()->RemoveIOObserver(io_observer); |
630 } | 630 } |
631 | 631 |
632 #if defined(OS_WIN) | 632 #if defined(OS_WIN) |
633 // Please see MessagePumpWin for definitions of these methods. | 633 // Please see MessagePumpWin for definitions of these methods. |
634 void RegisterIOHandler(HANDLE file_handle, IOHandler* handler); | 634 void RegisterIOHandler(HANDLE file, IOHandler* handler); |
635 bool RegisterJobObject(HANDLE job, IOHandler* handler); | |
jar (doing other things)
2012/08/11 02:30:01
Please add comment explaining that the return bool
alexeypa (please no reviews)
2012/08/13 15:15:14
Done.
jar (doing other things)
2012/08/15 23:42:03
I didn't see the added comments.
On 2012/08/13 15
alexeypa (please no reviews)
2012/08/15 23:55:50
rvargas@ asked me not to copy-paste documentation.
| |
635 bool WaitForIOCompletion(DWORD timeout, IOHandler* filter); | 636 bool WaitForIOCompletion(DWORD timeout, IOHandler* filter); |
636 | 637 |
637 protected: | 638 protected: |
638 // TODO(rvargas): Make this platform independent. | 639 // TODO(rvargas): Make this platform independent. |
639 base::MessagePumpForIO* pump_io() { | 640 base::MessagePumpForIO* pump_io() { |
640 return static_cast<base::MessagePumpForIO*>(pump_.get()); | 641 return static_cast<base::MessagePumpForIO*>(pump_.get()); |
641 } | 642 } |
642 | 643 |
643 #elif defined(OS_POSIX) | 644 #elif defined(OS_POSIX) |
644 // Please see MessagePumpLibevent for definition. | 645 // Please see MessagePumpLibevent for definition. |
(...skipping 10 matching lines...) Expand all Loading... | |
655 #endif // defined(OS_POSIX) | 656 #endif // defined(OS_POSIX) |
656 }; | 657 }; |
657 | 658 |
658 // Do not add any member variables to MessageLoopForIO! This is important b/c | 659 // Do not add any member variables to MessageLoopForIO! This is important b/c |
659 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 660 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
660 // data that you need should be stored on the MessageLoop's pump_ instance. | 661 // data that you need should be stored on the MessageLoop's pump_ instance. |
661 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 662 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
662 MessageLoopForIO_should_not_have_extra_member_variables); | 663 MessageLoopForIO_should_not_have_extra_member_variables); |
663 | 664 |
664 #endif // BASE_MESSAGE_LOOP_H_ | 665 #endif // BASE_MESSAGE_LOOP_H_ |
OLD | NEW |