shill: Convert code to use the newest version of libchrome.
The biggest change is a switch from using the deprecated
Task and CallbackN mechanisms to using the new Callback
mechanism.
Note: Original CL was https://gerrit.chromium.org/gerrit/16156.
This is logically another patch to that CL, but since the
latter was already merged, and is considered closed by
Gerrit, it's necessary to create a new CL.
BUG=chromium-os:15330
TEST=Build shill and run it on a zgb with a modem. Build and
run unit tests.
CQ-DEPEND=I37628863370323d30cac493764ea28f8ffd42637
Change-Id: I3ae78a3aa44ec167b79f2170d07650ece888254f
Reviewed-on: https://gerrit.chromium.org/gerrit/18030
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Tested-by: Eric Shienbrood <ers@chromium.org>
Commit-Ready: Eric Shienbrood <ers@chromium.org>
diff --git a/modem.cc b/modem.cc
index 0d4711b..b36b5c6 100644
--- a/modem.cc
+++ b/modem.cc
@@ -4,6 +4,7 @@
#include "shill/modem.h"
+#include <base/bind.h>
#include <base/logging.h>
#include <mm/mm-modem.h>
@@ -12,6 +13,7 @@
#include "shill/proxy_factory.h"
#include "shill/rtnl_handler.h"
+using base::Bind;
using std::string;
using std::vector;
@@ -33,7 +35,6 @@
: proxy_factory_(ProxyFactory::GetInstance()),
owner_(owner),
path_(path),
- task_factory_(this),
control_interface_(control_interface),
dispatcher_(dispatcher),
metrics_(metrics),
@@ -55,7 +56,7 @@
// Defer device creation because dbus-c++ doesn't allow registration of new
// D-Bus objects in the context of a D-Bus signal handler.
- dispatcher_->PostTask(task_factory_.NewRunnableMethod(&Modem::InitTask));
+ dispatcher_->PostTask(Bind(&Modem::InitTask, AsWeakPtr()));
}
void Modem::InitTask() {