message_pump_for_io.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_MESSAGE_LOOP_MESSAGE_PUMP_FOR_IO_H_
  5. #define BASE_MESSAGE_LOOP_MESSAGE_PUMP_FOR_IO_H_
  6. // This header is a forwarding header to coalesce the various platform specific
  7. // types representing MessagePumpForIO.
  8. #include "base/message_loop/ios_cronet_buildflags.h"
  9. #include "build/build_config.h"
  10. #if BUILDFLAG(IS_WIN)
  11. #include "base/message_loop/message_pump_win.h"
  12. #elif BUILDFLAG(IS_IOS) && BUILDFLAG(CRONET_BUILD)
  13. #include "base/message_loop/message_pump_io_ios.h"
  14. #elif BUILDFLAG(IS_APPLE)
  15. #include "base/message_loop/message_pump_kqueue.h"
  16. #elif BUILDFLAG(IS_NACL)
  17. #include "base/message_loop/message_pump_default.h"
  18. #elif BUILDFLAG(IS_FUCHSIA)
  19. #include "base/message_loop/message_pump_fuchsia.h"
  20. #elif BUILDFLAG(IS_POSIX)
  21. #include "base/message_loop/message_pump_libevent.h"
  22. #endif
  23. namespace base {
  24. #if BUILDFLAG(IS_WIN)
  25. // Windows defines it as-is.
  26. using MessagePumpForIO = MessagePumpForIO;
  27. #elif BUILDFLAG(IS_IOS) && BUILDFLAG(CRONET_BUILD)
  28. using MessagePumpForIO = MessagePumpIOSForIO;
  29. #elif BUILDFLAG(IS_APPLE)
  30. using MessagePumpForIO = MessagePumpKqueue;
  31. #elif BUILDFLAG(IS_NACL)
  32. using MessagePumpForIO = MessagePumpDefault;
  33. #elif BUILDFLAG(IS_FUCHSIA)
  34. using MessagePumpForIO = MessagePumpFuchsia;
  35. #elif BUILDFLAG(IS_POSIX)
  36. using MessagePumpForIO = MessagePumpLibevent;
  37. #else
  38. #error Platform does not define MessagePumpForIO
  39. #endif
  40. } // namespace base
  41. #endif // BASE_MESSAGE_LOOP_MESSAGE_PUMP_FOR_IO_H_