shill: Putting UMA metrics in a separate nl80211 callback.
BUG=chromium-os:35466
TEST=Manual and unit tests.
Change-Id: I908f887a7ff3ce4d0bf33f1096cd61155c20e14a
Reviewed-on: https://gerrit.chromium.org/gerrit/35963
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Wade Guthrie <wdg@google.com>
Tested-by: Wade Guthrie <wdg@google.com>
diff --git a/shill_daemon.cc b/shill_daemon.cc
index dadacfc..ce8a26a 100644
--- a/shill_daemon.cc
+++ b/shill_daemon.cc
@@ -12,7 +12,7 @@
#include <base/bind.h>
#include <base/file_path.h>
-#include "shill/callback80211_object.h"
+#include "shill/callback80211_metrics.h"
#include "shill/config80211.h"
#include "shill/dhcp_provider.h"
#include "shill/error.h"
@@ -39,17 +39,17 @@
routing_table_(RoutingTable::GetInstance()),
dhcp_provider_(DHCPProvider::GetInstance()),
config80211_(Config80211::GetInstance()),
- callback80211_(Callback80211Object::GetInstance()),
manager_(new Manager(control_,
&dispatcher_,
&metrics_,
&glib_,
config->GetRunDirectory(),
config->GetStorageDirectory(),
- config->GetUserStorageDirectoryFormat())) {
+ config->GetUserStorageDirectoryFormat())),
+ callback80211_metrics_(config80211_, &metrics_) {
}
-Daemon::~Daemon() {}
+Daemon::~Daemon() { }
void Daemon::AddDeviceToBlackList(const string &device_name) {
manager_->AddDeviceToBlackList(device_name);
@@ -109,9 +109,7 @@
Config80211::kEventTypeMlme };
// Install |callback80211_| in the Config80211 singleton.
- callback80211_->set_metrics(&metrics_);
- callback80211_->set_config80211(config80211_);
- callback80211_->InstallAsCallback();
+ callback80211_metrics_.InstallAsCallback();
for (size_t i = 0; i < arraysize(kEvents); i++) {
config80211_->SubscribeToEvents(kEvents[i]);