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

Unified Diff: remoting/protocol/host_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/host_message_dispatcher.h ('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 1e395da6a2d4cc5946675881158ecca5814e7db1..7af2cc1c82e7eef66311270597cbb9863d3a141f 100644
--- a/remoting/protocol/host_message_dispatcher.cc
+++ b/remoting/protocol/host_message_dispatcher.cc
@@ -44,14 +44,16 @@ void HostMessageDispatcher::Initialize(
// Initialize the readers on the sockets provided by channels.
event_message_reader_->Init(
connection->session()->event_channel(),
- NewCallback(this, &HostMessageDispatcher::OnEventMessageReceived));
+ base::Bind(&HostMessageDispatcher::OnEventMessageReceived,
+ base::Unretained(this)));
control_message_reader_->Init(
connection->session()->control_channel(),
- NewCallback(this, &HostMessageDispatcher::OnControlMessageReceived));
+ base::Bind(&HostMessageDispatcher::OnControlMessageReceived,
+ base::Unretained(this)));
}
void HostMessageDispatcher::OnControlMessageReceived(
- ControlMessage* message, Task* done_task) {
+ ControlMessage* message, const base::Closure& done_task) {
if (message->has_begin_session_request()) {
const BeginSessionRequest& request = message->begin_session_request();
if (request.has_credentials() && request.credentials().has_type()) {
@@ -61,13 +63,12 @@ void HostMessageDispatcher::OnControlMessageReceived(
}
LOG(WARNING) << "Invalid control message received.";
- done_task->Run();
- delete done_task;
+ done_task.Run();
}
void HostMessageDispatcher::OnEventMessageReceived(
- EventMessage* message, Task* done_task) {
- base::ScopedTaskRunner done_runner(done_task);
+ EventMessage* message, const base::Closure& done_task) {
+ base::ScopedClosureRunner done_runner(done_task);
connection_->UpdateSequenceNumber(message->sequence_number());
« no previous file with comments | « remoting/protocol/host_message_dispatcher.h ('k') | remoting/protocol/host_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698