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

Unified Diff: remoting/protocol/host_message_dispatcher.cc

Issue 6724033: Remove authenticated_ fields from stubs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address reviewer's comments. Created 9 years, 9 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 | « remoting/protocol/connection_to_host.cc ('k') | remoting/protocol/host_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/host_message_dispatcher.cc
diff --git a/remoting/protocol/host_message_dispatcher.cc b/remoting/protocol/host_message_dispatcher.cc
index c4964e196981db9a0a84547d1124c28f3fb9ed00..c793ce7c66345ca08f4841121623de2ad2ff713d 100644
--- a/remoting/protocol/host_message_dispatcher.cc
+++ b/remoting/protocol/host_message_dispatcher.cc
@@ -49,44 +49,35 @@ void HostMessageDispatcher::Initialize(
void HostMessageDispatcher::OnControlMessageReceived(
ControlMessage* message, Task* done_task) {
- // BeginSessionRequest is always allowed.
+ // TODO(sergeyu): Add message validation.
if (message->has_begin_session_request()) {
host_stub_->BeginSessionRequest(
&message->begin_session_request().credentials(), done_task);
return;
}
- if (!host_stub_->authenticated()) {
- // When the client has not authenticated with the host, no other messages
- // are allowed.
- LOG(WARNING) << "Invalid control message received "
- << "(client not authenticated).";
- } else {
- // TODO(sergeyu): Add message validation.
- if (message->has_suggest_resolution()) {
- host_stub_->SuggestResolution(&message->suggest_resolution(), done_task);
- return;
- } else {
- LOG(WARNING) << "Invalid control message received.";
- }
+ if (message->has_suggest_resolution()) {
+ host_stub_->SuggestResolution(&message->suggest_resolution(), done_task);
+ return;
}
+ LOG(WARNING) << "Invalid control message received.";
done_task->Run();
delete done_task;
}
void HostMessageDispatcher::OnEventMessageReceived(
EventMessage* message, Task* done_task) {
- if (input_stub_->authenticated()) {
- // TODO(sergeyu): Add message validation.
- if (message->has_key_event()) {
- input_stub_->InjectKeyEvent(&message->key_event(), done_task);
- } else if (message->has_mouse_event()) {
- input_stub_->InjectMouseEvent(&message->mouse_event(), done_task);
- } else {
- LOG(WARNING) << "Invalid event message received.";
- done_task->Run();
- delete done_task;
- }
+ // TODO(sergeyu): Add message validation.
+ if (message->has_key_event()) {
+ input_stub_->InjectKeyEvent(&message->key_event(), done_task);
+ return;
+ }
+ if (message->has_mouse_event()) {
+ input_stub_->InjectMouseEvent(&message->mouse_event(), done_task);
+ return;
}
+ LOG(WARNING) << "Invalid event message received.";
+ done_task->Run();
+ delete done_task;
}
} // namespace protocol
« no previous file with comments | « remoting/protocol/connection_to_host.cc ('k') | remoting/protocol/host_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698