base::Bind: Convert Tasks in ipc_sync_channel_unittest.cc.

BUG=none
TEST=none

R=groby@chromium.org

Review URL: http://codereview.chromium.org/8718003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111728 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: 0633e315df85edb2b96dff1518ab05a74dad15d1
diff --git a/ipc/ipc_sync_channel_unittest.cc b/ipc/ipc_sync_channel_unittest.cc
index 6982b28..4728997 100644
--- a/ipc/ipc_sync_channel_unittest.cc
+++ b/ipc/ipc_sync_channel_unittest.cc
@@ -1032,26 +1032,17 @@
 
 namespace {
 
-class NestedTask : public Task {
- public:
-  explicit NestedTask(Worker* server) : server_(server) {}
-  void Run() {
-    // Sleep a bit so that we wake up after the reply has been received.
-    base::PlatformThread::Sleep(250);
-    server_->SendAnswerToLife(true, base::kNoTimeout, true);
-  }
+void NestedCallback(Worker* server) {
+  // Sleep a bit so that we wake up after the reply has been received.
+  base::PlatformThread::Sleep(250);
+  server->SendAnswerToLife(true, base::kNoTimeout, true);
+}
 
-  Worker* server_;
-};
+bool timeout_occurred = false;
 
-static bool timeout_occured = false;
-
-class TimeoutTask : public Task {
- public:
-  void Run() {
-    timeout_occured = true;
-  }
-};
+void TimeoutCallback() {
+  timeout_occurred = true;
+}
 
 class DoneEventRaceServer : public Worker {
  public:
@@ -1059,14 +1050,16 @@
       : Worker(Channel::MODE_SERVER, "done_event_race_server") { }
 
   void Run() {
-    MessageLoop::current()->PostTask(FROM_HERE, new NestedTask(this));
-    MessageLoop::current()->PostDelayedTask(FROM_HERE, new TimeoutTask(), 9000);
+    MessageLoop::current()->PostTask(FROM_HERE,
+                                     base::Bind(&NestedCallback, this));
+    MessageLoop::current()->PostDelayedTask(
+        FROM_HERE, base::Bind(&TimeoutCallback), 9000);
     // Even though we have a timeout on the Send, it will succeed since for this
     // bug, the reply message comes back and is deserialized, however the done
     // event wasn't set.  So we indirectly use the timeout task to notice if a
     // timeout occurred.
     SendAnswerToLife(true, 10000, true);
-    DCHECK(!timeout_occured);
+    DCHECK(!timeout_occurred);
     Done();
   }
 };