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

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: proper handling of empty messages 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
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..d04bb38fbd5c7f3c6234fd812baa9920a73d69d1 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,17 @@ void ClientMessageDispatcher::Initialize(
}
void ClientMessageDispatcher::OnControlMessageReceived(
- ControlMessage* message) {
- scoped_refptr<RefCountedMessage<ControlMessage> > ref_msg =
- new RefCountedMessage<ControlMessage>(message);
+ ControlMessage* message, Task* done_task) {
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(ERROR) << "Invalid control message received.";
awong 2011/01/20 20:06:38 LOG(WARNING) please. Let's try to keep LOG(ERROR)
Alpha Left Google 2011/01/20 20:54:52 If it's something really unexpected like this then
awong 2011/01/20 21:01:56 Is the API contract that the control message is va
Sergey Ulanov 2011/01/20 21:55:57 Done.
Sergey Ulanov 2011/01/20 21:55:57 If you put NOTREACHED here, it will be very easy t
Sergey Ulanov 2011/01/20 21:55:57 No, it is not API contract here. |message| is just
awong 2011/01/20 22:08:02 Yep...completley understood. Can you file a P1 bu
Sergey Ulanov 2011/01/21 03:45:05 Added TODO, and filed a bug. I don't agree that th
+ done_task->Run();
+ delete done_task;
}
}

Powered by Google App Engine
This is Rietveld 408576698