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

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

Issue 10538091: [Chromoting] Make ChromotingHost's dependency on libjingle injected, instead of hard-coded. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review. Created 8 years, 6 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
« no previous file with comments | « remoting/host/session_manager_factory.h ('k') | remoting/host/simple_host_process.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "remoting/host/session_manager_factory.h"
6
7 #include "net/url_request/url_request_context_getter.h"
8 #include "remoting/host/host_port_allocator.h"
9 #include "remoting/host/network_settings.h"
10 #include "remoting/protocol/libjingle_transport_factory.h"
11 #include "remoting/protocol/jingle_session_manager.h"
12
13 namespace remoting {
14
15 scoped_ptr<protocol::SessionManager> CreateHostSessionManager(
16 const NetworkSettings& network_settings,
17 const scoped_refptr<net::URLRequestContextGetter>&
18 url_request_context_getter) {
19 // Create a cricket::PortAllocator that uses Chrome's network stack.
Wez 2012/06/14 01:00:58 nit: Suggest "Use Chrome's network stack to alloca
simonmorris 2012/06/14 01:24:02 Done.
20 scoped_ptr<HostPortAllocator> port_allocator(
21 HostPortAllocator::Create(url_request_context_getter,
22 network_settings));
23
24 bool incoming_only = network_settings.nat_traversal_mode ==
25 NetworkSettings::NAT_TRAVERSAL_DISABLED;
Wez 2012/06/14 01:00:58 nit: Add a comment e.g. "Use libjingle for negotia
simonmorris 2012/06/14 01:24:02 Done.
26
27 scoped_ptr<protocol::TransportFactory> transport_factory(
28 new protocol::LibjingleTransportFactory(
29 port_allocator.PassAs<cricket::HttpPortAllocatorBase>(),
30 incoming_only));
31
32 // Create a Jingle-protocol SessionManager that uses the libjingle
33 // TransportFactory.
Wez 2012/06/14 01:00:58 nit: Suggest "Use the Jingle protocol for channel-
simonmorris 2012/06/14 01:24:02 Done.
34 bool fetch_stun_relay_info = network_settings.nat_traversal_mode ==
35 NetworkSettings::NAT_TRAVERSAL_ENABLED;
36 scoped_ptr<protocol::JingleSessionManager> session_manager(
Wez 2012/06/14 01:00:58 nit: Add a blank line after the fetch_stun_relay_i
simonmorris 2012/06/14 01:24:02 Done.
37 new protocol::JingleSessionManager(
38 transport_factory.Pass(), fetch_stun_relay_info));
39 return session_manager.PassAs<protocol::SessionManager>();
40 }
41
42 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/session_manager_factory.h ('k') | remoting/host/simple_host_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698