platform_message_port.cc 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright 2021 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. #include "components/cast/message_port/platform_message_port.h"
  5. #include "build/build_config.h"
  6. #include "components/cast/message_port/message_port_buildflags.h"
  7. #if BUILDFLAG(USE_MESSAGE_PORT_CORE)
  8. #include "components/cast/message_port/cast_core/create_message_port_core.h" // nogncheck
  9. #elif BUILDFLAG(IS_FUCHSIA)
  10. #include "components/cast/message_port/fuchsia/message_port_fuchsia.h" // nogncheck
  11. #else
  12. #include "components/cast/message_port/cast/message_port_cast.h" // nogncheck
  13. #endif
  14. namespace cast_api_bindings {
  15. // static
  16. void CreatePlatformMessagePortPair(std::unique_ptr<MessagePort>* client,
  17. std::unique_ptr<MessagePort>* server) {
  18. #if BUILDFLAG(USE_MESSAGE_PORT_CORE)
  19. return CreateMessagePortCorePair(client, server);
  20. #elif BUILDFLAG(IS_FUCHSIA)
  21. return MessagePortFuchsia::CreatePair(client, server);
  22. #else
  23. return MessagePortCast::CreatePair(client, server);
  24. #endif
  25. }
  26. } // namespace cast_api_bindings