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

Unified Diff: remoting/protocol/jingle_session_manager.cc

Issue 10233021: Move PortAllocator creation out of LibjingleTransportFactory. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/jingle_session_manager.h ('k') | remoting/protocol/jingle_session_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/jingle_session_manager.cc
diff --git a/remoting/protocol/jingle_session_manager.cc b/remoting/protocol/jingle_session_manager.cc
index f61866190ab13de62b136aeb5e4973450ba4cc14..0a9e87f57466b61daf527a592ff140f8b6c1ebfe 100644
--- a/remoting/protocol/jingle_session_manager.cc
+++ b/remoting/protocol/jingle_session_manager.cc
@@ -21,8 +21,10 @@ namespace remoting {
namespace protocol {
JingleSessionManager::JingleSessionManager(
- scoped_ptr<TransportFactory> transport_factory)
+ scoped_ptr<TransportFactory> transport_factory,
+ bool fetch_stun_relay_config)
: transport_factory_(transport_factory.Pass()),
+ fetch_stun_relay_config_(fetch_stun_relay_config),
signal_strategy_(NULL),
listener_(NULL),
ready_(false) {
@@ -34,16 +36,11 @@ JingleSessionManager::~JingleSessionManager() {
void JingleSessionManager::Init(
SignalStrategy* signal_strategy,
- SessionManager::Listener* listener,
- const NetworkSettings& network_settings) {
+ SessionManager::Listener* listener) {
listener_ = listener;
signal_strategy_ = signal_strategy;
iq_sender_.reset(new IqSender(signal_strategy_));
- transport_config_.nat_traversal_mode = network_settings.nat_traversal_mode;
- transport_config_.min_port = network_settings.min_port;
- transport_config_.max_port = network_settings.max_port;
-
signal_strategy_->AddListener(this);
OnSignalStrategyStateChange(signal_strategy_->GetState());
@@ -105,10 +102,9 @@ void JingleSessionManager::set_authenticator_factory(
void JingleSessionManager::OnSignalStrategyStateChange(
SignalStrategy::State state) {
- // If NAT traversal is enabled then we need to request STUN/Relay info.
if (state == SignalStrategy::CONNECTED) {
- if (transport_config_.nat_traversal_mode ==
- TransportConfig::NAT_TRAVERSAL_ENABLED) {
+ // Request STUN/Relay info if necessary.
+ if (fetch_stun_relay_config_) {
jingle_info_request_.reset(new JingleInfoRequest(signal_strategy_));
jingle_info_request_->Send(base::Bind(&JingleSessionManager::OnJingleInfo,
base::Unretained(this)));
« no previous file with comments | « remoting/protocol/jingle_session_manager.h ('k') | remoting/protocol/jingle_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698