| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 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 | |
| 5 #ifndef REMOTING_PROTOCOL_ICE_TRANSPORT_FACTORY_H_ | |
| 6 #define REMOTING_PROTOCOL_ICE_TRANSPORT_FACTORY_H_ | |
| 7 | |
| 8 #include <list> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "remoting/protocol/network_settings.h" | |
| 12 #include "remoting/protocol/transport.h" | |
| 13 #include "remoting/signaling/jingle_info_request.h" | |
| 14 | |
| 15 namespace cricket { | |
| 16 class HttpPortAllocatorBase; | |
| 17 } // namespace cricket | |
| 18 | |
| 19 namespace remoting { | |
| 20 | |
| 21 class SignalStrategy; | |
| 22 | |
| 23 namespace protocol { | |
| 24 | |
| 25 class IceTransportFactory : public TransportFactory { | |
| 26 public: | |
| 27 IceTransportFactory( | |
| 28 SignalStrategy* signal_strategy, | |
| 29 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator, | |
| 30 const NetworkSettings& network_settings, | |
| 31 TransportRole role); | |
| 32 ~IceTransportFactory() override; | |
| 33 | |
| 34 // TransportFactory interface. | |
| 35 scoped_ptr<Transport> CreateTransport() override; | |
| 36 | |
| 37 private: | |
| 38 void EnsureFreshJingleInfo(); | |
| 39 void OnJingleInfo(const std::string& relay_token, | |
| 40 const std::vector<std::string>& relay_hosts, | |
| 41 const std::vector<rtc::SocketAddress>& stun_hosts); | |
| 42 | |
| 43 SignalStrategy* signal_strategy_; | |
| 44 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator_; | |
| 45 NetworkSettings network_settings_; | |
| 46 TransportRole role_; | |
| 47 | |
| 48 base::TimeTicks last_jingle_info_update_time_; | |
| 49 scoped_ptr<JingleInfoRequest> jingle_info_request_; | |
| 50 | |
| 51 // When there is an active |jingle_info_request_| stores list of callbacks to | |
| 52 // be called once the |jingle_info_request_| is finished. | |
| 53 std::list<base::Closure> on_jingle_info_callbacks_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(IceTransportFactory); | |
| 56 }; | |
| 57 | |
| 58 } // namespace protocol | |
| 59 } // namespace remoting | |
| 60 | |
| 61 #endif // REMOTING_PROTOCOL_ICE_TRANSPORT_FACTORY_H_ | |
| OLD | NEW |