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

Unified Diff: remoting/protocol/connection_to_client.cc

Issue 8476018: Move ConnectionToClient::EventHandler from ChromotingHost to ClientSession (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged 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/connection_to_client_unittest.cc » ('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 9c9285660d6870c56a9e5982cdbe4668d0de28e4..6b2bbd11a124a5028cc9928c822ca38249fef476 100644
--- a/remoting/protocol/connection_to_client.cc
+++ b/remoting/protocol/connection_to_client.cc
@@ -14,27 +14,23 @@
#include "remoting/protocol/host_stub.h"
#include "remoting/protocol/input_stub.h"
-// TODO(hclam): Remove this header once MessageDispatcher is used.
-#include "remoting/base/compound_buffer.h"
-
namespace remoting {
namespace protocol {
-// Determine how many update streams we should count to find the size of
-// average update stream.
-static const size_t kAverageUpdateStream = 10;
-
ConnectionToClient::ConnectionToClient(base::MessageLoopProxy* message_loop,
- EventHandler* handler)
+ protocol::Session* session)
: message_loop_(message_loop),
- handler_(handler),
+ handler_(NULL),
host_stub_(NULL),
input_stub_(NULL),
+ session_(session),
control_connected_(false),
input_connected_(false),
video_connected_(false) {
DCHECK(message_loop_);
- DCHECK(handler_);
+ session_->SetStateChangeCallback(
+ base::Bind(&ConnectionToClient::OnSessionStateChange,
+ base::Unretained(this)));
}
ConnectionToClient::~ConnectionToClient() {
@@ -42,12 +38,9 @@ ConnectionToClient::~ConnectionToClient() {
// connection.
}
-void ConnectionToClient::Init(protocol::Session* session) {
+void ConnectionToClient::SetEventHandler(EventHandler* event_handler) {
DCHECK(message_loop_->BelongsToCurrentThread());
- session_.reset(session);
- session_->SetStateChangeCallback(
- base::Bind(&ConnectionToClient::OnSessionStateChange,
- base::Unretained(this)));
+ handler_ = event_handler;
}
protocol::Session* ConnectionToClient::session() {
« no previous file with comments | « remoting/protocol/connection_to_client.h ('k') | remoting/protocol/connection_to_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698