summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus/shill_service_client.h
diff options
context:
space:
mode:
authorpneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-27 12:23:04 +0000
committerpneubeck@chromium.org <pneubeck@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-27 12:23:04 +0000
commitc5fd536cbf85dea5a3bc200a515bdf6cf75b2576 (patch)
tree1f233003e6f5d34428c73b318a89454b7c7ee23b /chromeos/dbus/shill_service_client.h
parent072414940357abff52558f794af018adfeb6f0d7 (diff)
downloadchromium_src-c5fd536cbf85dea5a3bc200a515bdf6cf75b2576.zip
chromium_src-c5fd536cbf85dea5a3bc200a515bdf6cf75b2576.tar.gz
chromium_src-c5fd536cbf85dea5a3bc200a515bdf6cf75b2576.tar.bz2
Split construction and initialization of DBus clients.
Before, each Client had a Create function which constructed an instance of the client and initialized it (with a dbus::Bus*). To make the Clients separately replaceable in the DBusThreadManager, it's necessary to separate the construction of the Clients from their initialization. This CL, splits each Create function into Create (which only calls the constructor of either the real Impl or the Stub) and Init(dbus::Bus*). This is a pure refactoring. BUG=275286 Review URL: https://chromiumcodereview.appspot.com/23119006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219775 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus/shill_service_client.h')
-rw-r--r--chromeos/dbus/shill_service_client.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/chromeos/dbus/shill_service_client.h b/chromeos/dbus/shill_service_client.h
index 0ee87a0..6280f2c 100644
--- a/chromeos/dbus/shill_service_client.h
+++ b/chromeos/dbus/shill_service_client.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/callback.h"
#include "chromeos/chromeos_export.h"
+#include "chromeos/dbus/dbus_client.h"
#include "chromeos/dbus/dbus_client_implementation_type.h"
#include "chromeos/dbus/shill_client_helper.h"
@@ -22,7 +23,6 @@ class DictionaryValue;
namespace dbus {
-class Bus;
class ObjectPath;
} // namespace dbus
@@ -33,7 +33,7 @@ namespace chromeos {
// service.
// All methods should be called from the origin thread which initializes the
// DBusThreadManager instance.
-class CHROMEOS_EXPORT ShillServiceClient {
+class CHROMEOS_EXPORT ShillServiceClient : public DBusClient {
public:
typedef ShillClientHelper::PropertyChangedHandler PropertyChangedHandler;
typedef ShillClientHelper::DictionaryValueCallback DictionaryValueCallback;
@@ -85,8 +85,7 @@ class CHROMEOS_EXPORT ShillServiceClient {
// Factory function, creates a new instance which is owned by the caller.
// For normal usage, access the singleton via DBusThreadManager::Get().
- static ShillServiceClient* Create(DBusClientImplementationType type,
- dbus::Bus* bus);
+ static ShillServiceClient* Create(DBusClientImplementationType type);
// Adds a property changed |observer| to the service at |service_path|.
virtual void AddPropertyChangedObserver(
@@ -184,6 +183,8 @@ class CHROMEOS_EXPORT ShillServiceClient {
virtual TestInterface* GetTestInterface() = 0;
protected:
+ friend class ShillServiceClientTest;
+
// Create() should be used instead.
ShillServiceClient();