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 #include "base/message_loop.h" | 5 #include "base/message_loop.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 message_loop_proxy_ = new base::MessageLoopProxyImpl(); | 141 message_loop_proxy_ = new base::MessageLoopProxyImpl(); |
142 | 142 |
143 // TODO(rvargas): Get rid of the OS guards. | 143 // TODO(rvargas): Get rid of the OS guards. |
144 #if defined(OS_WIN) | 144 #if defined(OS_WIN) |
145 #define MESSAGE_PUMP_UI new base::MessagePumpForUI() | 145 #define MESSAGE_PUMP_UI new base::MessagePumpForUI() |
146 #define MESSAGE_PUMP_IO new base::MessagePumpForIO() | 146 #define MESSAGE_PUMP_IO new base::MessagePumpForIO() |
147 #elif defined(OS_MACOSX) | 147 #elif defined(OS_MACOSX) |
148 #define MESSAGE_PUMP_UI base::MessagePumpMac::Create() | 148 #define MESSAGE_PUMP_UI base::MessagePumpMac::Create() |
149 #define MESSAGE_PUMP_IO new base::MessagePumpLibevent() | 149 #define MESSAGE_PUMP_IO new base::MessagePumpLibevent() |
150 #elif defined(OS_ANDROID) | |
151 #define MESSAGE_PUMP_UI new base::MessagePumpForUI() | |
152 #define MESSAGE_PUMP_IO new base::MessagePumpLibevent() | |
153 #elif defined(USE_WAYLAND) | |
154 #define MESSAGE_PUMP_UI new base::MessagePumpWayland() | |
155 #define MESSAGE_PUMP_IO new base::MessagePumpLibevent() | |
156 #elif defined(USE_AURA) | |
157 #define MESSAGE_PUMP_UI new base::MessagePumpX() | |
158 #define MESSAGE_PUMP_IO new base::MessagePumpLibevent() | |
159 #elif defined(OS_NACL) | 150 #elif defined(OS_NACL) |
160 // Currently NaCl doesn't have a UI or an IO MessageLoop. | 151 // Currently NaCl doesn't have a UI or an IO MessageLoop. |
161 // TODO(abarth): Figure out if we need these. | 152 // TODO(abarth): Figure out if we need these. |
162 #define MESSAGE_PUMP_UI NULL | 153 #define MESSAGE_PUMP_UI NULL |
163 #define MESSAGE_PUMP_IO NULL | 154 #define MESSAGE_PUMP_IO NULL |
164 #elif defined(OS_POSIX) // POSIX but not MACOSX. | 155 #elif defined(OS_POSIX) // POSIX but not MACOSX. |
165 #define MESSAGE_PUMP_UI new base::MessagePumpGtk() | 156 #define MESSAGE_PUMP_UI new base::MessagePumpForUI() |
166 #define MESSAGE_PUMP_IO new base::MessagePumpLibevent() | 157 #define MESSAGE_PUMP_IO new base::MessagePumpLibevent() |
167 #else | 158 #else |
168 #error Not implemented | 159 #error Not implemented |
169 #endif | 160 #endif |
170 | 161 |
171 if (type_ == TYPE_UI) { | 162 if (type_ == TYPE_UI) { |
172 if (message_pump_for_ui_factory_) | 163 if (message_pump_for_ui_factory_) |
173 pump_ = message_pump_for_ui_factory_(); | 164 pump_ = message_pump_for_ui_factory_(); |
174 else | 165 else |
175 pump_ = MESSAGE_PUMP_UI; | 166 pump_ = MESSAGE_PUMP_UI; |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 Watcher *delegate) { | 827 Watcher *delegate) { |
837 return pump_libevent()->WatchFileDescriptor( | 828 return pump_libevent()->WatchFileDescriptor( |
838 fd, | 829 fd, |
839 persistent, | 830 persistent, |
840 static_cast<base::MessagePumpLibevent::Mode>(mode), | 831 static_cast<base::MessagePumpLibevent::Mode>(mode), |
841 controller, | 832 controller, |
842 delegate); | 833 delegate); |
843 } | 834 } |
844 | 835 |
845 #endif | 836 #endif |
OLD | NEW |