ice_controller_factory_interface.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright 2019 The WebRTC Project Authors. All rights reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef P2P_BASE_ICE_CONTROLLER_FACTORY_INTERFACE_H_
  11. #define P2P_BASE_ICE_CONTROLLER_FACTORY_INTERFACE_H_
  12. #include <memory>
  13. #include <string>
  14. #include "p2p/base/ice_controller_interface.h"
  15. #include "p2p/base/ice_transport_internal.h"
  16. namespace cricket {
  17. // struct with arguments to IceControllerFactoryInterface::Create
  18. struct IceControllerFactoryArgs {
  19. std::function<IceTransportState()> ice_transport_state_func;
  20. std::function<IceRole()> ice_role_func;
  21. std::function<bool(const Connection*)> is_connection_pruned_func;
  22. const IceFieldTrials* ice_field_trials;
  23. std::string ice_controller_field_trials;
  24. };
  25. class IceControllerFactoryInterface {
  26. public:
  27. virtual ~IceControllerFactoryInterface() = default;
  28. virtual std::unique_ptr<IceControllerInterface> Create(
  29. const IceControllerFactoryArgs& args) = 0;
  30. };
  31. } // namespace cricket
  32. #endif // P2P_BASE_ICE_CONTROLLER_FACTORY_INTERFACE_H_