Chromium Code Reviews| OLD | NEW |
|---|---|
| 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.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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 500 | 500 |
| 501 void JingleSession::OnChannelConnectorFinished( | 501 void JingleSession::OnChannelConnectorFinished( |
| 502 const std::string& name, JingleChannelConnector* connector) { | 502 const std::string& name, JingleChannelConnector* connector) { |
| 503 DCHECK(CalledOnValidThread()); | 503 DCHECK(CalledOnValidThread()); |
| 504 DCHECK_EQ(channel_connectors_[name], connector); | 504 DCHECK_EQ(channel_connectors_[name], connector); |
| 505 channel_connectors_.erase(name); | 505 channel_connectors_.erase(name); |
| 506 } | 506 } |
| 507 | 507 |
| 508 void JingleSession::OnRouteChange(cricket::TransportChannel* channel, | 508 void JingleSession::OnRouteChange(cricket::TransportChannel* channel, |
| 509 const cricket::Candidate& candidate) { | 509 const cricket::Candidate& candidate) { |
| 510 net::IPEndPoint end_point; | 510 net::IPEndPoint end_point; |
|
Sergey Ulanov
2012/02/02 01:10:23
s/end_point/remote_end_point/?
Lambros
2012/02/02 01:48:12
Done.
| |
| 511 if (!jingle_glue::SocketAddressToIPEndPoint(candidate.address(), | 511 if (!jingle_glue::SocketAddressToIPEndPoint(candidate.address(), |
| 512 &end_point)) { | 512 &end_point)) { |
| 513 NOTREACHED(); | 513 NOTREACHED(); |
| 514 return; | 514 return; |
| 515 } | 515 } |
| 516 | 516 |
| 517 const cricket::Candidate& local_candidate = | |
| 518 channel->GetP2PChannel()->best_connection()->local_candidate(); | |
|
Sergey Ulanov
2012/02/02 01:10:23
add DCHECK(channel->GetP2PChannel()) and DCHECK(ch
Lambros
2012/02/02 01:48:12
Done.
| |
| 519 net::IPEndPoint local_end_point; | |
| 520 if (!jingle_glue::SocketAddressToIPEndPoint(local_candidate.address(), | |
| 521 &local_end_point)) { | |
| 522 NOTREACHED(); | |
| 523 return; | |
| 524 } | |
| 525 | |
| 517 if (!route_change_callback_.is_null()) | 526 if (!route_change_callback_.is_null()) |
| 518 route_change_callback_.Run(channel->name(), end_point); | 527 route_change_callback_.Run(channel->name(), end_point, local_end_point); |
| 519 } | 528 } |
| 520 | 529 |
| 521 const cricket::ContentInfo* JingleSession::GetContentInfo() const { | 530 const cricket::ContentInfo* JingleSession::GetContentInfo() const { |
| 522 const cricket::SessionDescription* session_description; | 531 const cricket::SessionDescription* session_description; |
| 523 // If we initiate the session, we get to specify the content name. When | 532 // If we initiate the session, we get to specify the content name. When |
| 524 // accepting one, the remote end specifies it. | 533 // accepting one, the remote end specifies it. |
| 525 if (cricket_session_->initiator()) { | 534 if (cricket_session_->initiator()) { |
| 526 session_description = cricket_session_->local_description(); | 535 session_description = cricket_session_->local_description(); |
| 527 } else { | 536 } else { |
| 528 session_description = cricket_session_->remote_description(); | 537 session_description = cricket_session_->remote_description(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 566 scoped_ptr<cricket::SessionDescription> desc( | 575 scoped_ptr<cricket::SessionDescription> desc( |
| 567 new cricket::SessionDescription()); | 576 new cricket::SessionDescription()); |
| 568 desc->AddContent( | 577 desc->AddContent( |
| 569 ContentDescription::kChromotingContentName, kChromotingXmlNamespace, | 578 ContentDescription::kChromotingContentName, kChromotingXmlNamespace, |
| 570 new ContentDescription(config.Pass(), authenticator_message.Pass())); | 579 new ContentDescription(config.Pass(), authenticator_message.Pass())); |
| 571 return desc.Pass(); | 580 return desc.Pass(); |
| 572 } | 581 } |
| 573 | 582 |
| 574 } // namespace protocol | 583 } // namespace protocol |
| 575 } // namespace remoting | 584 } // namespace remoting |
| OLD | NEW |