| 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 { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class LibjingleTransportFactory : public TransportFactory { | 23 class LibjingleTransportFactory : public TransportFactory { |
| 24 public: | 24 public: |
| 25 // Need to use cricket::HttpPortAllocatorBase pointer for the | 25 // Need to use cricket::HttpPortAllocatorBase pointer for the |
| 26 // |port_allocator|, so that it is possible to configure | 26 // |port_allocator|, so that it is possible to configure |
| 27 // |port_allocator| with STUN/Relay addresses. | 27 // |port_allocator| with STUN/Relay addresses. |
| 28 // TODO(sergeyu): Reconsider this design. | 28 // TODO(sergeyu): Reconsider this design. |
| 29 LibjingleTransportFactory( | 29 LibjingleTransportFactory( |
| 30 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator, | 30 scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator, |
| 31 bool incoming_only); | 31 bool incoming_only); |
| 32 | 32 |
| 33 // Creates BasicNetworkManager, BasicPacketSocketFactory and | 33 // Creates BasicNetworkManager, ChromiumPacketSocketFactory and |
| 34 // BasicPortAllocator. | 34 // BasicPortAllocator. |
| 35 LibjingleTransportFactory(); | 35 LibjingleTransportFactory(); |
| 36 | 36 |
| 37 virtual ~LibjingleTransportFactory(); | 37 virtual ~LibjingleTransportFactory(); |
| 38 | 38 |
| 39 // TransportFactory interface. | 39 // TransportFactory interface. |
| 40 virtual void SetTransportConfig(const TransportConfig& config) OVERRIDE; | 40 virtual void SetTransportConfig(const TransportConfig& config) OVERRIDE; |
| 41 virtual scoped_ptr<StreamTransport> CreateStreamTransport() OVERRIDE; | 41 virtual scoped_ptr<StreamTransport> CreateStreamTransport() OVERRIDE; |
| 42 virtual scoped_ptr<DatagramTransport> CreateDatagramTransport() OVERRIDE; | 42 virtual scoped_ptr<DatagramTransport> CreateDatagramTransport() OVERRIDE; |
| 43 | 43 |
| 44 private: | 44 private: |
| 45 scoped_ptr<talk_base::NetworkManager> network_manager_; | 45 scoped_ptr<talk_base::NetworkManager> network_manager_; |
| 46 scoped_ptr<talk_base::PacketSocketFactory> socket_factory_; | 46 scoped_ptr<talk_base::PacketSocketFactory> socket_factory_; |
| 47 // Points to the same port allocator as |port_allocator_| or NULL if | 47 // Points to the same port allocator as |port_allocator_| or NULL if |
| 48 // |port_allocator_| is not HttpPortAllocatorBase. | 48 // |port_allocator_| is not HttpPortAllocatorBase. |
| 49 cricket::HttpPortAllocatorBase* http_port_allocator_; | 49 cricket::HttpPortAllocatorBase* http_port_allocator_; |
| 50 scoped_ptr<cricket::PortAllocator> port_allocator_; | 50 scoped_ptr<cricket::PortAllocator> port_allocator_; |
| 51 bool incoming_only_; | 51 bool incoming_only_; |
| 52 | 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(LibjingleTransportFactory); | 53 DISALLOW_COPY_AND_ASSIGN(LibjingleTransportFactory); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 } // namespace protocol | 56 } // namespace protocol |
| 57 } // namespace remoting | 57 } // namespace remoting |
| 58 | 58 |
| 59 #endif // REMOTING_PROTOCOL_LIBJINGLE_TRANSPORT_FACTORY_H_ | 59 #endif // REMOTING_PROTOCOL_LIBJINGLE_TRANSPORT_FACTORY_H_ |
| OLD | NEW |