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

Unified Diff: remoting/protocol/channel_dispatcher_base.cc

Issue 850983002: Implement video frame acknowledgements in the chromoting protocol. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
Index: remoting/protocol/channel_dispatcher_base.cc
diff --git a/remoting/protocol/channel_dispatcher_base.cc b/remoting/protocol/channel_dispatcher_base.cc
index ee90ee56dcbc7bc02756ebf80e919e90889d6cbd..e997bebe7cd9286f4d757f25eaf75aa96c9cbd25 100644
--- a/remoting/protocol/channel_dispatcher_base.cc
+++ b/remoting/protocol/channel_dispatcher_base.cc
@@ -29,7 +29,8 @@ void ChannelDispatcherBase::Init(Session* session,
const ChannelConfig& config,
EventHandler* event_handler) {
DCHECK(session);
- switch (config.transport) {
+ channel_config_ = config;
+ switch (channel_config_.transport) {
case ChannelConfig::TRANSPORT_MUX_STREAM:
channel_factory_ = session->GetMultiplexedChannelFactory();
break;
@@ -39,7 +40,7 @@ void ChannelDispatcherBase::Init(Session* session,
break;
default:
- LOG(FATAL) << "Unknown transport type: " << config.transport;
+ LOG(FATAL) << "Unknown transport type: " << channel_config_.transport;
}
event_handler_ = event_handler;
@@ -48,10 +49,14 @@ void ChannelDispatcherBase::Init(Session* session,
&ChannelDispatcherBase::OnChannelReady, base::Unretained(this)));
}
+void ChannelDispatcherBase::NotifyError(ErrorCode error) {
+ event_handler_->OnChannelError(this, error);
+}
+
void ChannelDispatcherBase::OnChannelReady(
scoped_ptr<net::StreamSocket> socket) {
if (!socket.get()) {
- event_handler_->OnChannelError(this, CHANNEL_CONNECTION_ERROR);
+ NotifyError(CHANNEL_CONNECTION_ERROR);
return;
}
@@ -65,7 +70,7 @@ void ChannelDispatcherBase::OnChannelReady(
}
void ChannelDispatcherBase::OnWriteFailed(int error) {
- event_handler_->OnChannelError(this, CHANNEL_CONNECTION_ERROR);
+ NotifyError(CHANNEL_CONNECTION_ERROR);
}
} // namespace protocol

Powered by Google App Engine
This is Rietveld 408576698