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

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: Tweak. 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
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..a84f6fade781f1e042b789a4832121d73116263b 100644
--- a/remoting/protocol/host_message_dispatcher.cc
+++ b/remoting/protocol/host_message_dispatcher.cc
@@ -49,43 +49,32 @@ 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.";
Wez 2011/03/30 20:24:57 If not authenticated, disconnect?
simonmorris 2011/03/31 11:14:00 Could be good, in another CL.
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);
+ } 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;
Wez 2011/03/30 20:24:57 If not authenticated, disconnect? nit: This block
simonmorris 2011/03/31 11:14:00 Done.
}
}

Powered by Google App Engine
This is Rietveld 408576698