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

Side by Side Diff: remoting/host/session_manager_factory.cc

Issue 98173006: Fix LibjingleTransportFactory to refresh STUN/Relay. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « remoting/host/session_manager_factory.h ('k') | remoting/jingle_glue/jingle_info_request.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "remoting/host/session_manager_factory.h" 5 #include "remoting/host/session_manager_factory.h"
6 6
7 #include "remoting/jingle_glue/chromium_port_allocator.h" 7 #include "remoting/jingle_glue/chromium_port_allocator.h"
8 #include "remoting/jingle_glue/chromium_socket_factory.h" 8 #include "remoting/jingle_glue/chromium_socket_factory.h"
9 #include "remoting/jingle_glue/network_settings.h" 9 #include "remoting/jingle_glue/network_settings.h"
10 #include "remoting/protocol/jingle_session_manager.h" 10 #include "remoting/protocol/jingle_session_manager.h"
11 #include "remoting/protocol/libjingle_transport_factory.h" 11 #include "remoting/protocol/libjingle_transport_factory.h"
12 #include "remoting/protocol/session_manager.h" 12 #include "remoting/protocol/session_manager.h"
13 13
14 namespace remoting { 14 namespace remoting {
15 15
16 scoped_ptr<protocol::SessionManager> CreateHostSessionManager( 16 scoped_ptr<protocol::SessionManager> CreateHostSessionManager(
17 SignalStrategy* signal_strategy,
17 const NetworkSettings& network_settings, 18 const NetworkSettings& network_settings,
18 const scoped_refptr<net::URLRequestContextGetter>& 19 const scoped_refptr<net::URLRequestContextGetter>&
19 url_request_context_getter) { 20 url_request_context_getter) {
20 // Use Chrome's network stack to allocate ports for peer-to-peer channels. 21 // Use Chrome's network stack to allocate ports for peer-to-peer channels.
21 scoped_ptr<ChromiumPortAllocator> port_allocator( 22 scoped_ptr<ChromiumPortAllocator> port_allocator(
22 ChromiumPortAllocator::Create(url_request_context_getter, 23 ChromiumPortAllocator::Create(url_request_context_getter,
23 network_settings)); 24 network_settings));
24 25
25 bool incoming_only = network_settings.nat_traversal_mode ==
26 NetworkSettings::NAT_TRAVERSAL_DISABLED;
27
28 scoped_ptr<protocol::TransportFactory> transport_factory( 26 scoped_ptr<protocol::TransportFactory> transport_factory(
29 new protocol::LibjingleTransportFactory( 27 new protocol::LibjingleTransportFactory(
28 signal_strategy,
30 port_allocator.PassAs<cricket::HttpPortAllocatorBase>(), 29 port_allocator.PassAs<cricket::HttpPortAllocatorBase>(),
31 incoming_only)); 30 network_settings));
32
33 // Use the Jingle protocol for channel-negotiation signalling between
34 // peer TransportFactories.
35 bool fetch_stun_relay_info = network_settings.nat_traversal_mode ==
36 NetworkSettings::NAT_TRAVERSAL_ENABLED;
37 31
38 scoped_ptr<protocol::JingleSessionManager> session_manager( 32 scoped_ptr<protocol::JingleSessionManager> session_manager(
39 new protocol::JingleSessionManager( 33 new protocol::JingleSessionManager(transport_factory.Pass()));
40 transport_factory.Pass(), fetch_stun_relay_info));
41 return session_manager.PassAs<protocol::SessionManager>(); 34 return session_manager.PassAs<protocol::SessionManager>();
42 } 35 }
43 36
44 } // namespace remoting 37 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/session_manager_factory.h ('k') | remoting/jingle_glue/jingle_info_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698