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

Side by Side Diff: remoting/protocol/jingle_session_manager.cc

Issue 9549029: Set incoming_only flag on the host side when NAT traversal is disabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unittests Created 8 years, 9 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/simple_host_process.cc ('k') | remoting/protocol/jingle_session_unittest.cc » ('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/protocol/jingle_session_manager.h" 5 #include "remoting/protocol/jingle_session_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "remoting/jingle_glue/iq_sender.h" 8 #include "remoting/jingle_glue/iq_sender.h"
9 #include "remoting/jingle_glue/jingle_info_request.h" 9 #include "remoting/jingle_glue/jingle_info_request.h"
10 #include "remoting/jingle_glue/signal_strategy.h" 10 #include "remoting/jingle_glue/signal_strategy.h"
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 34
35 void JingleSessionManager::Init( 35 void JingleSessionManager::Init(
36 SignalStrategy* signal_strategy, 36 SignalStrategy* signal_strategy,
37 SessionManager::Listener* listener, 37 SessionManager::Listener* listener,
38 const NetworkSettings& network_settings) { 38 const NetworkSettings& network_settings) {
39 listener_ = listener; 39 listener_ = listener;
40 signal_strategy_ = signal_strategy; 40 signal_strategy_ = signal_strategy;
41 iq_sender_.reset(new IqSender(signal_strategy_)); 41 iq_sender_.reset(new IqSender(signal_strategy_));
42 42
43 transport_config_.nat_traversal = network_settings.allow_nat_traversal; 43 transport_config_.nat_traversal_mode = network_settings.nat_traversal_mode;
44 transport_config_.min_port = network_settings.min_port; 44 transport_config_.min_port = network_settings.min_port;
45 transport_config_.max_port = network_settings.max_port; 45 transport_config_.max_port = network_settings.max_port;
46 46
47 signal_strategy_->AddListener(this); 47 signal_strategy_->AddListener(this);
48 48
49 OnSignalStrategyStateChange(signal_strategy_->GetState()); 49 OnSignalStrategyStateChange(signal_strategy_->GetState());
50 } 50 }
51 51
52 void JingleSessionManager::OnJingleInfo( 52 void JingleSessionManager::OnJingleInfo(
53 const std::string& relay_token, 53 const std::string& relay_token,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 void JingleSessionManager::set_authenticator_factory( 100 void JingleSessionManager::set_authenticator_factory(
101 scoped_ptr<AuthenticatorFactory> authenticator_factory) { 101 scoped_ptr<AuthenticatorFactory> authenticator_factory) {
102 DCHECK(CalledOnValidThread()); 102 DCHECK(CalledOnValidThread());
103 authenticator_factory_ = authenticator_factory.Pass(); 103 authenticator_factory_ = authenticator_factory.Pass();
104 } 104 }
105 105
106 void JingleSessionManager::OnSignalStrategyStateChange( 106 void JingleSessionManager::OnSignalStrategyStateChange(
107 SignalStrategy::State state) { 107 SignalStrategy::State state) {
108 // If NAT traversal is enabled then we need to request STUN/Relay info. 108 // If NAT traversal is enabled then we need to request STUN/Relay info.
109 if (state == SignalStrategy::CONNECTED) { 109 if (state == SignalStrategy::CONNECTED) {
110 if (transport_config_.nat_traversal) { 110 if (transport_config_.nat_traversal_mode ==
111 TransportConfig::NAT_TRAVERSAL_ENABLED) {
111 jingle_info_request_.reset(new JingleInfoRequest(signal_strategy_)); 112 jingle_info_request_.reset(new JingleInfoRequest(signal_strategy_));
112 jingle_info_request_->Send(base::Bind(&JingleSessionManager::OnJingleInfo, 113 jingle_info_request_->Send(base::Bind(&JingleSessionManager::OnJingleInfo,
113 base::Unretained(this))); 114 base::Unretained(this)));
114 } else if (!ready_) { 115 } else if (!ready_) {
115 ready_ = true; 116 ready_ = true;
116 listener_->OnSessionManagerReady(); 117 listener_->OnSessionManagerReady();
117 } 118 }
118 } 119 }
119 } 120 }
120 121
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 signal_strategy_->SendStanza( 175 signal_strategy_->SendStanza(
175 JingleMessageReply(error).ToXml(original_stanza)); 176 JingleMessageReply(error).ToXml(original_stanza));
176 } 177 }
177 178
178 void JingleSessionManager::SessionDestroyed(JingleSession* session) { 179 void JingleSessionManager::SessionDestroyed(JingleSession* session) {
179 sessions_.erase(session->session_id_); 180 sessions_.erase(session->session_id_);
180 } 181 }
181 182
182 } // namespace protocol 183 } // namespace protocol
183 } // namespace remoting 184 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/simple_host_process.cc ('k') | remoting/protocol/jingle_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698