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

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: WIP, add DBusThreadManagerAsh and DBusThreadManagerChrome 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
« no previous file with comments | « chromeos/dbus/dbus_client_implementation_type.h ('k') | chromeos/dbus/dbus_thread_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..33c00f1eb2acaa8a9111d1bfbcf8c0fbe62aba32 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,24 @@ 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 |force_real_clients_list|, comma-separated like "bluetooth,cras,shill".
+ // See dbus_client_bundle.cc for the client names.
+ 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.
« no previous file with comments | « chromeos/dbus/dbus_client_implementation_type.h ('k') | chromeos/dbus/dbus_thread_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698