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

Unified Diff: remoting/protocol/client_message_dispatcher.cc

Issue 8116021: Switch remoting/protocol to new callbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 2 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/client_stub.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 68bf46179daed19cd8b15b47c6839b8456d5fc28..31123064f387d112e0efd933a41227df91a1bb0d 100644
--- a/remoting/protocol/client_message_dispatcher.cc
+++ b/remoting/protocol/client_message_dispatcher.cc
@@ -33,12 +33,13 @@ void ClientMessageDispatcher::Initialize(
control_message_reader_->Init(
session->control_channel(),
- NewCallback(this, &ClientMessageDispatcher::OnControlMessageReceived));
+ base::Bind(&ClientMessageDispatcher::OnControlMessageReceived,
+ base::Unretained(this)));
return;
}
void ClientMessageDispatcher::OnControlMessageReceived(
- ControlMessage* message, Task* done_task) {
+ ControlMessage* message, const base::Closure& done_task) {
if (message->has_begin_session_response()) {
const BeginSessionResponse& response = message->begin_session_response();
if (response.has_login_status() &&
@@ -51,8 +52,7 @@ void ClientMessageDispatcher::OnControlMessageReceived(
LOG(WARNING) << "Invalid control message received.";
- done_task->Run();
- delete done_task;
+ done_task.Run();
}
} // namespace protocol
« no previous file with comments | « remoting/protocol/client_message_dispatcher.h ('k') | remoting/protocol/client_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698