| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_THREAD_MANAGER_H_ | 5 #ifndef CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ |
| 6 #define CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ | 6 #define CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // DBusThreadManager using SetInstanceForTest first. The injected | 99 // DBusThreadManager using SetInstanceForTest first. The injected |
| 100 // object will be owned by the internal pointer and deleted by | 100 // object will be owned by the internal pointer and deleted by |
| 101 // Shutdown(). Does not create any Fake client implementations. | 101 // Shutdown(). Does not create any Fake client implementations. |
| 102 static void InitializeForTesting(DBusThreadManager* dbus_thread_manager); | 102 static void InitializeForTesting(DBusThreadManager* dbus_thread_manager); |
| 103 | 103 |
| 104 // Initialize with stub implementations for tests, creating a complete set | 104 // Initialize with stub implementations for tests, creating a complete set |
| 105 // of fake/stub client implementations. Also initializes a default set of | 105 // of fake/stub client implementations. Also initializes a default set of |
| 106 // fake Shill devices and services, customizable with switches::kShillStub. | 106 // fake Shill devices and services, customizable with switches::kShillStub. |
| 107 static void InitializeWithStub(); | 107 static void InitializeWithStub(); |
| 108 | 108 |
| 109 // Initialize with stub implementations for only certain clients that are |
| 110 // not included in comma-separated |unstub_clients| list. |
| 111 static void InitializeWithPartialStub(const std::string& unstub_clients); |
| 112 |
| 109 // Returns true if DBusThreadManager has been initialized. Call this to | 113 // Returns true if DBusThreadManager has been initialized. Call this to |
| 110 // avoid initializing + shutting down DBusThreadManager more than once. | 114 // avoid initializing + shutting down DBusThreadManager more than once. |
| 111 static bool IsInitialized(); | 115 static bool IsInitialized(); |
| 112 | 116 |
| 113 // Destroys the global instance. | 117 // Destroys the global instance. |
| 114 static void Shutdown(); | 118 static void Shutdown(); |
| 115 | 119 |
| 116 // Gets the global instance. Initialize() must be called first. | 120 // Gets the global instance. Initialize() must be called first. |
| 117 static DBusThreadManager* Get(); | 121 static DBusThreadManager* Get(); |
| 118 | 122 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 180 |
| 177 // Initializes |client| with the |system_bus_|. | 181 // Initializes |client| with the |system_bus_|. |
| 178 static void InitClient(DBusClient* client); | 182 static void InitClient(DBusClient* client); |
| 179 | 183 |
| 180 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager); | 184 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager); |
| 181 }; | 185 }; |
| 182 | 186 |
| 183 } // namespace chromeos | 187 } // namespace chromeos |
| 184 | 188 |
| 185 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ | 189 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ |
| OLD | NEW |