OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_LIBJINGLE_TRANSPORT_FACTORY_H_ | 5 #ifndef REMOTING_PROTOCOL_LIBJINGLE_TRANSPORT_FACTORY_H_ |
6 #define REMOTING_PROTOCOL_LIBJINGLE_TRANSPORT_FACTORY_H_ | 6 #define REMOTING_PROTOCOL_LIBJINGLE_TRANSPORT_FACTORY_H_ |
7 | 7 |
8 #include "remoting/protocol/transport.h" | 8 #include "remoting/protocol/transport.h" |
9 | 9 |
10 namespace cricket { | 10 namespace cricket { |
11 class HttpPortAllocatorBase; | 11 class HttpPortAllocatorBase; |
12 class PortAllocator; | 12 class PortAllocator; |
13 } // namespace cricket | 13 } // namespace cricket |
14 | 14 |
| 15 namespace net { |
| 16 class URLRequestContextGetter; |
| 17 } // namespace net |
| 18 |
15 namespace talk_base { | 19 namespace talk_base { |
16 class NetworkManager; | 20 class NetworkManager; |
17 class PacketSocketFactory; | 21 class PacketSocketFactory; |
18 } // namespace talk_base | 22 } // namespace talk_base |
19 | 23 |
20 namespace remoting { | 24 namespace remoting { |
| 25 |
| 26 struct NetworkSettings; |
| 27 |
21 namespace protocol { | 28 namespace protocol { |
22 | 29 |
23 class LibjingleTransportFactory : public TransportFactory { | 30 class LibjingleTransportFactory : public TransportFactory { |
24 public: | 31 public: |
| 32 // Creates an instance of the class using ChromiumPortAllocator. |
| 33 // Must be called from an IO thread. |
| 34 static scoped_ptr<LibjingleTransportFactory> Create( |
| 35 const NetworkSettings& network_settings, |
| 36 const scoped_refptr<net::URLRequestContextGetter>& |
| 37 url_request_context_getter); |
| 38 |
25 // Need to use cricket::HttpPortAllocatorBase pointer for the | 39 // Need to use cricket::HttpPortAllocatorBase pointer for the |
26 // |port_allocator|, so that it is possible to configure | 40 // |port_allocator|, so that it is possible to configure |
27 // |port_allocator| with STUN/Relay addresses. | 41 // |port_allocator| with STUN/Relay addresses. |
28 // TODO(sergeyu): Reconsider this design. | 42 // TODO(sergeyu): Reconsider this design. |
29 LibjingleTransportFactory( | 43 LibjingleTransportFactory( |
30 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator, | 44 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator, |
31 bool incoming_only); | 45 bool incoming_only); |
32 | 46 |
33 // Creates BasicNetworkManager, ChromiumPacketSocketFactory and | 47 // Creates BasicNetworkManager, ChromiumPacketSocketFactory and |
34 // BasicPortAllocator. | 48 // BasicPortAllocator. |
(...skipping 15 matching lines...) Expand all Loading... |
50 scoped_ptr<cricket::PortAllocator> port_allocator_; | 64 scoped_ptr<cricket::PortAllocator> port_allocator_; |
51 bool incoming_only_; | 65 bool incoming_only_; |
52 | 66 |
53 DISALLOW_COPY_AND_ASSIGN(LibjingleTransportFactory); | 67 DISALLOW_COPY_AND_ASSIGN(LibjingleTransportFactory); |
54 }; | 68 }; |
55 | 69 |
56 } // namespace protocol | 70 } // namespace protocol |
57 } // namespace remoting | 71 } // namespace remoting |
58 | 72 |
59 #endif // REMOTING_PROTOCOL_LIBJINGLE_TRANSPORT_FACTORY_H_ | 73 #endif // REMOTING_PROTOCOL_LIBJINGLE_TRANSPORT_FACTORY_H_ |
OLD | NEW |