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