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

Unified Diff: remoting/protocol/libjingle_transport_factory.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/jingle_session.cc ('k') | remoting/protocol/session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/libjingle_transport_factory.cc
diff --git a/remoting/protocol/libjingle_transport_factory.cc b/remoting/protocol/libjingle_transport_factory.cc
index 60be636ed2bd74f81dd98fdba239f0e31bc2e970..afe66e7dcad93f9d636c2a194197c3ef73555c9f 100644
--- a/remoting/protocol/libjingle_transport_factory.cc
+++ b/remoting/protocol/libjingle_transport_factory.cc
@@ -58,6 +58,7 @@ class LibjingleStreamTransport : public StreamTransport,
const cricket::Candidate& candidate);
void OnRouteChange(cricket::TransportChannel* channel,
const cricket::Candidate& candidate);
+ void OnWritableState(cricket::TransportChannel* channel);
void OnTcpConnected(int result);
void OnAuthenticationDone(net::Error error,
@@ -146,6 +147,8 @@ void LibjingleStreamTransport::Connect(
this, &LibjingleStreamTransport::OnCandidateReady);
channel_->SignalRouteChange.connect(
this, &LibjingleStreamTransport::OnRouteChange);
+ channel_->SignalWritableState.connect(
+ this, &LibjingleStreamTransport::OnWritableState);
channel_->set_incoming_only(incoming_only_);
channel_->Connect();
@@ -238,6 +241,11 @@ void LibjingleStreamTransport::OnRouteChange(
event_handler_->OnTransportRouteChange(this, route);
}
+void LibjingleStreamTransport::OnWritableState(
+ cricket::TransportChannel* channel) {
+ event_handler_->OnTransportReady(this, !channel->writable());
+}
+
void LibjingleStreamTransport::OnTcpConnected(int result) {
DCHECK(CalledOnValidThread());
« no previous file with comments | « remoting/protocol/jingle_session.cc ('k') | remoting/protocol/session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698