diff options
Diffstat (limited to 'chromeos/dbus/dbus_thread_manager.cc')
-rw-r--r-- | chromeos/dbus/dbus_thread_manager.cc | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/chromeos/dbus/dbus_thread_manager.cc b/chromeos/dbus/dbus_thread_manager.cc index b98e07c..164b503 100644 --- a/chromeos/dbus/dbus_thread_manager.cc +++ b/chromeos/dbus/dbus_thread_manager.cc @@ -30,7 +30,9 @@ #include "chromeos/dbus/introspectable_client.h" #include "chromeos/dbus/modem_messaging_client.h" #include "chromeos/dbus/nfc_adapter_client.h" +#include "chromeos/dbus/nfc_device_client.h" #include "chromeos/dbus/nfc_manager_client.h" +#include "chromeos/dbus/nfc_tag_client.h" #include "chromeos/dbus/permission_broker_client.h" #include "chromeos/dbus/power_manager_client.h" #include "chromeos/dbus/power_policy_controller.h" @@ -103,8 +105,11 @@ class DBusThreadManagerImpl : public DBusThreadManager { InitClient(image_burner_client_.get()); InitClient(introspectable_client_.get()); InitClient(modem_messaging_client_.get()); + // Initialize the NFC clients in the correct order. InitClient(nfc_manager_client_.get()); InitClient(nfc_adapter_client_.get()); + InitClient(nfc_device_client_.get()); + InitClient(nfc_tag_client_.get()); InitClient(permission_broker_client_.get()); InitClient(power_manager_client_.get()); InitClient(session_manager_client_.get()); @@ -269,10 +274,18 @@ class DBusThreadManagerImpl : public DBusThreadManager { return nfc_adapter_client_.get(); } + virtual NfcDeviceClient* GetNfcDeviceClient() OVERRIDE { + return nfc_device_client_.get(); + } + virtual NfcManagerClient* GetNfcManagerClient() OVERRIDE { return nfc_manager_client_.get(); } + virtual NfcTagClient* GetNfcTagClient() OVERRIDE { + return nfc_tag_client_.get(); + } + virtual PermissionBrokerClient* GetPermissionBrokerClient() OVERRIDE { return permission_broker_client_.get(); } @@ -366,9 +379,14 @@ class DBusThreadManagerImpl : public DBusThreadManager { image_burner_client_.reset(ImageBurnerClient::Create(client_type)); introspectable_client_.reset(IntrospectableClient::Create(client_type)); modem_messaging_client_.reset(ModemMessagingClient::Create(client_type)); + // Create the NFC clients in the correct order based on their dependencies. nfc_manager_client_.reset(NfcManagerClient::Create(client_type)); nfc_adapter_client_.reset( NfcAdapterClient::Create(client_type, nfc_manager_client_.get())); + nfc_device_client_.reset( + NfcDeviceClient::Create(client_type, nfc_adapter_client_.get())); + nfc_tag_client_.reset( + NfcTagClient::Create(client_type, nfc_adapter_client_.get())); permission_broker_client_.reset( PermissionBrokerClient::Create(client_type)); power_manager_client_.reset( @@ -404,11 +422,12 @@ class DBusThreadManagerImpl : public DBusThreadManager { scoped_ptr<ImageBurnerClient> image_burner_client_; scoped_ptr<IntrospectableClient> introspectable_client_; scoped_ptr<ModemMessagingClient> modem_messaging_client_; - // NfcAdapterClient depends on NfcManagerClient. We declare NfcManagerClient - // first, so that it won't be deallocated before NfcAdapterClient is done - // cleaning up. + // The declaration order for NFC client objects is important. See + // DBusThreadManager::CreateDefaultClients for the dependencies. scoped_ptr<NfcManagerClient> nfc_manager_client_; scoped_ptr<NfcAdapterClient> nfc_adapter_client_; + scoped_ptr<NfcDeviceClient> nfc_device_client_; + scoped_ptr<NfcTagClient> nfc_tag_client_; scoped_ptr<PermissionBrokerClient> permission_broker_client_; scoped_ptr<SystemClockClient> system_clock_client_; scoped_ptr<PowerManagerClient> power_manager_client_; |