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

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
« no previous file with comments | « remoting/protocol/connection_to_client.h ('k') | remoting/protocol/host_control_dispatcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/connection_to_client.cc
diff --git a/remoting/protocol/connection_to_client.cc b/remoting/protocol/connection_to_client.cc
index d31165fa79537616562eeb6460e52b31da562f3e..84ad51592493a80b0b0aacd6fba146d66c21210d 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_event_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,14 @@ 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());
+ control_dispatcher_->Init(session_.get());
+ control_dispatcher_->set_host_stub(host_stub_);
+ input_dispatcher_.reset(new HostEventDispatcher());
+ input_dispatcher_->Init(session_.get());
+ input_dispatcher_->set_input_stub(input_stub_);
+ input_dispatcher_->set_sequence_number_callback(base::Bind(
+ &ConnectionToClient::UpdateSequenceNumber, base::Unretained(this)));
control_connected_ = true;
input_connected_ = true;
@@ -162,9 +165,9 @@ void ConnectionToClient::CloseOnError() {
}
void ConnectionToClient::CloseChannels() {
+ control_dispatcher_.reset();
+ input_dispatcher_.reset();
video_writer_.reset();
- client_control_sender_.reset();
- dispatcher_.reset();
}
} // namespace protocol
« no previous file with comments | « remoting/protocol/connection_to_client.h ('k') | remoting/protocol/host_control_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698