Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: chromeos/dbus/dbus_thread_manager.h

Issue 444263002: Added switch that let us 'un-stub' certain dbus clients. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 InitializeThreadManager();
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 InitializeThreadManagerWithStub();
111
112 // Initialize with stub implementations for only certain clients that are
113 // not included in comma-separated |unstub_clients| list.
114 static void InitializeThreadManagerWithPartialStub(
115 const std::string& unstub_clients);
108 116
109 // Returns true if DBusThreadManager has been initialized. Call this to 117 // Returns true if DBusThreadManager has been initialized. Call this to
110 // avoid initializing + shutting down DBusThreadManager more than once. 118 // avoid initializing + shutting down DBusThreadManager more than once.
111 static bool IsInitialized(); 119 static bool IsInitialized();
112 120
113 // Destroys the global instance. 121 // Destroys the global instance.
114 static void Shutdown(); 122 static void Shutdown();
115 123
116 // Gets the global instance. Initialize() must be called first. 124 // Gets the global instance. Initialize() must be called first.
117 static DBusThreadManager* Get(); 125 static DBusThreadManager* Get();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 184
177 // Initializes |client| with the |system_bus_|. 185 // Initializes |client| with the |system_bus_|.
178 static void InitClient(DBusClient* client); 186 static void InitClient(DBusClient* client);
179 187
180 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager); 188 DISALLOW_COPY_AND_ASSIGN(DBusThreadManager);
181 }; 189 };
182 190
183 } // namespace chromeos 191 } // namespace chromeos
184 192
185 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_ 193 #endif // CHROMEOS_DBUS_DBUS_THREAD_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698