• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_epoll.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 using MessagePumpForUI = MessagePumpAndroid;
36 #elif BUILDFLAG(IS_APPLE)
37 // MessagePumpForUI isn't bound to a specific impl on Mac. While each impl can
38 // be represented by a plain MessagePump: message_pump_apple::Create() must be
39 // used to instantiate the right impl.
40 using MessagePumpForUI = MessagePump;
41 #elif BUILDFLAG(IS_NACL) || BUILDFLAG(IS_AIX)
42 // Currently NaCl and AIX don't have a MessagePumpForUI.
43 // TODO(abarth): Figure out if we need this.
44 #elif defined(USE_GLIB)
45 using MessagePumpForUI = MessagePumpGlib;
46 #elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
47 using MessagePumpForUI = MessagePumpEpoll;
48 #elif BUILDFLAG(IS_FUCHSIA)
49 using MessagePumpForUI = MessagePumpFuchsia;
50 #else
51 #error Platform does not define MessagePumpForUI
52 #endif
53 
54 }  // namespace base
55 
56 #endif  // BASE_MESSAGE_LOOP_MESSAGE_PUMP_FOR_UI_H_
57