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

Unified Diff: remoting/protocol/client_message_dispatcher.cc

Issue 6271004: Changed MessageReader so that it doesn't read from the socket if there are (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ref-counted MessageReader Created 9 years, 11 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/client_message_dispatcher.h ('k') | remoting/protocol/fake_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/client_message_dispatcher.cc
diff --git a/remoting/protocol/client_message_dispatcher.cc b/remoting/protocol/client_message_dispatcher.cc
index 95686850f895e60ba3ea62e3fc949840b77da8a5..e7b6dd6d324efc41b9be9367714dfeeb7410af9f 100644
--- a/remoting/protocol/client_message_dispatcher.cc
+++ b/remoting/protocol/client_message_dispatcher.cc
@@ -11,7 +11,6 @@
#include "remoting/protocol/client_stub.h"
#include "remoting/protocol/input_stub.h"
#include "remoting/protocol/message_reader.h"
-#include "remoting/protocol/ref_counted_message.h"
#include "remoting/protocol/session.h"
namespace remoting {
@@ -39,18 +38,18 @@ void ClientMessageDispatcher::Initialize(
}
void ClientMessageDispatcher::OnControlMessageReceived(
- ControlMessage* message) {
- scoped_refptr<RefCountedMessage<ControlMessage> > ref_msg =
- new RefCountedMessage<ControlMessage>(message);
+ ControlMessage* message, Task* done_task) {
+ // TODO(sergeyu): Add message validation.
if (message->has_notify_resolution()) {
client_stub_->NotifyResolution(
- &message->notify_resolution(), NewDeleteTask(ref_msg));
+ &message->notify_resolution(), done_task);
} else if (message->has_begin_session_response()) {
client_stub_->BeginSessionResponse(
- &message->begin_session_response().login_status(),
- NewDeleteTask(ref_msg));
+ &message->begin_session_response().login_status(), done_task);
} else {
- NOTREACHED() << "Invalid control message received";
+ LOG(WARNING) << "Invalid control message received.";
+ done_task->Run();
+ delete done_task;
}
}
« no previous file with comments | « remoting/protocol/client_message_dispatcher.h ('k') | remoting/protocol/fake_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698