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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 // |InitiailzeForTesting|. The injected object will be owned by the | 94 // |InitiailzeForTesting|. The injected object will be owned by the |
95 // internal pointer and deleted by Shutdown(). | 95 // internal pointer and deleted by Shutdown(). |
96 static void SetInstanceForTesting(DBusThreadManager* dbus_thread_manager); | 96 static void SetInstanceForTesting(DBusThreadManager* dbus_thread_manager); |
97 | 97 |
98 // Similar to Initialize(), but injects an alternative | 98 // Similar to Initialize(), but injects an alternative |
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 global thread manager instance. | |
105 static void InitializeRegular(); | |
hashimoto
2014/08/08 02:06:16
Do InitilizeRegular() and InitializeWithPartialStu
zel
2014/08/08 19:00:15
Done.
| |
106 | |
104 // Initialize with stub implementations for tests, creating a complete set | 107 // Initialize with stub implementations for tests, creating a complete set |
105 // of fake/stub client implementations. Also initializes a default set of | 108 // of fake/stub client implementations. Also initializes a default set of |
106 // fake Shill devices and services, customizable with switches::kShillStub. | 109 // fake Shill devices and services, customizable with switches::kShillStub. |
107 static void InitializeWithStub(); | 110 static void InitializeWithStub(); |
108 | 111 |
112 // Initialize with stub implementations for only certain clients that are | |
113 // not included in comma-separated |unstub_clients| list. | |
114 static void InitializeWithPartialStub(const std::string& unstub_clients); | |
115 | |
109 // Returns true if DBusThreadManager has been initialized. Call this to | 116 // Returns true if DBusThreadManager has been initialized. Call this to |
110 // avoid initializing + shutting down DBusThreadManager more than once. | 117 // avoid initializing + shutting down DBusThreadManager more than once. |
111 static bool IsInitialized(); | 118 static bool IsInitialized(); |
112 | 119 |
113 // Destroys the global instance. | 120 // Destroys the global instance. |
114 static void Shutdown(); | 121 static void Shutdown(); |
115 | 122 |
116 // Gets the global instance. Initialize() must be called first. | 123 // Gets the global instance. Initialize() must be called first. |
117 static DBusThreadManager* Get(); | 124 static DBusThreadManager* Get(); |
118 | 125 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
176 | 183 |
177 // Initializes |client| with the |system_bus_|. | 184 // Initializes |client| with the |system_bus_|. |
178 static void InitClient(DBusClient* client); | 185 static void InitClient(DBusClient* client); |
179 | 186 |
180 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager); | 187 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager); |
181 }; | 188 }; |
182 | 189 |
183 } // namespace chromeos | 190 } // namespace chromeos |
184 | 191 |
185 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ | 192 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ |
OLD | NEW |