1 // Copyright 2018 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_FOR_UI_H_ 6 #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_FOR_UI_H_ 7 8 // This header is a forwarding header to coalesce the various platform specific 9 // implementations of MessagePumpForUI. 10 11 #include "build/build_config.h" 12 13 #if BUILDFLAG(IS_WIN) 14 #include "base/message_loop/message_pump_win.h" 15 #elif BUILDFLAG(IS_ANDROID) 16 #include "base/message_loop/message_pump_android.h" 17 #elif BUILDFLAG(IS_APPLE) 18 #include "base/message_loop/message_pump.h" 19 #elif BUILDFLAG(IS_NACL) || BUILDFLAG(IS_AIX) 20 // No MessagePumpForUI, see below. 21 #elif defined(USE_GLIB) 22 #include "base/message_loop/message_pump_glib.h" 23 #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) 24 #include "base/message_loop/message_pump_libevent.h" 25 #elif BUILDFLAG(IS_FUCHSIA) 26 #include "base/message_loop/message_pump_fuchsia.h" 27 #endif 28 29 namespace base { 30 31 #if BUILDFLAG(IS_WIN) 32 // Windows defines it as-is. 33 using MessagePumpForUI = MessagePumpForUI; 34 #elif BUILDFLAG(IS_ANDROID) 35 // Android defines it as-is. 36 using MessagePumpForUI = MessagePumpForUI; 37 #elif BUILDFLAG(IS_APPLE) 38 // MessagePumpForUI isn't bound to a specific impl on Mac. While each impl can 39 // be represented by a plain MessagePump: MessagePumpMac::Create() must be used 40 // to instantiate the right impl. 41 using MessagePumpForUI = MessagePump; 42 #elif BUILDFLAG(IS_NACL) || BUILDFLAG(IS_AIX) 43 // Currently NaCl and AIX don't have a MessagePumpForUI. 44 // TODO(abarth): Figure out if we need this. 45 #elif defined(USE_GLIB) 46 using MessagePumpForUI = MessagePumpGlib; 47 #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD) 48 using MessagePumpForUI = MessagePumpLibevent; 49 #elif BUILDFLAG(IS_FUCHSIA) 50 using MessagePumpForUI = MessagePumpFuchsia; 51 #else 52 #error Platform does not define MessagePumpForUI 53 #endif 54 55 } // namespace base 56 57 #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_FOR_UI_H_ 58