Track active references in ShillClientHelper (Take 2)
[chromium-blink-merge.git] / chromeos / dbus / dbus_client.h
blob902d533255030036868db325c5d31cab74304665
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROMEOS_DBUS_DBUS_CLIENT_H_
6 #define CHROMEOS_DBUS_DBUS_CLIENT_H_
8 namespace dbus {
9 class Bus;
12 namespace chromeos {
14 // Interface for all DBus clients handled by DBusThreadManager. It restricts
15 // access to the Init function to DBusThreadManagerImpl only to prevent
16 // incorrect calls. Stub clients may lift that restriction however.
17 class DBusClient {
18 protected:
19 friend class DBusThreadManagerImpl;
21 virtual ~DBusClient() {}
23 // This function is called by DBusThreadManager. Only in unit tests, which
24 // don't use DBusThreadManager, this function can be called through Stub
25 // implementations (they change Init's member visibility to public).
26 virtual void Init(dbus::Bus* bus) = 0;
28 private:
29 DISALLOW_ASSIGN(DBusClient);
32 } // namespace chromeos
34 #endif // CHROMEOS_DBUS_DBUS_CLIENT_H_