shill: Clean up Callback80211
Make Callback80211 objects access Config80211 through the static getter
instead of via a pointer injected at instantiation time. Stop
duplicating base::Callback objects and use method overriding to
implement the same thing.
BUG=chromium-os:36122
TEST=Unit tests
Change-Id: I73c4eb0f807240b4ea949fa70a9a3dd3954e91a0
Reviewed-on: https://gerrit.chromium.org/gerrit/37861
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
Commit-Ready: Christopher Wiley <wiley@chromium.org>
diff --git a/callback80211_metrics.h b/callback80211_metrics.h
index 4545be1..7bdd4ea 100644
--- a/callback80211_metrics.h
+++ b/callback80211_metrics.h
@@ -8,43 +8,28 @@
#ifndef SHILL_CALLBACK80211_METRICS_H
#define SHILL_CALLBACK80211_METRICS_H
-#include <iomanip>
-#include <map>
-#include <string>
-
#include <base/basictypes.h>
-#include <base/bind.h>
-#include <base/memory/weak_ptr.h>
#include "shill/callback80211_object.h"
namespace shill {
-class Config80211;
class Metrics;
class UserBoundNlMessage;
// Config80211 callback object that sends stuff to UMA metrics.
class Callback80211Metrics : public Callback80211Object {
public:
- Callback80211Metrics(Config80211 *config80211, Metrics *metrics);
+ explicit Callback80211Metrics(Metrics *metrics);
- // Install ourselves as a callback.
- virtual bool InstallAsBroadcastCallback();
-
- private:
- // When installed, this is the method Config80211 will call when it gets a
- // message from the mac80211 drivers.
+ protected:
virtual void Config80211MessageCallback(const UserBoundNlMessage &msg);
+ private:
static const char kMetricLinkDisconnectCount[];
Metrics *metrics_;
- // Config80211MessageCallback method bound to this object to install as a
- // callback.
- base::WeakPtrFactory<Callback80211Metrics> weak_ptr_factory_;
-
DISALLOW_COPY_AND_ASSIGN(Callback80211Metrics);
};