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.h" | 5 #include "remoting/protocol/jingle_session.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 // host responded with, to refer to later. | 318 // host responded with, to refer to later. |
319 if (cricket_session_->initiator()) { | 319 if (cricket_session_->initiator()) { |
320 if (!InitializeConfigFromDescription( | 320 if (!InitializeConfigFromDescription( |
321 cricket_session_->remote_description())) { | 321 cricket_session_->remote_description())) { |
322 CloseInternal(net::ERR_CONNECTION_FAILED, INCOMPATIBLE_PROTOCOL); | 322 CloseInternal(net::ERR_CONNECTION_FAILED, INCOMPATIBLE_PROTOCOL); |
323 return; | 323 return; |
324 } | 324 } |
325 } | 325 } |
326 | 326 |
327 SetState(CONNECTED); | 327 SetState(CONNECTED); |
| 328 |
| 329 if (authenticator_->state() == Authenticator::ACCEPTED) |
| 330 SetState(AUTHENTICATED); |
328 } | 331 } |
329 | 332 |
330 void JingleSession::OnTerminate() { | 333 void JingleSession::OnTerminate() { |
331 DCHECK(CalledOnValidThread()); | 334 DCHECK(CalledOnValidThread()); |
332 CloseInternal(net::ERR_CONNECTION_ABORTED, OK); | 335 CloseInternal(net::ERR_CONNECTION_ABORTED, OK); |
333 } | 336 } |
334 | 337 |
335 void JingleSession::AcceptConnection() { | 338 void JingleSession::AcceptConnection() { |
336 SetState(CONNECTING); | 339 SetState(CONNECTING); |
337 | 340 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 const buzz::XmlElement* authenticator_message) { | 468 const buzz::XmlElement* authenticator_message) { |
466 cricket::SessionDescription* desc = new cricket::SessionDescription(); | 469 cricket::SessionDescription* desc = new cricket::SessionDescription(); |
467 desc->AddContent( | 470 desc->AddContent( |
468 ContentDescription::kChromotingContentName, kChromotingXmlNamespace, | 471 ContentDescription::kChromotingContentName, kChromotingXmlNamespace, |
469 new ContentDescription(config, authenticator_message)); | 472 new ContentDescription(config, authenticator_message)); |
470 return desc; | 473 return desc; |
471 } | 474 } |
472 | 475 |
473 } // namespace protocol | 476 } // namespace protocol |
474 } // namespace remoting | 477 } // namespace remoting |
OLD | NEW |