summaryrefslogtreecommitdiffstats
path: root/remoting/protocol/connection_to_host.cc
diff options
context:
space:
mode:
authorgarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-04 21:31:44 +0000
committergarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-04 21:31:44 +0000
commitf0a9d1b2f35d1a0ae2c532b86fb3fd78b1c5465b (patch)
treecdbb2dde6847f6f36f8a0f8f6fe33d0192382b7a /remoting/protocol/connection_to_host.cc
parent0e5eeb0f24d0874a2ff2e8f491d0d7fbd1921527 (diff)
downloadchromium_src-f0a9d1b2f35d1a0ae2c532b86fb3fd78b1c5465b.zip
chromium_src-f0a9d1b2f35d1a0ae2c532b86fb3fd78b1c5465b.tar.gz
chromium_src-f0a9d1b2f35d1a0ae2c532b86fb3fd78b1c5465b.tar.bz2
Block event processing on host/client until the client has authenticated.
Input events: * Client will not send them * Host will not process them Control events: * Client will only process BeginSessionResponse * Host will only process BeginSessionRequest All other control messages will be ignored. BUG=72466 TEST=manual+tests Review URL: http://codereview.chromium.org/6594138 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76974 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol/connection_to_host.cc')
-rw-r--r--remoting/protocol/connection_to_host.cc18
1 files changed, 16 insertions, 2 deletions
diff --git a/remoting/protocol/connection_to_host.cc b/remoting/protocol/connection_to_host.cc
index 3d34997..2ef3a22 100644
--- a/remoting/protocol/connection_to_host.cc
+++ b/remoting/protocol/connection_to_host.cc
@@ -25,7 +25,8 @@ ConnectionToHost::ConnectionToHost(
JingleThread* thread,
talk_base::NetworkManager* network_manager,
talk_base::PacketSocketFactory* socket_factory)
- : thread_(thread),
+ : client_authenticated_(false),
+ thread_(thread),
network_manager_(network_manager),
socket_factory_(socket_factory),
event_callback_(NULL),
@@ -190,7 +191,6 @@ void ConnectionToHost::OnSessionStateChange(
// Initialize reader and writer.
video_reader_.reset(VideoReader::Create(session_->config()));
video_reader_->Init(session_, video_stub_);
- input_stub_.reset(new InputSender(session_->event_channel()));
host_stub_.reset(new HostControlSender(session_->control_channel()));
dispatcher_->Initialize(session_.get(), client_stub_);
event_callback_->OnConnectionOpened(this);
@@ -202,5 +202,19 @@ void ConnectionToHost::OnSessionStateChange(
}
}
+void ConnectionToHost::OnClientAuthenticated() {
+ client_authenticated_ = true;
+
+ // Create and enable the input stub now that we're authenticated.
+ input_stub_.reset(new InputSender(session_->event_channel()));
+ input_stub_->OnAuthenticated();
+
+ // Enable control channel stubs.
+ if (host_stub_.get())
+ host_stub_->OnAuthenticated();
+ if (client_stub_)
+ client_stub_->OnAuthenticated();
+}
+
} // namespace protocol
} // namespace remoting