| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMEOS_DBUS_DBUS_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_DBUS_CLIENT_H_ |
| 6 #define CHROMEOS_DBUS_DBUS_CLIENT_H_ | 6 #define CHROMEOS_DBUS_DBUS_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 | 9 |
| 10 namespace dbus { | 10 namespace dbus { |
| 11 class Bus; | 11 class Bus; |
| 12 } // namespace dbus | 12 } // namespace dbus |
| 13 | 13 |
| 14 namespace chromeos { | 14 namespace chromeos { |
| 15 | 15 |
| 16 // Interface for all DBus clients handled by DBusThreadManager. It restricts | 16 // Interface for all DBus clients handled by DBusThreadManager. It restricts |
| 17 // access to the Init function to DBusThreadManager only to prevent | 17 // access to the Init function to DBusThreadManager only to prevent |
| 18 // incorrect calls. Stub clients may lift that restriction however. | 18 // incorrect calls. Stub clients may lift that restriction however. |
| 19 class DBusClient { | 19 class DBusClient { |
| 20 protected: | 20 protected: |
| 21 virtual ~DBusClient() {} | 21 virtual ~DBusClient() {} |
| 22 | 22 |
| 23 // This function is called by DBusThreadManager. Only in unit tests, which | 23 // This function is called by DBusThreadManager. Only in unit tests, which |
| 24 // don't use DBusThreadManager, this function can be called through Stub | 24 // don't use DBusThreadManager, this function can be called through Stub |
| 25 // implementations (they change Init's member visibility to public). | 25 // implementations (they change Init's member visibility to public). |
| 26 virtual void Init(dbus::Bus* bus) = 0; | 26 virtual void Init(dbus::Bus* bus) = 0; |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 friend class DBusThreadManager; | 29 friend class DBusClientsAsh; |
| 30 friend class DBusClientsBrowser; |
| 31 friend class DBusClientsCommon; |
| 30 | 32 |
| 31 DISALLOW_ASSIGN(DBusClient); | 33 DISALLOW_ASSIGN(DBusClient); |
| 32 }; | 34 }; |
| 33 | 35 |
| 34 } // namespace chromeos | 36 } // namespace chromeos |
| 35 | 37 |
| 36 #endif // CHROMEOS_DBUS_DBUS_CLIENT_H_ | 38 #endif // CHROMEOS_DBUS_DBUS_CLIENT_H_ |
| OLD | NEW |