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

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

Issue 9366001: Implement support for route change notifications in the Transport interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 8 years, 10 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 | « jingle/glue/channel_socket_adapter.h ('k') | remoting/protocol/libjingle_transport_factory.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.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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 DCHECK(channel->GetP2PChannel()->best_connection()); 518 DCHECK(channel->GetP2PChannel()->best_connection());
519 const cricket::Candidate& local_candidate = 519 const cricket::Candidate& local_candidate =
520 channel->GetP2PChannel()->best_connection()->local_candidate(); 520 channel->GetP2PChannel()->best_connection()->local_candidate();
521 net::IPEndPoint local_end_point; 521 net::IPEndPoint local_end_point;
522 if (!jingle_glue::SocketAddressToIPEndPoint(local_candidate.address(), 522 if (!jingle_glue::SocketAddressToIPEndPoint(local_candidate.address(),
523 &local_end_point)) { 523 &local_end_point)) {
524 NOTREACHED(); 524 NOTREACHED();
525 return; 525 return;
526 } 526 }
527 527
528 if (!route_change_callback_.is_null()) 528 if (!route_change_callback_.is_null()) {
529 route_change_callback_.Run(channel->name(), remote_end_point, 529 route_change_callback_.Run(channel->name(), remote_end_point,
530 local_end_point); 530 local_end_point);
531 }
531 } 532 }
532 533
533 const cricket::ContentInfo* JingleSession::GetContentInfo() const { 534 const cricket::ContentInfo* JingleSession::GetContentInfo() const {
534 const cricket::SessionDescription* session_description; 535 const cricket::SessionDescription* session_description;
535 // If we initiate the session, we get to specify the content name. When 536 // If we initiate the session, we get to specify the content name. When
536 // accepting one, the remote end specifies it. 537 // accepting one, the remote end specifies it.
537 if (cricket_session_->initiator()) { 538 if (cricket_session_->initiator()) {
538 session_description = cricket_session_->local_description(); 539 session_description = cricket_session_->local_description();
539 } else { 540 } else {
540 session_description = cricket_session_->remote_description(); 541 session_description = cricket_session_->remote_description();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 scoped_ptr<cricket::SessionDescription> desc( 579 scoped_ptr<cricket::SessionDescription> desc(
579 new cricket::SessionDescription()); 580 new cricket::SessionDescription());
580 desc->AddContent( 581 desc->AddContent(
581 ContentDescription::kChromotingContentName, kChromotingXmlNamespace, 582 ContentDescription::kChromotingContentName, kChromotingXmlNamespace,
582 new ContentDescription(config.Pass(), authenticator_message.Pass())); 583 new ContentDescription(config.Pass(), authenticator_message.Pass()));
583 return desc.Pass(); 584 return desc.Pass();
584 } 585 }
585 586
586 } // namespace protocol 587 } // namespace protocol
587 } // namespace remoting 588 } // namespace remoting
OLDNEW
« no previous file with comments | « jingle/glue/channel_socket_adapter.h ('k') | remoting/protocol/libjingle_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698