shill: Move Metrics from singleton to Shill daemon
While implementing chromium-os:24810, it was discovered that Metrics is
cleaner if it is passed around like ControlInterface, Dispatcher,
Manager, etc. This approach also makes Metrics more testable.
BUG=chromium-os:24810
TEST=Unit tests, network_WiFiManager suite
Change-Id: I556a1bd11f21f0b93ecfeaae8855dfb99ed5e5f9
Reviewed-on: https://gerrit.chromium.org/gerrit/14099
Commit-Ready: Thieu Le <thieule@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
diff --git a/device.h b/device.h
index 422e7a6..cb82509 100644
--- a/device.h
+++ b/device.h
@@ -30,6 +30,7 @@
class Error;
class EventDispatcher;
class Manager;
+class Metrics;
class RTNLHandler;
class ReturnerInterface;
@@ -40,6 +41,7 @@
// A constructor for the Device object
Device(ControlInterface *control_interface,
EventDispatcher *dispatcher,
+ Metrics *metrics,
Manager *manager,
const std::string &link_name,
const std::string &address,
@@ -175,6 +177,7 @@
// Property getters reserved for subclasses
ControlInterface *control_interface() const { return control_interface_; }
+ Metrics *metrics() const { return metrics_; }
Manager *manager() const { return manager_; }
bool running() const { return running_; }
@@ -227,6 +230,7 @@
const std::string unique_id_;
ControlInterface *control_interface_;
EventDispatcher *dispatcher_;
+ Metrics *metrics_;
Manager *manager_;
IPConfigRefPtr ipconfig_;
ConnectionRefPtr connection_;