summaryrefslogtreecommitdiffstats
path: root/device/bluetooth/dbus/bluez_dbus_client.h
diff options
context:
space:
mode:
Diffstat (limited to 'device/bluetooth/dbus/bluez_dbus_client.h')
-rw-r--r--device/bluetooth/dbus/bluez_dbus_client.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/device/bluetooth/dbus/bluez_dbus_client.h b/device/bluetooth/dbus/bluez_dbus_client.h
new file mode 100644
index 0000000..3dd0985
--- /dev/null
+++ b/device/bluetooth/dbus/bluez_dbus_client.h
@@ -0,0 +1,37 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DEVICE_BLUETOOTH_DBUS_BLUEZ_DBUS_CLIENT_H_
+#define DEVICE_BLUETOOTH_DBUS_BLUEZ_DBUS_CLIENT_H_
+
+#include "base/basictypes.h"
+
+namespace dbus {
+class Bus;
+} // namespace dbus
+
+namespace bluez {
+
+// Interface for all Bluez DBus clients handled by BluezDBusManager. It
+// restricts
+// access to the Init function to BluezDBusManager only to prevent
+// incorrect calls. Stub clients may lift that restriction however.
+class BluezDBusClient {
+ protected:
+ virtual ~BluezDBusClient() {}
+
+ // This function is called by DBusThreadManager. Only in unit tests, which
+ // don't use DBusThreadManager, this function can be called through Stub
+ // implementations (they change Init's member visibility to public).
+ virtual void Init(dbus::Bus* bus) = 0;
+
+ private:
+ friend class BluezDBusManager;
+
+ DISALLOW_ASSIGN(BluezDBusClient);
+};
+
+} // namespace bluez
+
+#endif // DEVICE_BLUETOOTH_DBUS_BLUEZ_DBUS_CLIENT_H_