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 20 matching lines...) Expand all Loading... | |
31 #elif defined(OS_IOS) | 31 #elif defined(OS_IOS) |
32 #include "base/message_loop/message_pump_io_ios.h" | 32 #include "base/message_loop/message_pump_io_ios.h" |
33 #elif defined(OS_POSIX) | 33 #elif defined(OS_POSIX) |
34 #include "base/message_loop/message_pump_libevent.h" | 34 #include "base/message_loop/message_pump_libevent.h" |
35 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 35 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
36 | 36 |
37 #if defined(USE_AURA) && defined(USE_X11) && !defined(OS_NACL) | 37 #if defined(USE_AURA) && defined(USE_X11) && !defined(OS_NACL) |
38 #include "base/message_loop/message_pump_x11.h" | 38 #include "base/message_loop/message_pump_x11.h" |
39 #elif defined(USE_OZONE) && !defined(OS_NACL) | 39 #elif defined(USE_OZONE) && !defined(OS_NACL) |
40 #include "base/message_loop/message_pump_ozone.h" | 40 #include "base/message_loop/message_pump_ozone.h" |
41 #elif defined(CHROMECAST_BUILD) | |
darin (slow to review)
2014/04/14 04:52:30
For this CL, it seems sensible to instead draft be
lcwu1
2014/04/15 06:32:33
Since Chromecast doesn't have or care user input e
| |
42 #include "base/message_loop/message_pump_default.h" | |
41 #elif !defined(OS_ANDROID_HOST) | 43 #elif !defined(OS_ANDROID_HOST) |
42 #define USE_GTK_MESSAGE_PUMP | 44 #define USE_GTK_MESSAGE_PUMP |
43 #include "base/message_loop/message_pump_gtk.h" | 45 #include "base/message_loop/message_pump_gtk.h" |
44 #if defined(TOOLKIT_GTK) | 46 #if defined(TOOLKIT_GTK) |
45 #include "base/message_loop/message_pump_x11.h" | 47 #include "base/message_loop/message_pump_x11.h" |
46 #endif | 48 #endif |
47 #endif | 49 #endif |
48 | 50 |
49 #endif | 51 #endif |
50 #endif | 52 #endif |
51 | 53 |
52 namespace base { | 54 namespace base { |
53 | 55 |
54 class HistogramBase; | 56 class HistogramBase; |
55 class MessagePumpObserver; | 57 class MessagePumpObserver; |
56 class RunLoop; | 58 class RunLoop; |
57 class ThreadTaskRunnerHandle; | 59 class ThreadTaskRunnerHandle; |
58 #if defined(OS_ANDROID) | 60 #if defined(OS_ANDROID) |
59 class MessagePumpForUI; | 61 class MessagePumpForUI; |
60 #elif defined(OS_ANDROID_HOST) | 62 #elif defined(OS_ANDROID_HOST) |
61 typedef MessagePumpLibevent MessagePumpForUI; | 63 typedef MessagePumpLibevent MessagePumpForUI; |
64 #elif defined(CHROMECAST_BUILD) | |
65 typedef MessagePumpDefault MessagePumpForUI; | |
62 #endif | 66 #endif |
63 class WaitableEvent; | 67 class WaitableEvent; |
64 | 68 |
65 // A MessageLoop is used to process events for a particular thread. There is | 69 // A MessageLoop is used to process events for a particular thread. There is |
66 // at most one MessageLoop instance per thread. | 70 // at most one MessageLoop instance per thread. |
67 // | 71 // |
68 // Events include at a minimum Task instances submitted to PostTask and its | 72 // Events include at a minimum Task instances submitted to PostTask and its |
69 // variants. Depending on the type of message pump used by the MessageLoop | 73 // variants. Depending on the type of message pump used by the MessageLoop |
70 // other events such as UI messages may be processed. On Windows APC calls (as | 74 // other events such as UI messages may be processed. On Windows APC calls (as |
71 // time permits) and signals sent to a registered set of HANDLEs may also be | 75 // time permits) and signals sent to a registered set of HANDLEs may also be |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
712 | 716 |
713 // Do not add any member variables to MessageLoopForIO! This is important b/c | 717 // Do not add any member variables to MessageLoopForIO! This is important b/c |
714 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 718 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
715 // data that you need should be stored on the MessageLoop's pump_ instance. | 719 // data that you need should be stored on the MessageLoop's pump_ instance. |
716 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 720 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
717 MessageLoopForIO_should_not_have_extra_member_variables); | 721 MessageLoopForIO_should_not_have_extra_member_variables); |
718 | 722 |
719 } // namespace base | 723 } // namespace base |
720 | 724 |
721 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 725 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
OLD | NEW |