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

Unified Diff: remoting/host/client_session.cc

Issue 7799014: Fix stuck keys problem with Chromoting when host disconnects while keys are (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update copyright Created 9 years, 4 months 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 | « no previous file | remoting/protocol/input_sender.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/client_session.cc
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
index 19c3d3677f882f8af30b11e4921317c9228279f5..9999db0eb1b9622b893174f01aa7796454047f66 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -23,6 +23,8 @@ static const int64 kRemoteBlockTimeoutMillis = 2000;
namespace remoting {
+using protocol::KeyEvent;
+
ClientSession::ClientSession(
EventHandler* event_handler,
UserAuthenticator* user_authenticator,
@@ -71,8 +73,7 @@ void ClientSession::OnAuthorizationComplete(bool success) {
}
}
-void ClientSession::InjectKeyEvent(const protocol::KeyEvent* event,
- Task* done) {
+void ClientSession::InjectKeyEvent(const KeyEvent* event, Task* done) {
base::ScopedTaskRunner done_runner(done);
if (authenticated_ && !ShouldIgnoreRemoteKeyboardInput(event)) {
RecordKeyEvent(event);
@@ -155,7 +156,7 @@ bool ClientSession::ShouldIgnoreRemoteMouseInput(
}
bool ClientSession::ShouldIgnoreRemoteKeyboardInput(
- const protocol::KeyEvent* event) const {
+ const KeyEvent* event) const {
// If the host user has not yet approved the continuation of the connection,
// then all remote keyboard input is ignored, except to release keys that
// were already pressed.
@@ -166,7 +167,7 @@ bool ClientSession::ShouldIgnoreRemoteKeyboardInput(
return false;
}
-void ClientSession::RecordKeyEvent(const protocol::KeyEvent* event) {
+void ClientSession::RecordKeyEvent(const KeyEvent* event) {
if (event->pressed()) {
pressed_keys_.insert(event->keycode());
} else {
@@ -177,10 +178,10 @@ void ClientSession::RecordKeyEvent(const protocol::KeyEvent* event) {
void ClientSession::UnpressKeys() {
std::set<int>::iterator i;
for (i = pressed_keys_.begin(); i != pressed_keys_.end(); ++i) {
- protocol::KeyEvent key;
- key.set_keycode(*i);
- key.set_pressed(false);
- input_stub_->InjectKeyEvent(&key, NULL);
+ KeyEvent* key = new KeyEvent();
+ key->set_keycode(*i);
+ key->set_pressed(false);
+ input_stub_->InjectKeyEvent(key, new DeleteTask<KeyEvent>(key));
}
pressed_keys_.clear();
}
« no previous file with comments | « no previous file | remoting/protocol/input_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698