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

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

Issue 10692179: Propagate connection state from networking layer to UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/protocol/jingle_session.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/bind.h" 7 #include "base/bind.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 this, &JingleSession::SendTransportInfo); 247 this, &JingleSession::SendTransportInfo);
248 } 248 }
249 } 249 }
250 250
251 void JingleSession::OnTransportRouteChange(Transport* transport, 251 void JingleSession::OnTransportRouteChange(Transport* transport,
252 const TransportRoute& route) { 252 const TransportRoute& route) {
253 if (event_handler_) 253 if (event_handler_)
254 event_handler_->OnSessionRouteChange(transport->name(), route); 254 event_handler_->OnSessionRouteChange(transport->name(), route);
255 } 255 }
256 256
257 void JingleSession::OnTransportReady(Transport* transport, bool ready) {
258 if (event_handler_)
259 event_handler_->OnSessionChannelReady(transport->name(), ready);
260 }
261
257 void JingleSession::OnTransportDeleted(Transport* transport) { 262 void JingleSession::OnTransportDeleted(Transport* transport) {
258 ChannelsMap::iterator it = channels_.find(transport->name()); 263 ChannelsMap::iterator it = channels_.find(transport->name());
259 DCHECK_EQ(it->second, transport); 264 DCHECK_EQ(it->second, transport);
260 channels_.erase(it); 265 channels_.erase(it);
261 } 266 }
262 267
263 void JingleSession::SendMessage(const JingleMessage& message) { 268 void JingleSession::SendMessage(const JingleMessage& message) {
264 scoped_ptr<IqRequest> request = session_manager_->iq_sender()->SendIq( 269 scoped_ptr<IqRequest> request = session_manager_->iq_sender()->SendIq(
265 message.ToXml(), 270 message.ToXml(),
266 base::Bind(&JingleSession::OnMessageResponse, 271 base::Bind(&JingleSession::OnMessageResponse,
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 DCHECK_NE(state_, FAILED); 577 DCHECK_NE(state_, FAILED);
573 578
574 state_ = new_state; 579 state_ = new_state;
575 if (event_handler_) 580 if (event_handler_)
576 event_handler_->OnSessionStateChange(new_state); 581 event_handler_->OnSessionStateChange(new_state);
577 } 582 }
578 } 583 }
579 584
580 } // namespace protocol 585 } // namespace protocol
581 } // namespace remoting 586 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/jingle_session.h ('k') | remoting/protocol/libjingle_transport_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698