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

Unified Diff: remoting/protocol/connection_to_host.cc

Issue 8774017: Add AUTHENTICATED session state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years 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_host.h ('k') | remoting/protocol/jingle_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/connection_to_host.cc
diff --git a/remoting/protocol/connection_to_host.cc b/remoting/protocol/connection_to_host.cc
index c1145a7ef8301a90f83e1f6006fc57d5118fe2d5..50a59d983bf63988ce8ae76b9e45a285ecb261d4 100644
--- a/remoting/protocol/connection_to_host.cc
+++ b/remoting/protocol/connection_to_host.cc
@@ -159,6 +159,33 @@ void ConnectionToHost::OnSessionStateChange(
DCHECK(event_callback_);
switch (state) {
+ case Session::INITIALIZING:
+ case Session::CONNECTING:
+ case Session::CONNECTED:
+ // Don't care about these events.
+ break;
+
+ case Session::AUTHENTICATED:
+ video_reader_.reset(VideoReader::Create(
+ message_loop_, session_->config()));
+ video_reader_->Init(session_.get(), video_stub_, base::Bind(
+ &ConnectionToHost::OnChannelInitialized, base::Unretained(this)));
+
+ control_dispatcher_.reset(new ClientControlDispatcher());
+ control_dispatcher_->Init(session_.get(), base::Bind(
+ &ConnectionToHost::OnChannelInitialized, base::Unretained(this)));
+ control_dispatcher_->set_client_stub(client_stub_);
+
+ event_dispatcher_.reset(new ClientEventDispatcher());
+ event_dispatcher_->Init(session_.get(), base::Bind(
+ &ConnectionToHost::OnChannelInitialized, base::Unretained(this)));
+ break;
+
+ case Session::CLOSED:
+ CloseChannels();
+ SetState(CLOSED, OK);
+ break;
+
case Session::FAILED:
switch (session_->error()) {
case Session::PEER_IS_OFFLINE:
@@ -179,31 +206,6 @@ void ConnectionToHost::OnSessionStateChange(
CloseOnError(NETWORK_FAILURE);
}
break;
-
- case Session::CLOSED:
- CloseChannels();
- SetState(CLOSED, OK);
- break;
-
- case Session::CONNECTED:
- video_reader_.reset(VideoReader::Create(
- message_loop_, session_->config()));
- video_reader_->Init(session_.get(), video_stub_, base::Bind(
- &ConnectionToHost::OnChannelInitialized, base::Unretained(this)));
-
- control_dispatcher_.reset(new ClientControlDispatcher());
- control_dispatcher_->Init(session_.get(), base::Bind(
- &ConnectionToHost::OnChannelInitialized, base::Unretained(this)));
- control_dispatcher_->set_client_stub(client_stub_);
-
- event_dispatcher_.reset(new ClientEventDispatcher());
- event_dispatcher_->Init(session_.get(), base::Bind(
- &ConnectionToHost::OnChannelInitialized, base::Unretained(this)));
- break;
-
- default:
- // Ignore the other states by default.
- break;
}
}
@@ -223,7 +225,6 @@ void ConnectionToHost::NotifyIfChannelsReady() {
video_reader_.get() && video_reader_->is_connected() &&
state_ == CONNECTING) {
SetState(CONNECTED, OK);
- SetState(AUTHENTICATED, OK);
}
}
« no previous file with comments | « remoting/protocol/connection_to_host.h ('k') | remoting/protocol/jingle_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698