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

Unified Diff: chromeos/dbus/dbus_thread_manager.h

Issue 2319783002: mash: Allow a subset of D-Bus clients to be created in DBusThreadManager (Closed)
Patch Set: cleanup Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/dbus/dbus_thread_manager.h
diff --git a/chromeos/dbus/dbus_thread_manager.h b/chromeos/dbus/dbus_thread_manager.h
index 5f1ab827f4adb8d1c65eeaa2e8be85c1dd5a43b8..ab03fedbadf190b6917bac8c66d075243b33689a 100644
--- a/chromeos/dbus/dbus_thread_manager.h
+++ b/chromeos/dbus/dbus_thread_manager.h
@@ -73,10 +73,13 @@ class CHROMEOS_EXPORT DBusThreadManager {
// Sets the global instance. Must be called before any calls to Get().
// We explicitly initialize and shut down the global object, rather than
// making it a Singleton, to ensure clean startup and shutdown.
- // This will initialize real or stub DBusClients depending on command-line
+ // This will initialize real or fake DBusClients depending on command-line
// arguments and whether this process runs in a ChromeOS environment.
static void Initialize();
+ // As above, but initializes a subset of the clients.
+ static void Initialize(DBusClientTypeMask clients);
+
// Returns a DBusThreadManagerSetter instance that allows tests to
// replace individual D-Bus clients with their own implementations.
// Also initializes the main DBusThreadManager for testing if necessary.
@@ -92,8 +95,8 @@ class CHROMEOS_EXPORT DBusThreadManager {
// Gets the global instance. Initialize() must be called first.
static DBusThreadManager* Get();
- // Returns true if |client| is stubbed.
- bool IsUsingStub(DBusClientBundle::DBusClientType client);
+ // Returns true if |client| is faked.
+ bool IsUsingFake(DBusClientBundle::DBusClientType client);
// Returns various D-Bus bus instances, owned by DBusThreadManager.
dbus::Bus* GetSystemBus();
@@ -131,24 +134,23 @@ class CHROMEOS_EXPORT DBusThreadManager {
explicit DBusThreadManager(std::unique_ptr<DBusClientBundle> client_bundle);
~DBusThreadManager();
- // Creates a global instance of DBusThreadManager with the real
- // implementations for all clients that are listed in |unstub_client_mask| and
- // stub implementations for all clients that are not included. Cannot be
- // called more than once.
- static void CreateGlobalInstance(
- DBusClientBundle::DBusClientTypeMask unstub_client_mask);
+ // Creates a global instance of DBusThreadManager with real implementations
+ // for all clients in |real_clients| and fake implementations for all clients
+ // in |fake_clients|. Cannot be called more than once.
+ static void CreateGlobalInstance(DBusClientTypeMask real_clients,
+ DBusClientTypeMask fake_clients);
- // Initialize global thread manager instance with all real dbus client
- // implementations.
- static void InitializeWithRealClients();
+ // Initializes global thread manager instance with all real dbus clients.
+ static void InitializeWithRealClients(DBusClientTypeMask real_clients);
- // Initialize global thread manager instance with stubbed-out dbus clients
- // implementation.
- static void InitializeWithStubs();
+ // Initializes global thread manager instance with all fake dbus clients.
+ static void InitializeWithFakeClients(DBusClientTypeMask fake_clients);
- // Initialize with stub implementations for only certain clients that are
- // not included in the comma-separated |unstub_clients| list.
- static void InitializeWithPartialStub(const std::string& unstub_clients);
+ // Initializes the clients in |clients|. Use fake clients except for those in
+ // the comma-separated |force_real_clients_list|.
Daniel Erat 2016/09/07 20:31:59 do you mind updating this comment to describe the
James Cook 2016/09/07 20:58:12 Done.
+ static void InitializeWithPartialFakes(
+ DBusClientTypeMask clients,
+ const std::string& force_real_clients_list);
// Initializes all currently stored DBusClients with the system bus and
// performs additional setup.

Powered by Google App Engine
This is Rietveld 408576698