| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_LOOP_H_ | 5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
| 6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 bool persistent, | 594 bool persistent, |
| 595 MessagePumpLibevent::Mode mode, | 595 MessagePumpLibevent::Mode mode, |
| 596 MessagePumpLibevent::FileDescriptorWatcher* controller, | 596 MessagePumpLibevent::FileDescriptorWatcher* controller, |
| 597 MessagePumpLibevent::Watcher* delegate); | 597 MessagePumpLibevent::Watcher* delegate); |
| 598 #endif | 598 #endif |
| 599 }; | 599 }; |
| 600 | 600 |
| 601 // Do not add any member variables to MessageLoopForUI! This is important b/c | 601 // Do not add any member variables to MessageLoopForUI! This is important b/c |
| 602 // MessageLoopForUI is often allocated via MessageLoop(TYPE_UI). Any extra | 602 // MessageLoopForUI is often allocated via MessageLoop(TYPE_UI). Any extra |
| 603 // data that you need should be stored on the MessageLoop's pump_ instance. | 603 // data that you need should be stored on the MessageLoop's pump_ instance. |
| 604 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForUI), | 604 static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForUI), |
| 605 MessageLoopForUI_should_not_have_extra_member_variables); | 605 "MessageLoopForUI should not have extra member variables"); |
| 606 | 606 |
| 607 #endif // !defined(OS_NACL) | 607 #endif // !defined(OS_NACL) |
| 608 | 608 |
| 609 //----------------------------------------------------------------------------- | 609 //----------------------------------------------------------------------------- |
| 610 // MessageLoopForIO extends MessageLoop with methods that are particular to a | 610 // MessageLoopForIO extends MessageLoop with methods that are particular to a |
| 611 // MessageLoop instantiated with TYPE_IO. | 611 // MessageLoop instantiated with TYPE_IO. |
| 612 // | 612 // |
| 613 // This class is typically used like so: | 613 // This class is typically used like so: |
| 614 // MessageLoopForIO::current()->...call some method... | 614 // MessageLoopForIO::current()->...call some method... |
| 615 // | 615 // |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 Mode mode, | 675 Mode mode, |
| 676 FileDescriptorWatcher* controller, | 676 FileDescriptorWatcher* controller, |
| 677 Watcher* delegate); | 677 Watcher* delegate); |
| 678 #endif // defined(OS_IOS) || defined(OS_POSIX) | 678 #endif // defined(OS_IOS) || defined(OS_POSIX) |
| 679 #endif // !defined(OS_NACL_SFI) | 679 #endif // !defined(OS_NACL_SFI) |
| 680 }; | 680 }; |
| 681 | 681 |
| 682 // Do not add any member variables to MessageLoopForIO! This is important b/c | 682 // Do not add any member variables to MessageLoopForIO! This is important b/c |
| 683 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 683 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
| 684 // data that you need should be stored on the MessageLoop's pump_ instance. | 684 // data that you need should be stored on the MessageLoop's pump_ instance. |
| 685 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 685 static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
| 686 MessageLoopForIO_should_not_have_extra_member_variables); | 686 "MessageLoopForIO should not have extra member variables"); |
| 687 | 687 |
| 688 } // namespace base | 688 } // namespace base |
| 689 | 689 |
| 690 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 690 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
| OLD | NEW |