Index: chromeos/dbus/dbus_thread_manager.h |
diff --git a/chromeos/dbus/dbus_thread_manager.h b/chromeos/dbus/dbus_thread_manager.h |
index a66e90496b11d424814beaea07015d02501e3f7b..d15eb20a7d8ef059c848884e825bb061fe353d5f 100644 |
--- a/chromeos/dbus/dbus_thread_manager.h |
+++ b/chromeos/dbus/dbus_thread_manager.h |
@@ -86,6 +86,8 @@ 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 |
+ // arguments and whether this process runs in a ChromeOS environment. |
static void Initialize(); |
// Returns a DBusThreadManagerSetter instance that allows tests to |
@@ -104,7 +106,7 @@ class CHROMEOS_EXPORT DBusThreadManager { |
static DBusThreadManager* Get(); |
// Returns true if |client| is stubbed. |
- static bool IsUsingStub(DBusClientBundle::DBusClientType client); |
+ bool IsUsingStub(DBusClientBundle::DBusClientType client); |
// Returns various D-Bus bus instances, owned by DBusThreadManager. |
dbus::Bus* GetSystemBus(); |
@@ -151,36 +153,34 @@ class CHROMEOS_EXPORT DBusThreadManager { |
private: |
friend class DBusThreadManagerSetter; |
- DBusThreadManager(); |
+ // Creates a new DBusThreadManager using the DBusClients set in |
+ // |client_bundle|. |
+ DBusThreadManager(scoped_ptr<DBusClientBundle> client_bundle); |
hashimoto
2014/09/11 06:50:45
'explicit' missing?
pneubeck (no reviews)
2014/09/11 08:08:19
hm. wasn't catched by presubmit.
Done.
|
~DBusThreadManager(); |
- // Creates a global instance of DBusThreadManager. Can not be called more |
- // than once. |
- static void CreateGlobalInstance(); |
+ // 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); |
- // Initialize global thread manager instance. |
- static void InitializeRegular(); |
+ // Initialize global thread manager instance with all real dbus client |
+ // implementations. |
+ static void InitializeWithRealClients(); |
// Initialize global thread manager instance with stubbed-out dbus clients |
// implementation. |
static void InitializeWithStubs(); |
// Initialize with stub implementations for only certain clients that are |
- // not included in comma-separated |unstub_clients| list. |
+ // not included in the comma-separated |unstub_clients| list. |
static void InitializeWithPartialStub(const std::string& unstub_clients); |
- // Constructs all clients and stores them in the respective *_client_ member |
- // variable. |
- void CreateDefaultClients(); |
- |
- // Constructs all clients and stores them in the respective *_client_ member |
- // variable. |
+ // Initializes all currently stored DBusClients with the system bus and |
+ // creates a stub network environment. |
hashimoto
2014/09/11 06:50:45
This comment is not always true as DBusClientBundl
pneubeck (no reviews)
2014/09/11 08:08:19
Done.
|
void InitializeClients(); |
- // Bitmask that defines which dbus clients are not stubbed out. Bitmap flags |
- // are defined within DBusClientBundle::DBusClientType enum. |
- static DBusClientBundle::DBusClientTypeMask unstub_client_mask_; |
- |
scoped_ptr<base::Thread> dbus_thread_; |
scoped_refptr<dbus::Bus> system_bus_; |
scoped_ptr<DBusClientBundle> client_bundle_; |