OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_PROTOCOL_ICE_TRANSPORT_FACTORY_H_ | 5 #ifndef REMOTING_PROTOCOL_ICE_TRANSPORT_FACTORY_H_ |
6 #define REMOTING_PROTOCOL_ICE_TRANSPORT_FACTORY_H_ | 6 #define REMOTING_PROTOCOL_ICE_TRANSPORT_FACTORY_H_ |
7 | 7 |
8 #include <list> | |
9 | |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "remoting/protocol/network_settings.h" | 11 #include "remoting/protocol/network_settings.h" |
10 #include "remoting/protocol/transport.h" | 12 #include "remoting/protocol/transport.h" |
13 #include "remoting/signaling/jingle_info_request.h" | |
11 | 14 |
12 namespace cricket { | 15 namespace cricket { |
13 class HttpPortAllocatorBase; | 16 class HttpPortAllocatorBase; |
14 } // namespace cricket | 17 } // namespace cricket |
15 | 18 |
16 namespace remoting { | 19 namespace remoting { |
17 | 20 |
18 class SignalStrategy; | 21 class SignalStrategy; |
19 | 22 |
20 namespace protocol { | 23 namespace protocol { |
21 | 24 |
22 class LibjingleTransportFactory; | 25 class LibjingleTransportFactory; |
Jamie
2015/10/28 00:50:54
Remove this declaration.
Sergey Ulanov
2015/10/28 20:16:15
Done.
| |
23 | 26 |
24 class IceTransportFactory : public TransportFactory { | 27 class IceTransportFactory : public TransportFactory { |
25 public: | 28 public: |
26 IceTransportFactory( | 29 IceTransportFactory( |
27 SignalStrategy* signal_strategy, | 30 SignalStrategy* signal_strategy, |
28 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator, | 31 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator, |
29 const NetworkSettings& network_settings, | 32 const NetworkSettings& network_settings, |
30 TransportRole role); | 33 TransportRole role); |
31 ~IceTransportFactory() override; | 34 ~IceTransportFactory() override; |
32 | 35 |
33 // TransportFactory interface. | 36 // TransportFactory interface. |
34 void PrepareTokens() override; | |
35 scoped_ptr<TransportSession> CreateTransportSession() override; | 37 scoped_ptr<TransportSession> CreateTransportSession() override; |
36 | 38 |
37 private: | 39 private: |
38 scoped_ptr<LibjingleTransportFactory> libjingle_transport_factory_; | 40 void EnsureFreshJingleInfo(); |
41 void OnJingleInfo(const std::string& relay_token, | |
42 const std::vector<std::string>& relay_hosts, | |
43 const std::vector<rtc::SocketAddress>& stun_hosts); | |
44 | |
45 SignalStrategy* signal_strategy_; | |
46 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator_; | |
47 NetworkSettings network_settings_; | |
48 TransportRole role_; | |
49 | |
50 base::TimeTicks last_jingle_info_update_time_; | |
51 scoped_ptr<JingleInfoRequest> jingle_info_request_; | |
52 | |
53 // When there is an active |jingle_info_request_| stores list of callbacks to | |
54 // be called once the |jingle_info_request_| is finished. | |
55 std::list<base::Closure> on_jingle_info_callbacks_; | |
39 | 56 |
40 DISALLOW_COPY_AND_ASSIGN(IceTransportFactory); | 57 DISALLOW_COPY_AND_ASSIGN(IceTransportFactory); |
41 }; | 58 }; |
42 | 59 |
43 } // namespace protocol | 60 } // namespace protocol |
44 } // namespace remoting | 61 } // namespace remoting |
45 | 62 |
46 #endif // REMOTING_PROTOCOL_ICE_TRANSPORT_FACTORY_H_ | 63 #endif // REMOTING_PROTOCOL_ICE_TRANSPORT_FACTORY_H_ |
OLD | NEW |