Chromium Code Reviews| Index: remoting/protocol/libjingle_transport_factory.cc |
| diff --git a/remoting/protocol/libjingle_transport_factory.cc b/remoting/protocol/libjingle_transport_factory.cc |
| index 78b30bb54f3127bbd3c6e5aeb574a39441d97659..0cbc9f59f9bb6a3eaf9e9f21d56a2f77753868b2 100644 |
| --- a/remoting/protocol/libjingle_transport_factory.cc |
| +++ b/remoting/protocol/libjingle_transport_factory.cc |
| @@ -12,9 +12,11 @@ |
| #include "jingle/glue/utils.h" |
| #include "net/base/net_errors.h" |
| #include "remoting/base/constants.h" |
| +#include "remoting/jingle_glue/chromium_port_allocator.h" |
| +#include "remoting/jingle_glue/chromium_socket_factory.h" |
| +#include "remoting/jingle_glue/network_settings.h" |
| #include "remoting/protocol/channel_authenticator.h" |
| #include "remoting/protocol/transport_config.h" |
| -#include "remoting/jingle_glue/chromium_socket_factory.h" |
| #include "third_party/libjingle/source/talk/base/network.h" |
| #include "third_party/libjingle/source/talk/p2p/base/constants.h" |
| #include "third_party/libjingle/source/talk/p2p/base/p2ptransportchannel.h" |
| @@ -317,6 +319,28 @@ void LibjingleStreamTransport::NotifyConnectFailed() { |
| } // namespace |
| +scoped_ptr<LibjingleTransportFactory> LibjingleTransportFactory::Create( |
| + const NetworkSettings& network_settings, |
| + const scoped_refptr<net::URLRequestContextGetter>& |
| + url_request_context_getter) |
| +{ |
|
Sergey Ulanov
2013/06/21 00:48:13
this bracket goes to the previous line.
|
| + // Use Chrome's network stack to allocate ports for peer-to-peer channels. |
| + scoped_ptr<ChromiumPortAllocator> port_allocator( |
| + ChromiumPortAllocator::Create(url_request_context_getter, |
| + network_settings)); |
| + |
| + bool incoming_only = network_settings.nat_traversal_mode == |
| + NetworkSettings::NAT_TRAVERSAL_DISABLED; |
| + |
| + // Use libjingle for negotiation of peer-to-peer channels over |
| + // NativePortAllocator allocated ports. |
| + scoped_ptr<LibjingleTransportFactory> transport_factory( |
| + new LibjingleTransportFactory( |
| + port_allocator.PassAs<cricket::HttpPortAllocatorBase>(), |
| + incoming_only)); |
| + return transport_factory.Pass(); |
| +} |
| + |
| LibjingleTransportFactory::LibjingleTransportFactory( |
| scoped_ptr<cricket::HttpPortAllocatorBase> port_allocator, |
| bool incoming_only) |