ice_credentials_iterator.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright 2018 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_CREDENTIALS_ITERATOR_H_
  11. #define P2P_BASE_ICE_CREDENTIALS_ITERATOR_H_
  12. #include <vector>
  13. #include "p2p/base/transport_description.h"
  14. namespace cricket {
  15. class IceCredentialsIterator {
  16. public:
  17. explicit IceCredentialsIterator(const std::vector<IceParameters>&);
  18. virtual ~IceCredentialsIterator();
  19. // Get next pooled ice credentials.
  20. // Returns a new random credential if the pool is empty.
  21. IceParameters GetIceCredentials();
  22. static IceParameters CreateRandomIceCredentials();
  23. private:
  24. std::vector<IceParameters> pooled_ice_credentials_;
  25. };
  26. } // namespace cricket
  27. #endif // P2P_BASE_ICE_CREDENTIALS_ITERATOR_H_