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/device_info.cc b/device_info.cc
index 5df6be3..2534db3 100644
--- a/device_info.cc
+++ b/device_info.cc
@@ -20,11 +20,11 @@
#include <string>
-#include <base/callback_old.h>
+#include <base/bind.h>
#include <base/file_util.h>
#include <base/logging.h>
#include <base/memory/scoped_ptr.h>
-#include <base/stl_util-inl.h>
+#include <base/stl_util.h>
#include <base/string_number_conversions.h>
#include <base/string_util.h>
#include <base/stringprintf.h>
@@ -40,6 +40,8 @@
#include "shill/service.h"
#include "shill/wifi.h"
+using base::Bind;
+using base::Unretained;
using std::map;
using std::string;
using std::vector;
@@ -75,8 +77,8 @@
dispatcher_(dispatcher),
metrics_(metrics),
manager_(manager),
- link_callback_(NewCallback(this, &DeviceInfo::LinkMsgHandler)),
- address_callback_(NewCallback(this, &DeviceInfo::AddressMsgHandler)),
+ link_callback_(Bind(&DeviceInfo::LinkMsgHandler, Unretained(this))),
+ address_callback_(Bind(&DeviceInfo::AddressMsgHandler, Unretained(this))),
link_listener_(NULL),
address_listener_(NULL),
rtnl_handler_(RTNLHandler::GetInstance()) {
@@ -90,9 +92,9 @@
void DeviceInfo::Start() {
link_listener_.reset(
- new RTNLListener(RTNLHandler::kRequestLink, link_callback_.get()));
+ new RTNLListener(RTNLHandler::kRequestLink, link_callback_));
address_listener_.reset(
- new RTNLListener(RTNLHandler::kRequestAddr, address_callback_.get()));
+ new RTNLListener(RTNLHandler::kRequestAddr, address_callback_));
rtnl_handler_->RequestDump(RTNLHandler::kRequestLink |
RTNLHandler::kRequestAddr);
}