OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // Initialize |cricket_session_manager_|. | 93 // Initialize |cricket_session_manager_|. |
94 cricket_session_manager_.reset( | 94 cricket_session_manager_.reset( |
95 new cricket::SessionManager(port_allocator_.get())); | 95 new cricket::SessionManager(port_allocator_.get())); |
96 cricket_session_manager_->AddClient(kChromotingXmlNamespace, this); | 96 cricket_session_manager_->AddClient(kChromotingXmlNamespace, this); |
97 | 97 |
98 jingle_signaling_connector_.reset(new JingleSignalingConnector( | 98 jingle_signaling_connector_.reset(new JingleSignalingConnector( |
99 signal_strategy_, cricket_session_manager_.get())); | 99 signal_strategy_, cricket_session_manager_.get())); |
100 | 100 |
101 // If NAT traversal is enabled then we need to request STUN/Relay info. | 101 // If NAT traversal is enabled then we need to request STUN/Relay info. |
102 if (allow_nat_traversal) { | 102 if (allow_nat_traversal) { |
103 jingle_info_request_.reset( | 103 jingle_info_request_.reset(new JingleInfoRequest(signal_strategy_)); |
104 new JingleInfoRequest(signal_strategy_->CreateIqRequest())); | |
105 jingle_info_request_->Send(base::Bind( | 104 jingle_info_request_->Send(base::Bind( |
106 &JingleSessionManager::OnJingleInfo, base::Unretained(this))); | 105 &JingleSessionManager::OnJingleInfo, base::Unretained(this))); |
107 } else { | 106 } else { |
108 listener_->OnSessionManagerInitialized(); | 107 listener_->OnSessionManagerInitialized(); |
109 } | 108 } |
110 } | 109 } |
111 | 110 |
112 void JingleSessionManager::Close() { | 111 void JingleSessionManager::Close() { |
113 DCHECK(CalledOnValidThread()); | 112 DCHECK(CalledOnValidThread()); |
114 | 113 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 const std::string& certificate) { | 318 const std::string& certificate) { |
320 cricket::SessionDescription* desc = new cricket::SessionDescription(); | 319 cricket::SessionDescription* desc = new cricket::SessionDescription(); |
321 desc->AddContent( | 320 desc->AddContent( |
322 ContentDescription::kChromotingContentName, kChromotingXmlNamespace, | 321 ContentDescription::kChromotingContentName, kChromotingXmlNamespace, |
323 new ContentDescription(config, "", certificate)); | 322 new ContentDescription(config, "", certificate)); |
324 return desc; | 323 return desc; |
325 } | 324 } |
326 | 325 |
327 } // namespace protocol | 326 } // namespace protocol |
328 } // namespace remoting | 327 } // namespace remoting |
OLD | NEW |