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

Unified Diff: remoting/protocol/connection_to_client.cc

Issue 8468022: Refactor channel dispatchers on the host side. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 1 month 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/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

Powered by Google App Engine
This is Rietveld 408576698