Index: remoting/protocol/connection_to_client.cc |
diff --git a/remoting/protocol/connection_to_client.cc b/remoting/protocol/connection_to_client.cc |
index 7579463ffc357938f33af88da327bb715423bb0f..2ce6ad6f9b3f288c74abb7228895c18690f2b551 100644 |
--- a/remoting/protocol/connection_to_client.cc |
+++ b/remoting/protocol/connection_to_client.cc |
@@ -9,8 +9,8 @@ |
#include "base/message_loop_proxy.h" |
#include "google/protobuf/message.h" |
#include "net/base/io_buffer.h" |
-#include "remoting/protocol/client_control_sender.h" |
-#include "remoting/protocol/host_message_dispatcher.h" |
+#include "remoting/protocol/host_control_dispatcher.h" |
+#include "remoting/protocol/host_input_dispatcher.h" |
#include "remoting/protocol/host_stub.h" |
#include "remoting/protocol/input_stub.h" |
@@ -78,7 +78,7 @@ VideoStub* ConnectionToClient::video_stub() { |
// Return pointer to ClientStub. |
ClientStub* ConnectionToClient::client_stub() { |
DCHECK(CalledOnValidThread()); |
- return client_control_sender_.get(); |
+ return control_dispatcher_.get(); |
} |
void ConnectionToClient::set_host_stub(protocol::HostStub* host_stub) { |
@@ -110,11 +110,12 @@ void ConnectionToClient::OnSessionStateChange(protocol::Session::State state) { |
break; |
case protocol::Session::CONNECTED_CHANNELS: |
- client_control_sender_.reset( |
- new ClientControlSender(base::MessageLoopProxy::current(), |
- session_->control_channel())); |
- dispatcher_.reset(new HostMessageDispatcher()); |
- dispatcher_->Initialize(this, host_stub_, input_stub_); |
+ control_dispatcher_.reset( |
+ new HostControlDispatcher(base::MessageLoopProxy::current())); |
+ control_dispatcher_->Init(session_.get(), host_stub_); |
+ input_dispatcher_.reset(new HostInputDispatcher()); |
+ input_dispatcher_->Init(session_.get(), input_stub_, base::Bind( |
+ &ConnectionToClient::UpdateSequenceNumber, base::Unretained(this))); |
control_connected_ = true; |
input_connected_ = true; |
@@ -162,10 +163,9 @@ void ConnectionToClient::CloseOnError() { |
} |
void ConnectionToClient::CloseChannels() { |
- if (video_writer_.get()) |
- video_writer_->Close(); |
- if (client_control_sender_.get()) |
- client_control_sender_->Close(); |
+ control_dispatcher_.reset(); |
+ input_dispatcher_.reset(); |
+ video_writer_.reset(); |
} |
} // namespace protocol |