Make DBus a singleton.
All the proxies need dbus to initialize, so we are passing dbus around,
to make it easier to compile dbus conditionally, this patch makes it a
singleton so that the proxies can get dbus on their own.
Test: mma
Bug: 28800946
Change-Id: Idf062c843aa34a431c2201bae5b895dc1d0ea787
diff --git a/shill_proxy.cc b/shill_proxy.cc
index 1c050b4..6049ee2 100644
--- a/shill_proxy.cc
+++ b/shill_proxy.cc
@@ -16,6 +16,8 @@
#include "update_engine/shill_proxy.h"
+#include "update_engine/dbus_connection.h"
+
using org::chromium::flimflam::ManagerProxy;
using org::chromium::flimflam::ManagerProxyInterface;
using org::chromium::flimflam::ServiceProxy;
@@ -23,9 +25,8 @@
namespace chromeos_update_engine {
-ShillProxy::ShillProxy(const scoped_refptr<dbus::Bus>& bus) : bus_(bus) {}
-
bool ShillProxy::Init() {
+ bus_ = DBusConnection::Get()->GetDBus();
manager_proxy_.reset(new ManagerProxy(bus_));
return true;
}