Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1179)

Side by Side Diff: remoting/protocol/libjingle_transport_factory.h

Issue 10160013: Implement HostPortAllocator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 talk_base { 15 namespace talk_base {
16 class NetworkManager; 16 class NetworkManager;
17 class PacketSocketFactory; 17 class PacketSocketFactory;
18 } // namespace talk_base 18 } // namespace talk_base
19 19
20 namespace remoting { 20 namespace remoting {
21 namespace protocol { 21 namespace protocol {
22 22
23 class LibjingleTransportFactory : public TransportFactory { 23 class LibjingleTransportFactory : public TransportFactory {
24 public: 24 public:
25 LibjingleTransportFactory( 25 LibjingleTransportFactory(
26 scoped_ptr<talk_base::NetworkManager> network_manager,
27 scoped_ptr<talk_base::PacketSocketFactory> socket_factory,
28 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator, 26 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator,
Wez 2012/04/27 23:23:21 It looks wrong for the caller to pass in HttpPortA
Sergey Ulanov 2012/04/28 00:05:27 Done. Also added TODO to fix it.
29 bool incoming_only); 27 bool incoming_only);
30 28
31 // Creates BasicNetworkManager, BasicPacketSocketFactory and 29 // Creates BasicNetworkManager, BasicPacketSocketFactory and
32 // BasicPortAllocator. 30 // BasicPortAllocator.
33 LibjingleTransportFactory(); 31 LibjingleTransportFactory();
34 32
35 virtual ~LibjingleTransportFactory(); 33 virtual ~LibjingleTransportFactory();
36 34
37 // TransportFactory interface. 35 // TransportFactory interface.
38 virtual void SetConfig(const TransportConfig& config) OVERRIDE; 36 virtual void SetConfig(const TransportConfig& config) OVERRIDE;
39 virtual scoped_ptr<StreamTransport> CreateStreamTransport() OVERRIDE; 37 virtual scoped_ptr<StreamTransport> CreateStreamTransport() OVERRIDE;
40 virtual scoped_ptr<DatagramTransport> CreateDatagramTransport() OVERRIDE; 38 virtual scoped_ptr<DatagramTransport> CreateDatagramTransport() OVERRIDE;
41 39
42 private: 40 private:
43 scoped_ptr<talk_base::NetworkManager> network_manager_; 41 scoped_ptr<talk_base::NetworkManager> network_manager_;
44 scoped_ptr<talk_base::PacketSocketFactory> socket_factory_; 42 scoped_ptr<talk_base::PacketSocketFactory> socket_factory_;
45 // Points to the same port allocator as |port_allocator_| or NULL if 43 // Points to the same port allocator as |port_allocator_| or NULL if
46 // |port_allocator_| is not HttpPortAllocatorBase. 44 // |port_allocator_| is not HttpPortAllocatorBase.
47 cricket::HttpPortAllocatorBase* http_port_allocator_; 45 cricket::HttpPortAllocatorBase* http_port_allocator_;
48 scoped_ptr<cricket::PortAllocator> port_allocator_; 46 scoped_ptr<cricket::PortAllocator> port_allocator_;
49 bool incoming_only_; 47 bool incoming_only_;
50 48
51 DISALLOW_COPY_AND_ASSIGN(LibjingleTransportFactory); 49 DISALLOW_COPY_AND_ASSIGN(LibjingleTransportFactory);
52 }; 50 };
53 51
54 } // namespace protocol 52 } // namespace protocol
55 } // namespace remoting 53 } // namespace remoting
56 54
57 #endif // REMOTING_PROTOCOL_LIBJINGLE_TRANSPORT_FACTORY_H_ 55 #endif // REMOTING_PROTOCOL_LIBJINGLE_TRANSPORT_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698