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 24 matching lines...) Expand all Loading... |
35 #if defined(USE_AURA) && defined(USE_X11) && !defined(OS_NACL) | 35 #if defined(USE_AURA) && defined(USE_X11) && !defined(OS_NACL) |
36 #include "base/message_pump_aurax11.h" | 36 #include "base/message_pump_aurax11.h" |
37 #else | 37 #else |
38 #include "base/message_pump_gtk.h" | 38 #include "base/message_pump_gtk.h" |
39 #endif | 39 #endif |
40 | 40 |
41 #endif | 41 #endif |
42 #endif | 42 #endif |
43 | 43 |
44 namespace base { | 44 namespace base { |
| 45 |
45 class HistogramBase; | 46 class HistogramBase; |
46 class RunLoop; | 47 class RunLoop; |
47 class ThreadTaskRunnerHandle; | 48 class ThreadTaskRunnerHandle; |
48 #if defined(OS_ANDROID) | 49 #if defined(OS_ANDROID) |
49 class MessagePumpForUI; | 50 class MessagePumpForUI; |
50 #endif | 51 #endif |
51 } // namespace base | |
52 | 52 |
53 // A MessageLoop is used to process events for a particular thread. There is | 53 // A MessageLoop is used to process events for a particular thread. There is |
54 // at most one MessageLoop instance per thread. | 54 // at most one MessageLoop instance per thread. |
55 // | 55 // |
56 // Events include at a minimum Task instances submitted to PostTask and its | 56 // Events include at a minimum Task instances submitted to PostTask and its |
57 // variants. Depending on the type of message pump used by the MessageLoop | 57 // variants. Depending on the type of message pump used by the MessageLoop |
58 // other events such as UI messages may be processed. On Windows APC calls (as | 58 // other events such as UI messages may be processed. On Windows APC calls (as |
59 // time permits) and signals sent to a registered set of HANDLEs may also be | 59 // time permits) and signals sent to a registered set of HANDLEs may also be |
60 // processed. | 60 // processed. |
61 // | 61 // |
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 } | 698 } |
699 #endif // defined(OS_POSIX) | 699 #endif // defined(OS_POSIX) |
700 }; | 700 }; |
701 | 701 |
702 // Do not add any member variables to MessageLoopForIO! This is important b/c | 702 // Do not add any member variables to MessageLoopForIO! This is important b/c |
703 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 703 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
704 // data that you need should be stored on the MessageLoop's pump_ instance. | 704 // data that you need should be stored on the MessageLoop's pump_ instance. |
705 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 705 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
706 MessageLoopForIO_should_not_have_extra_member_variables); | 706 MessageLoopForIO_should_not_have_extra_member_variables); |
707 | 707 |
| 708 } // namespace base |
| 709 |
| 710 // TODO(brettw) remove this when all users are updated to explicitly use the |
| 711 // namespace |
| 712 using base::MessageLoop; |
| 713 using base::MessageLoopForIO; |
| 714 using base::MessageLoopForUI; |
| 715 |
708 #endif // BASE_MESSAGE_LOOP_H_ | 716 #endif // BASE_MESSAGE_LOOP_H_ |
OLD | NEW |